apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r649000 - in /apr/apr/trunk: include/arch/win32/apr_arch_misc.h misc/win32/misc.c
Date Thu, 17 Apr 2008 08:30:17 GMT
Author: mturk
Date: Thu Apr 17 01:30:14 2008
New Revision: 649000

URL: http://svn.apache.org/viewvc?rev=649000&view=rev
Log:
Fix compile time warnings by properly casting to 64 or 32 bits

Modified:
    apr/apr/trunk/include/arch/win32/apr_arch_misc.h
    apr/apr/trunk/misc/win32/misc.c

Modified: apr/apr/trunk/include/arch/win32/apr_arch_misc.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/arch/win32/apr_arch_misc.h?rev=649000&r1=648999&r2=649000&view=diff
==============================================================================
--- apr/apr/trunk/include/arch/win32/apr_arch_misc.h (original)
+++ apr/apr/trunk/include/arch/win32/apr_arch_misc.h Thu Apr 17 01:30:14 2008
@@ -180,7 +180,7 @@
     DLL_defined = 6        // must define as last idx_ + 1
 } apr_dlltoken_e;
 
-FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char *fnName, int ordinal);
+FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, const char *fnName, int ordinal);
 
 /* The apr_load_dll_func call WILL return 0 set error to
  * ERROR_INVALID_FUNCTION if the function cannot be loaded

Modified: apr/apr/trunk/misc/win32/misc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/misc/win32/misc.c?rev=649000&r1=648999&r2=649000&view=diff
==============================================================================
--- apr/apr/trunk/misc/win32/misc.c (original)
+++ apr/apr/trunk/misc/win32/misc.c Thu Apr 17 01:30:14 2008
@@ -165,7 +165,7 @@
 static HMODULE lateDllHandle[DLL_defined] = {
      NULL,       NULL,       NULL,       NULL,     NULL,       NULL       };
 
-FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, char* fnName, int ordinal)
+FARPROC apr_load_dll_func(apr_dlltoken_e fnLib, const char* fnName, int ordinal)
 {
     if (!lateDllHandle[fnLib]) { 
         lateDllHandle[fnLib] = LoadLibraryA(lateDllName[fnLib]);
@@ -174,12 +174,14 @@
     }
 #if defined(_WIN32_WCE)
     if (ordinal)
-        return GetProcAddressA(lateDllHandle[fnLib], (char *) ordinal);
+        return GetProcAddressA(lateDllHandle[fnLib], (const char *)
+                                                     (apr_ssize_t)ordinal);
     else
         return GetProcAddressA(lateDllHandle[fnLib], fnName);
 #else
     if (ordinal)
-        return GetProcAddress(lateDllHandle[fnLib], (char *) ordinal);
+        return GetProcAddress(lateDllHandle[fnLib], (const char *)
+                                                    (apr_ssize_t)ordinal);
     else
         return GetProcAddress(lateDllHandle[fnLib], fnName);
 #endif
@@ -220,8 +222,8 @@
     }
 
     if (!nh) {
-        (sprintf)(sbuf, "%08x %08x %08x %s() %s:%d\n",
-                  (DWORD)ha, seq, GetCurrentThreadId(), fn, fl, ln);
+        (sprintf)(sbuf, "%p %08x %08x %s() %s:%d\n",
+                  ha, seq, GetCurrentThreadId(), fn, fl, ln);
         (EnterCriticalSection)(&cs);
         (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL);
         (LeaveCriticalSection)(&cs);
@@ -234,21 +236,21 @@
             HANDLE *hv = va_arg(a, HANDLE*);
             char *dsc = va_arg(a, char*);
             if (strcmp(dsc, "Signaled") == 0) {
-                if ((DWORD)ha >= STATUS_WAIT_0 
-                       && (DWORD)ha < STATUS_ABANDONED_WAIT_0) {
-                    hv += (DWORD)ha;
+                if ((apr_ssize_t)ha >= STATUS_WAIT_0 
+                       && (apr_ssize_t)ha < STATUS_ABANDONED_WAIT_0) {
+                    hv += (apr_ssize_t)ha;
                 }
-                else if ((DWORD)ha >= STATUS_ABANDONED_WAIT_0
-                            && (DWORD)ha < STATUS_USER_APC) {
-                    hv += (DWORD)ha - STATUS_ABANDONED_WAIT_0;
+                else if ((apr_ssize_t)ha >= STATUS_ABANDONED_WAIT_0
+                            && (apr_ssize_t)ha < STATUS_USER_APC) {
+                    hv += (apr_ssize_t)ha - STATUS_ABANDONED_WAIT_0;
                     dsc = "Abandoned";
                 }
-                else if ((DWORD)ha == WAIT_TIMEOUT) {
+                else if ((apr_ssize_t)ha == WAIT_TIMEOUT) {
                     dsc = "Timed Out";
                 }
             }
-            (sprintf)(sbuf, "%08x %08x %08x %s(%s) %s:%d\n",
-                      (DWORD*)*hv, seq, GetCurrentThreadId(), 
+            (sprintf)(sbuf, "%p %08x %08x %s(%s) %s:%d\n",
+                      *hv, seq, GetCurrentThreadId(), 
                       fn, dsc, fl, ln);
             (WriteFile)(fh, sbuf, (DWORD)strlen(sbuf), &wrote, NULL);
         } while (--nh);



Mime
View raw message