[ion] ion_main takes const arguments

This commit is contained in:
Romain Goyet
2019-10-10 16:49:46 +02:00
committed by LeaNumworks
parent 577e7db8dd
commit 758c217120
8 changed files with 8 additions and 9 deletions

View File

@@ -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, ':'));

View File

@@ -28,7 +28,7 @@ public:
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

View File

@@ -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) {
@@ -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();

View File

@@ -38,7 +38,7 @@ public:
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();

View File

@@ -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 {

View File

@@ -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) {

View File

@@ -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) {

View File

@@ -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