ecere: Corrected Linux warning fixes for Windows; compiler/bootstrap: Updated
authorJerome St-Louis <jerome@ecere.com>
Thu, 5 Jun 2014 18:15:59 +0000 (14:15 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 5 Jun 2014 18:17:01 +0000 (14:17 -0400)
compiler/bootstrap/ecere/bootstrap/System.c
compiler/bootstrap/libec/bootstrap/ecdefs.c
compiler/bootstrap/libec/bootstrap/lexer.c
compiler/bootstrap/libec/bootstrap/pass15.c
compiler/libec/src/lexer.ec
ecere/src/gui/GuiApplication.ec
ecere/src/net/Service.ec
ecere/src/net/Socket.ec

index 56af146..eb4a87c 100644 (file)
@@ -604,7 +604,7 @@ if(__ecereNameSpace__ecere__sys__globalSystem.errorBuffer && __ecereNameSpace__e
 {
 if(display)
 {
-printf(__ecereNameSpace__ecere__sys__globalSystem.errorBuffer);
+printf("%s", __ecereNameSpace__ecere__sys__globalSystem.errorBuffer);
 }
 __ecereNameSpace__ecere__sys__globalSystem.errorBuffer[0] = '\0';
 }
index 2887094..0d83f7e 100644 (file)
@@ -1871,7 +1871,7 @@ else
 __ecereNameSpace__ecere__sys__GetWorkingDir(string, sizeof (string));
 __ecereNameSpace__ecere__sys__PathCat(string, sourceFile);
 }
-printf(string);
+printf("%s", string);
 printf(__ecereNameSpace__ecere__GetTranslatedString("ec", ":%d:%d: error: ", (((void *)0))), yylloc.start.line, yylloc.start.charPos);
 __builtin_va_start(args, format);
 vsnprintf(string, sizeof (string), format, args);
@@ -1921,7 +1921,7 @@ __ecereNameSpace__ecere__sys__PathCat(string, sourceFile);
 __ecereNameSpace__ecere__sys__GetLastDirectory(string, fileName);
 if(!strcmp(fileName, "intrin-impl.h"))
 return ;
-printf(string);
+printf("%s", string);
 printf(__ecereNameSpace__ecere__GetTranslatedString("ec", ":%d:%d: warning: ", (((void *)0))), yylloc.start.line, yylloc.start.charPos);
 __builtin_va_start(args, format);
 vsnprintf(string, sizeof (string), format, args);
index ce0288b..7953341 100644 (file)
@@ -2524,7 +2524,7 @@ break;
 }
 if(include_stack_ptr >= (30))
 {
-fprintf((bsl_stderr()), __ecereNameSpace__ecere__GetTranslatedString("ec", "Includes nested too deeply", (((void *)0))));
+fprintf((bsl_stderr()), "%s", __ecereNameSpace__ecere__GetTranslatedString("ec", "Includes nested too deeply", (((void *)0))));
 exit(1);
 }
 if(inCompiler || !FindIncludeFileID(includeFile))
index f2de856..701f02d 100644 (file)
@@ -11761,7 +11761,7 @@ result = GetOpDouble(op, &op->__anon1.d);
 break;
 case 13:
 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
-result = GetOpUIntPtr(op, &op->__anon1.ui64);
+result = GetOpUInt64(op, &op->__anon1.ui64);
 break;
 case 15:
 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 4 || op->kind == 5 || op->kind == 6 || op->kind == 7 || op->kind == 13 || op->kind == 15 || op->kind == 22 || op->kind == 23 || op->kind == 24)
@@ -11769,11 +11769,11 @@ result = isSigned ? GetOpInt(op, &op->__anon1.i) : GetOpUInt(op, &op->__anon1.ui
 break;
 case 22:
 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
-result = isSigned ? GetOpIntPtr(op, &op->__anon1.i64) : GetOpUIntPtr(op, &op->__anon1.ui64);
+result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
 break;
 case 23:
 if(op->kind == 1 || op->kind == 2 || op->kind == 3 || op->kind == 5 || op->kind == 15 || op->kind == 24)
-result = isSigned ? GetOpIntSize(op, &op->__anon1.i64) : GetOpUIntSize(op, &op->__anon1.ui64);
+result = isSigned ? GetOpInt64(op, &op->__anon1.i64) : GetOpUInt64(op, &op->__anon1.ui64);
 break;
 }
 return result;
index 4d3b585..bdc9f4b 100644 (file)
@@ -3512,7 +3512,7 @@ int preprocessor()
 
       if ( include_stack_ptr >= MAX_INCLUDE_DEPTH )
       {
-         fprintf( stderr, $"Includes nested too deeply" );
+         fprintf( stderr, "%s", $"Includes nested too deeply" );
          exit( 1 );
       }
 
index 0067775..626a7de 100644 (file)
@@ -33,7 +33,7 @@ namespace gui;
 
 #if !defined(ECERE_VANILLA) && !defined(ECERE_NONET)
 #if defined(__WIN32__)
-
+#define SOCKLEN_TYPE int
 #define WIN32_LEAN_AND_MEAN
 #define String _String
 #include <winsock.h>
@@ -42,6 +42,7 @@ namespace gui;
 #elif defined(__unix__) || defined(__APPLE__)
 
 default:
+#define SOCKLEN_TYPE socklen_t
 #define uint _uint
 #define set _set
 #include <sys/time.h>
@@ -942,7 +943,7 @@ public:
                      {
                         SOCKET s;
                         SOCKADDR_IN a;
-                        uint addrLen = sizeof(a);
+                        SOCKLEN_TYPE addrLen = sizeof(a);
                         s = accept(service.s,(SOCKADDR *)&a,&addrLen);
                         closesocket(s);
                      }
index 6f519f6..6169a41 100644 (file)
@@ -5,7 +5,7 @@ namespace net;
 #ifndef ECERE_NONET
 
 #if defined(__WIN32__)
-
+#define SOCKLEN_TYPE int
 #define WIN32_LEAN_AND_MEAN
 #define String _String
 #include <winsock.h>
@@ -13,6 +13,7 @@ namespace net;
 
 #elif defined(__unix__) || defined(__APPLE__)
 default:
+#define SOCKLEN_TYPE socklen_t
 #define set _set
 #define uint _uint
 #include <sys/time.h>
@@ -169,7 +170,7 @@ public:
                {
                   SOCKET s;
                   SOCKADDR_IN a;
-                  uint addrLen = sizeof(a);
+                  SOCKLEN_TYPE addrLen = sizeof(a);
                   s = accept(this.s,(SOCKADDR *)&a,&addrLen);
                   closesocket(s);
                }
index 5eb91f4..6292783 100644 (file)
@@ -8,10 +8,12 @@ namespace net;
 #define String _String
 #include <winsock.h>
 #undef String
+#define SOCKLEN_TYPE int
 
 #elif defined(__unix__) || defined(__APPLE__)
 
 default:
+#define SOCKLEN_TYPE socklen_t
 #define set _set
 #define uint _uint
 #include <sys/time.h>
@@ -132,7 +134,7 @@ public:
          {
             SOCKET s;
             SOCKADDR_IN a;
-            uint addrLen = sizeof(a);
+            SOCKLEN_TYPE addrLen = sizeof(a);
 
             value.accepted = true;
             s = accept(value.s,(SOCKADDR *)&a, &addrLen);
@@ -626,7 +628,7 @@ private:
                count = ReceiveData(recvBuffer + recvBytes, recvBufferSize - recvBytes, 0);
             else
             {
-               uint len = sizeof(a);
+               SOCKLEN_TYPE len = sizeof(a);
                count = (int)recvfrom(s, (char *)recvBuffer + recvBytes,
                   recvBufferSize - recvBytes, 0, (SOCKADDR *)&a, &len);
                strcpy(inetAddress, inet_ntoa(this.a.sin_addr));