dotgnu-pnet-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[dotgnu-pnet-commits] pnet ChangeLog support/wait_mutex.c


From: Klaus Treichel
Subject: [dotgnu-pnet-commits] pnet ChangeLog support/wait_mutex.c
Date: Sun, 23 Mar 2008 10:52:32 +0000

CVSROOT:        /cvsroot/dotgnu-pnet
Module name:    pnet
Changes by:     Klaus Treichel <ktreichel>      08/03/23 10:52:32

Modified files:
        .              : ChangeLog 
        support        : wait_mutex.c 

Log message:
        Fix some compiler warnings in support/wait_mutex.c

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/pnet/ChangeLog?cvsroot=dotgnu-pnet&r1=1.3535&r2=1.3536
http://cvs.savannah.gnu.org/viewcvs/pnet/support/wait_mutex.c?cvsroot=dotgnu-pnet&r1=1.16&r2=1.17

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/ChangeLog,v
retrieving revision 1.3535
retrieving revision 1.3536
diff -u -b -r1.3535 -r1.3536
--- ChangeLog   3 Feb 2008 11:10:15 -0000       1.3535
+++ ChangeLog   23 Mar 2008 10:52:31 -0000      1.3536
@@ -1,3 +1,9 @@
+2008-03-23  Klaus Treichel  <address@hidden>
+
+       * support/wait_mutex.c: Fix compiler warnings on X86_64. Number of 
shifted
+       bits of the pointer for the hashtable depends on the size of void * and
+       not on the size of int.
+
 2008-02-03  Andreas Färber  <address@hidden>
 
        * csdoc/doc_valil.c, engine/lib_string.c: Move variable declarations

Index: support/wait_mutex.c
===================================================================
RCS file: /cvsroot/dotgnu-pnet/pnet/support/wait_mutex.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -b -r1.16 -r1.17
--- support/wait_mutex.c        21 Jun 2004 05:11:55 -0000      1.16
+++ support/wait_mutex.c        23 Mar 2008 10:52:32 -0000      1.17
@@ -168,7 +168,11 @@
 
                /* Grow the new hashtable */
                
+       #if SIZEOF_INT <= 4
+               if (wakeup->ownedMutexesCapacity >= (IL_MAX_INT32) / 2)
+       #else
                if (wakeup->ownedMutexesCapacity >= (IL_MAX_NATIVE_INT) / 2)
+       #endif
                {
                        return;
                }
@@ -213,10 +217,10 @@
                
                        /* Find the new available bucket in the new hashtable */
 
-                       #if SIZEOF_INT <= 4
-                               x = (((int)ownedMutexes[i]) >> 2) % newCapacity;
+                       #if SIZEOF_VOID_P <= 4
+                               x = (int)(((ILNativeInt)ownedMutexes[i]) >> 2) 
% newCapacity;
                        #else
-                               x = (((int)ownedMutexes[i]) >> 3) % newCapacity;
+                               x = (int)(((ILNativeInt)ownedMutexes[i]) >> 3) 
% newCapacity;
                        #endif
                        
                        for (;;)
@@ -240,10 +244,10 @@
 
        /* Get the initial bucket to try putting the mutex in */
        
-       #if SIZEOF_INT <= 4
-               i = (((int)mutex) >> 2) % wakeup->ownedMutexesCapacity;
+       #if SIZEOF_VOID_P <= 4
+               i = (int)(((ILNativeInt)mutex) >> 2) % 
wakeup->ownedMutexesCapacity;
        #else
-               i = (((int)mutex) >> 3) % wakeup->ownedMutexesCapacity;
+               i = (int)(((ILNativeInt)mutex) >> 3) % 
wakeup->ownedMutexesCapacity;
        #endif
 
        /* Scan the hashtable and find an empty bucket for the mutex */
@@ -277,10 +281,10 @@
 
        /* Get the initial (and correct right) bucket */
 
-       #if SIZEOF_INT <= 4
-               j = i = (((int)mutex) >> 2) % wakeup->ownedMutexesCapacity;
+       #if SIZEOF_VOID_P <= 4
+               j = i = (int)(((ILNativeInt)mutex) >> 2) % 
wakeup->ownedMutexesCapacity;
        #else
-               j = i = (((int)mutex) >> 3) % wakeup->ownedMutexesCapacity;
+               j = i = (int)(((ILNativeInt)mutex) >> 3) % 
wakeup->ownedMutexesCapacity;
        #endif
 
        /* Scan the hashtable and clear the entry for the mutex (if found) */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]