[svn:parrot] r39935 - trunk/config/gen/platform/win32

fperrad at svn.parrot.org fperrad at svn.parrot.org
Tue Jul 7 17:14:51 UTC 2009


Author: fperrad
Date: Tue Jul  7 17:14:49 2009
New Revision: 39935
URL: https://trac.parrot.org/parrot/changeset/39935

Log:
[mingw] fix gcc 4.4.0 warning :
request for implicit conversion from 'x' to 'y' not permitted in C++

Modified:
   trunk/config/gen/platform/win32/dl.c
   trunk/config/gen/platform/win32/env.c
   trunk/config/gen/platform/win32/exec.c

Modified: trunk/config/gen/platform/win32/dl.c
==============================================================================
--- trunk/config/gen/platform/win32/dl.c	Tue Jul  7 14:27:40 2009	(r39934)
+++ trunk/config/gen/platform/win32/dl.c	Tue Jul  7 17:14:49 2009	(r39935)
@@ -78,7 +78,7 @@
 void *
 Parrot_dlsym(void *handle, const char *symbol)
 {
-    return (void *)GetProcAddress(handle, symbol);
+    return (void *)GetProcAddress((HINSTANCE)handle, symbol);
 }
 
 /*
@@ -102,7 +102,7 @@
 int
 Parrot_dlclose(void *handle)
 {
-    return FreeLibrary(handle)? 0: 1;
+    return FreeLibrary((HMODULE)handle)? 0: 1;
 }
 
 /*

Modified: trunk/config/gen/platform/win32/env.c
==============================================================================
--- trunk/config/gen/platform/win32/env.c	Tue Jul  7 14:27:40 2009	(r39934)
+++ trunk/config/gen/platform/win32/env.c	Tue Jul  7 17:14:49 2009	(r39935)
@@ -54,7 +54,7 @@
         const int value_len = strlen(value);
 
         {
-            char * const envstring = mem_internal_allocate(
+            char * const envstring = (char * const)mem_internal_allocate(
                     name_len     /* name  */
                     + 1          /* '='   */
                     + value_len  /* value */
@@ -106,7 +106,7 @@
     else {
         *free_it = 1;
     }
-    buffer = mem_sys_allocate(size);
+    buffer = (char *)mem_sys_allocate(size);
     GetEnvironmentVariable(name, buffer, size);
 
     return buffer;

Modified: trunk/config/gen/platform/win32/exec.c
==============================================================================
--- trunk/config/gen/platform/win32/exec.c	Tue Jul  7 14:27:40 2009	(r39934)
+++ trunk/config/gen/platform/win32/exec.c	Tue Jul  7 17:14:49 2009	(r39935)
@@ -42,7 +42,7 @@
     STARTUPINFO si;
     PROCESS_INFORMATION pi;
     int free_it = 0;
-    char* cmd = mem_sys_allocate(command->strlen + 4);
+    char* cmd = (char *)mem_sys_allocate(command->strlen + 4);
     char* shell = Parrot_getenv("ComSpec", &free_it);
     char* cmdin = Parrot_str_to_cstring(interp, command);
 
@@ -98,7 +98,7 @@
     int pmclen;
     int cmdlinelen = 1000;
     int cmdlinepos = 0;
-    char *cmdline = mem_sys_allocate(cmdlinelen);
+    char *cmdline = (char *)mem_sys_allocate(cmdlinelen);
     int i;
 
     /* Ensure there's something in the PMC array. */
@@ -113,7 +113,7 @@
         char *cs  = Parrot_str_to_cstring(interp, s);
         if (cmdlinepos + (int)s->strlen + 3 > cmdlinelen) {
             cmdlinelen += s->strlen + 4;
-            cmdline = mem_sys_realloc(cmdline, cmdlinelen);
+            cmdline = (char *)mem_sys_realloc(cmdline, cmdlinelen);
         }
         strcpy(cmdline + cmdlinepos, "\"");
         strcpy(cmdline + cmdlinepos + 1, cs);
@@ -164,7 +164,7 @@
     int status;
     char *in = Parrot_str_to_cstring(interp, command);
     char *cmd = NULL;
-    const char **argv = mem_sys_allocate_zeroed(2 * sizeof (int));
+    const char **argv = (const char **)mem_sys_allocate_zeroed(2 * sizeof (int));
 
     /* Grab string, extract command and parameters. */
     char *curPos  = in;
@@ -196,7 +196,7 @@
             int lenFound = curPos - lastCommandStart;
             if (*(curPos + 1) == 0)
                 lenFound++;
-            tmp = mem_sys_allocate(1 + lenFound);
+            tmp = (char *)mem_sys_allocate(1 + lenFound);
             memcpy(tmp, lastCommandStart, lenFound);
             *(tmp + lenFound) = 0;
 
@@ -210,7 +210,7 @@
             {
                 /* Allocate space for another pointer in **argv. */
                 argc++;
-                argv = mem_sys_realloc(argv, (argc + 1) * sizeof (int));
+                argv = (const char **)mem_sys_realloc(argv, (argc + 1) * sizeof (int));
                 *(argv + (argc - 1)) = tmp;
                 *(argv + argc) = NULL;
             }


More information about the parrot-commits mailing list