Skip to content

Commit

Permalink
[ion] ion_main takes const arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Ecco authored and LeaNumworks committed Oct 16, 2019
1 parent 577e7db commit 758c217
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/code/app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ bool App::Snapshot::lockOnConsole() const {
return m_lockOnConsole;
}

void App::Snapshot::setOpt(const char * name, char * value) {
void App::Snapshot::setOpt(const char * name, const char * value) {
if (strcmp(name, "script") == 0) {
m_scriptStore.deleteAllScripts();
char * separator = const_cast<char *>(UTF8Helper::CodePointSearch(value, ':'));
Expand Down
2 changes: 1 addition & 1 deletion apps/code/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class App : public Shared::InputEventHandlerDelegateApp {
ScriptStore * scriptStore();
#if EPSILON_GETOPT
bool lockOnConsole() const;
void setOpt(const char * name, char * value) override;
void setOpt(const char * name, const char * value) override;
#endif
private:
#if EPSILON_GETOPT
Expand Down
4 changes: 2 additions & 2 deletions apps/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define DUMMY_MAIN 0
#if DUMMY_MAIN

void ion_main(int argc, char * argv[]) {
void ion_main(int argc, const char * const argv[]) {
// Initialize the backlight
Ion::Backlight::init();
while (1) {
Expand All @@ -18,7 +18,7 @@ void ion_main(int argc, char * argv[]) {

#else

void ion_main(int argc, char * argv[]) {
void ion_main(int argc, const char * const argv[]) {
// Initialize Poincare::TreePool::sharedPool
Poincare::Init();

Expand Down
2 changes: 1 addition & 1 deletion escher/include/escher/app.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class App : public Responder {
virtual void storageDidChangeForRecord(Ion::Storage::Record) {}
virtual Descriptor * descriptor() = 0;
#if EPSILON_GETOPT
virtual void setOpt(const char * name, char * value) {}
virtual void setOpt(const char * name, const char * value) {}
#endif
/* tidy clean all dynamically-allocated data */
virtual void tidy();
Expand Down
2 changes: 1 addition & 1 deletion ion/include/ion.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* Don't worry though, once all its initialization will be performed, ION will
* jump to your code at ion_main, which you have to implement yourself. */

void ion_main(int argc, char * argv[]);
void ion_main(int argc, const char * const argv[]);

namespace Ion {

Expand Down
1 change: 0 additions & 1 deletion ion/src/simulator/shared/main_headless.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ char heap[kHeapSize];
extern "C" {
char * _heap_start = (char *)heap;
char * _heap_end = _heap_start+kHeapSize;
int main(int argc, char * argv[]);
}

void Ion::Timing::msleep(uint32_t ms) {
Expand Down
2 changes: 1 addition & 1 deletion ion/src/simulator/shared/main_sdl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ void Ion::Timing::msleep(uint32_t ms) {
}

int main(int argc, char * argv[]) {
std::vector<char *> arguments(argv, argv + argc);
std::vector<const char *> arguments(argv, argv + argc);

char * language = IonSimulatorGetLanguageCode();
if (language != nullptr) {
Expand Down
2 changes: 1 addition & 1 deletion quiz/src/runner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static inline void ion_main_inner() {
quiz_print("ALL TESTS FINISHED");
}

void ion_main(int argc, char * argv[]) {
void ion_main(int argc, const char * const argv[]) {
// Initialize the backlight
Ion::Backlight::init();
// Initialize Poincare::TreePool::sharedPool
Expand Down

0 comments on commit 758c217

Please sign in to comment.