sdk: const correctness
[sdk] / compiler / ecc / ecc.ec
index c3b20ea..0ea90d5 100644 (file)
@@ -12,7 +12,7 @@ import "ec"
 static Context globalContext { };
 static Module privateModule;
 static ModuleImport mainModule;
-static OldList _excludedSymbols { offset = (uint)&((Symbol)0).left };
+static OldList _excludedSymbols { offset = (uint)(uintptr)&((Symbol)0).left };
 static OldList defines, imports;
 static NameSpace globalData
 {
@@ -115,7 +115,7 @@ static void OutputImports(char * fileName)
 }
 
 #ifdef _DEBUG
-static bool TestType(String string, String expected)
+/*static bool TestType(String string, String expected)
 {
    bool result = true;
    char typeString[1024] = { 0 };
@@ -228,6 +228,7 @@ static void TestTypes()
 
    PrintLn("\n", succeeded, " / ", count, " tests succeeded.");
 }
+*/
 #endif
 
 class CompilerApp : Application
@@ -291,7 +292,7 @@ class CompilerApp : Application
 
       for(c = 1; c<argc; c++)
       {
-         char * arg = argv[c];
+         const char * arg = argv[c];
          if(arg[0] == '-')
          {
             if(!strcmp(arg + 1, "m32") || !strcmp(arg + 1, "m64"))
@@ -365,7 +366,7 @@ class CompilerApp : Application
                if(c + 1 < argc)
                {
                   char * buf;
-                  char * arg1 = argv[++c];
+                  const char * arg1 = argv[++c];
                   int size = cppOptionsLen + 1 + strlen(arg) * 2 + strlen(arg1) * 2 + 1;
                   cppOptions = renew cppOptions char[size];
                   buf = cppOptions + cppOptionsLen;
@@ -470,8 +471,8 @@ class CompilerApp : Application
          SetTargetPlatform(targetPlatform);
          SetTargetBits(targetBits);
          SetEchoOn(false);
-
-         privateModule = (Module)__ecere_COM_Initialize(true | (targetBits == sizeof(uintptr)*8 ? 0 : targetBits == 64 ? 2 : targetBits==32 ? 4 : 0) | 8, 1, null);
+                                                        // TOFIX: Use a bit class instead of a bool to store target bits information
+         privateModule = (Module)__ecere_COM_Initialize((bool)(true | (targetBits == sizeof(uintptr)*8 ? 0 : targetBits == 64 ? 2 : targetBits==32 ? 4 : 0) | 8), 1, null);
          SetPrivateModule(privateModule);
 
          globalContext.types.Add((BTNode)Symbol { string = CopyString("uint"), type = ProcessTypeString("unsigned int", false) });