apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1763666 - in /apr/apr/trunk: atomic/netware/ atomic/os390/ atomic/unix/ atomic/win32/ include/
Date Thu, 06 Oct 2016 21:20:04 GMT
Author: ylavic
Date: Thu Oct  6 21:20:04 2016
New Revision: 1763666

URL: http://svn.apache.org/viewvc?rev=1763666&view=rev
Log:
atomic: fix API of atomic_{cas,xchg}ptr() for APR-2.
The pointer ought to be declared volatile, not void.


Modified:
    apr/apr/trunk/atomic/netware/apr_atomic.c
    apr/apr/trunk/atomic/os390/atomic.c
    apr/apr/trunk/atomic/unix/builtins.c
    apr/apr/trunk/atomic/unix/ia32.c
    apr/apr/trunk/atomic/unix/mutex.c
    apr/apr/trunk/atomic/unix/ppc.c
    apr/apr/trunk/atomic/unix/s390.c
    apr/apr/trunk/atomic/unix/solaris.c
    apr/apr/trunk/atomic/win32/apr_atomic.c
    apr/apr/trunk/include/apr_atomic.h

Modified: apr/apr/trunk/atomic/netware/apr_atomic.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/netware/apr_atomic.c?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/atomic/netware/apr_atomic.c (original)
+++ apr/apr/trunk/atomic/netware/apr_atomic.c Thu Oct  6 21:20:04 2016
@@ -64,12 +64,12 @@ APR_DECLARE(int) apr_atomic_dec32(volati
     return (atomic_xchgadd((unsigned long *)mem, 0xFFFFFFFF) - 1);
 }
 
-APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
+APR_DECLARE(void *) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp)
 {
     return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with);
 }
 
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with)
 {
     return (void*)atomic_xchg((unsigned long *)mem,(unsigned long)with);
 }

Modified: apr/apr/trunk/atomic/os390/atomic.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/os390/atomic.c?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/atomic/os390/atomic.c (original)
+++ apr/apr/trunk/atomic/os390/atomic.c Thu Oct  6 21:20:04 2016
@@ -83,7 +83,7 @@ apr_uint32_t apr_atomic_cas32(volatile a
 }
 
 #if APR_SIZEOF_VOIDP == 4
-void *apr_atomic_casptr(volatile void **mem_ptr,
+void *apr_atomic_casptr(void *volatile *mem_ptr,
                         void *swap_ptr,
                         const void *cmp_ptr)
 {
@@ -93,7 +93,7 @@ void *apr_atomic_casptr(volatile void **
      return (void *)cmp_ptr;
 }
 #elif APR_SIZEOF_VOIDP == 8
-void *apr_atomic_casptr(volatile void **mem_ptr,
+void *apr_atomic_casptr(void *volatile *mem_ptr,
                         void *swap_ptr,
                         const void *cmp_ptr)
 {
@@ -118,7 +118,7 @@ apr_uint32_t apr_atomic_xchg32(volatile
     return old;
 }
 
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem_ptr, void *new_ptr)
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem_ptr, void *new_ptr)
 {
     void *old_ptr;
 

Modified: apr/apr/trunk/atomic/unix/builtins.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/unix/builtins.c?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/atomic/unix/builtins.c (original)
+++ apr/apr/trunk/atomic/unix/builtins.c Thu Oct  6 21:20:04 2016
@@ -66,12 +66,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xch
     return __sync_lock_test_and_set(mem, val);
 }
 
-APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
+APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp)
 {
     return (void*) __sync_val_compare_and_swap(mem, cmp, with);
 }
 
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with)
 {
     __sync_synchronize();
 

Modified: apr/apr/trunk/atomic/unix/ia32.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/unix/ia32.c?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/atomic/unix/ia32.c (original)
+++ apr/apr/trunk/atomic/unix/ia32.c Thu Oct  6 21:20:04 2016
@@ -89,7 +89,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xch
     return prev;
 }
 
-APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
+APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp)
 {
     void *prev;
 #if APR_SIZEOF_VOIDP == 4
@@ -107,7 +107,7 @@ APR_DECLARE(void*) apr_atomic_casptr(vol
     return prev;
 }
 
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with)
 {
     void *prev;
 #if APR_SIZEOF_VOIDP == 4

Modified: apr/apr/trunk/atomic/unix/mutex.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/unix/mutex.c?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/atomic/unix/mutex.c (original)
+++ apr/apr/trunk/atomic/unix/mutex.c Thu Oct  6 21:20:04 2016
@@ -174,7 +174,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xch
     return prev;
 }
 
-APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
+APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp)
 {
     void *prev;
     DECLARE_MUTEX_LOCKED(mutex, *mem);
@@ -189,7 +189,7 @@ APR_DECLARE(void*) apr_atomic_casptr(vol
     return prev;
 }
 
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with)
 {
     void *prev;
     DECLARE_MUTEX_LOCKED(mutex, *mem);

Modified: apr/apr/trunk/atomic/unix/ppc.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/unix/ppc.c?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/atomic/unix/ppc.c (original)
+++ apr/apr/trunk/atomic/unix/ppc.c Thu Oct  6 21:20:04 2016
@@ -142,7 +142,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xch
     return prev;
 }
 
-APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
+APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp)
 {
     void *prev;
 #if APR_SIZEOF_VOIDP == 4
@@ -175,7 +175,7 @@ APR_DECLARE(void*) apr_atomic_casptr(vol
     return prev;
 }
 
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with)
 {
     void *prev;
 #if APR_SIZEOF_VOIDP == 4

Modified: apr/apr/trunk/atomic/unix/s390.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/unix/s390.c?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/atomic/unix/s390.c (original)
+++ apr/apr/trunk/atomic/unix/s390.c Thu Oct  6 21:20:04 2016
@@ -110,7 +110,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xch
     return prev;
 }
 
-APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
+APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp)
 {
     void *prev = (void *) cmp;
 #if APR_SIZEOF_VOIDP == 4
@@ -129,7 +129,7 @@ APR_DECLARE(void*) apr_atomic_casptr(vol
     return prev;
 }
 
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with)
 {
     void *prev = (void *) *mem;
 #if APR_SIZEOF_VOIDP == 4

Modified: apr/apr/trunk/atomic/unix/solaris.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/unix/solaris.c?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/atomic/unix/solaris.c (original)
+++ apr/apr/trunk/atomic/unix/solaris.c Thu Oct  6 21:20:04 2016
@@ -66,12 +66,12 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xch
     return atomic_swap_32(mem, val);
 }
 
-APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
+APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp)
 {
     return atomic_cas_ptr(mem, (void*) cmp, with);
 }
 
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with)
 {
     return atomic_swap_ptr(mem, with);
 }

Modified: apr/apr/trunk/atomic/win32/apr_atomic.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/atomic/win32/apr_atomic.c?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/atomic/win32/apr_atomic.c (original)
+++ apr/apr/trunk/atomic/win32/apr_atomic.c Thu Oct  6 21:20:04 2016
@@ -89,10 +89,10 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas
 #endif
 }
 
-APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp)
+APR_DECLARE(void *) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp)
 {
 #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED)
-    return InterlockedCompareExchangePointer((void* volatile*)mem, with, (void*)cmp);
+    return InterlockedCompareExchangePointer(mem, with, (void*)cmp);
 #else
     return InterlockedCompareExchangePointer((void**)mem, with, (void*)cmp);
 #endif
@@ -107,7 +107,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xch
 #endif
 }
 
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with)
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with)
 {
     return InterlockedExchangePointer((void**)mem, with);
 }

Modified: apr/apr/trunk/include/apr_atomic.h
URL: http://svn.apache.org/viewvc/apr/apr/trunk/include/apr_atomic.h?rev=1763666&r1=1763665&r2=1763666&view=diff
==============================================================================
--- apr/apr/trunk/include/apr_atomic.h (original)
+++ apr/apr/trunk/include/apr_atomic.h Thu Oct  6 21:20:04 2016
@@ -121,7 +121,7 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xch
  * @param cmp the value to compare it to
  * @return the old value of the pointer
  */
-APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp);
+APR_DECLARE(void*) apr_atomic_casptr(void *volatile *mem, void *with, const void *cmp);
 
 /**
  * exchange a pair of pointer values
@@ -129,7 +129,7 @@ APR_DECLARE(void*) apr_atomic_casptr(vol
  * @param with what to swap it with
  * @return the old value of the pointer
  */
-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with);
+APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem, void *with);
 
 /** @} */
 



Mime
View raw message