apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r191306 - /apr/apr/trunk/shmem/win32/shm.c
Date Sat, 18 Jun 2005 18:20:00 GMT
Author: wrowe
Date: Sat Jun 18 11:19:59 2005
New Revision: 191306

URL: http://svn.apache.org/viewcvs?rev=191306&view=rev
Log:

  Fatal compiler quirk, you would think (DWORD)(n >> 32) == 0 
  if n is a DWORD.  But, alas, in release builds it doesn't.

Modified:
    apr/apr/trunk/shmem/win32/shm.c

Modified: apr/apr/trunk/shmem/win32/shm.c
URL: http://svn.apache.org/viewcvs/apr/apr/trunk/shmem/win32/shm.c?rev=191306&r1=191305&r2=191306&view=diff
==============================================================================
--- apr/apr/trunk/shmem/win32/shm.c (original)
+++ apr/apr/trunk/shmem/win32/shm.c Sat Jun 18 11:19:59 2005
@@ -19,6 +19,7 @@
 #include "apr_file_io.h"
 #include "apr_shm.h"
 #include "apr_arch_file_io.h"
+#include "limits.h"
 
 typedef struct memblock_t {
     apr_size_t size;
@@ -63,7 +64,7 @@
     apr_file_t *f;
     void *base;
     void *mapkey;
-    DWORD err;
+    DWORD err, sizelo, sizehi;
 
     reqsize += sizeof(memblock_t);
 
@@ -76,6 +77,12 @@
 
     /* Compute the granualar multiple of the pagesize */
     size = memblock * (1 + (reqsize - 1) / memblock);
+    sizelo = (DWORD)size;
+#ifdef WIN64
+    sizehi = (DWORD)(size >> 32);
+#else
+    sizehi = 0;
+#endif
 
     if (!file) {
         /* Do Anonymous, which must be passed as a duplicated handle */
@@ -109,8 +116,6 @@
 #if APR_HAS_UNICODE_FS
     IF_WIN_OS_IS_UNICODE
     {
-        DWORD sizelo = (DWORD)size;
-        DWORD sizehi = (DWORD)(size >> 32);
         hMap = CreateFileMappingW(hFile, NULL, PAGE_READWRITE, 
                                   sizehi, sizelo, mapkey);
     }
@@ -118,8 +123,6 @@
 #if APR_HAS_ANSI_FS
     ELSE_WIN_OS_IS_ANSI
     {
-        DWORD sizelo = (DWORD)size;
-        DWORD sizehi = (DWORD)(size >> 32);
         hMap = CreateFileMappingA(hFile, NULL, PAGE_READWRITE, 
                                   sizehi, sizelo, mapkey);
     }



Mime
View raw message