[MLton-commit] r7431

Wesley Terpstra wesley at mlton.org
Mon Mar 1 06:29:12 PST 2010


Fix the type cast warnings.
Casting through void* is legitimate as it prevent alias analysis.


----------------------------------------------------------------------

U   mlton/trunk/runtime/platform/mingw.c

----------------------------------------------------------------------

Modified: mlton/trunk/runtime/platform/mingw.c
===================================================================
--- mlton/trunk/runtime/platform/mingw.c	2010-02-19 14:35:13 UTC (rev 7430)
+++ mlton/trunk/runtime/platform/mingw.c	2010-03-01 14:29:12 UTC (rev 7431)
@@ -774,8 +774,9 @@
         /* Call GetNativeSystemInfo if supported or GetSystemInfo otherwise. */
         SYSTEM_INFO si;
         void (WINAPI *pGNSI)(LPSYSTEM_INFO);
-        pGNSI = (PVOID) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")),
-                                       "GetNativeSystemInfo");
+        pGNSI = (void(WINAPI *)(LPSYSTEM_INFO))
+                GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")),
+                               "GetNativeSystemInfo");
         if (NULL != pGNSI)
           pGNSI(&si);
         else
@@ -785,10 +786,10 @@
         osv.dwOSVersionInfoSize = sizeof (osv);
         /* Try to get extended information in order to be able to match the O.S. more
            precisely using osv.wProductType */
-        if (! GetVersionEx ((OSVERSIONINFO *) &osv)) {
+        if (! GetVersionEx ((OSVERSIONINFO *)(void*) &osv)) {
           ZeroMemory(&osv, sizeof(OSVERSIONINFOEX));
           osv.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
-          GetVersionEx((OSVERSIONINFO *) &osv);
+          GetVersionEx((OSVERSIONINFO *)(void*) &osv);
         }
         switch (osv.dwPlatformId) {
         case VER_PLATFORM_WIN32_NT:




More information about the MLton-commit mailing list