ASF Bugzilla – Attachment 26622 Details for
Bug 50731
apr_atomic_casptr has wrong volatile qualifier
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
apr_atomic_casptr volatile fix
casptr.patch (text/plain), 8.48 KB, created by
philip
on 2011-02-08 05:29:09 UTC
(
hide
)
Description:
apr_atomic_casptr volatile fix
Filename:
MIME Type:
Creator:
philip
Created:
2011-02-08 05:29:09 UTC
Size:
8.48 KB
patch
obsolete
>Index: atomic/win32/apr_atomic.c >=================================================================== >--- atomic/win32/apr_atomic.c (revision 1068306) >+++ atomic/win32/apr_atomic.c (working copy) >@@ -118,7 +118,7 @@ > #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); >@@ -141,7 +141,7 @@ > #endif > } > >-APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) >+APR_DECLARE(void*) apr_atomic_xchgptr(void * volatile *mem, void *with) > { > #if (defined(_M_IA64) || defined(_M_AMD64) || defined(__MINGW32__)) && !defined(RC_INVOKED) > return InterlockedExchangePointer((void**)mem, with); >Index: atomic/unix/ia32.c >=================================================================== >--- atomic/unix/ia32.c (revision 1068306) >+++ atomic/unix/ia32.c (working copy) >@@ -89,7 +89,7 @@ > 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 @@ > 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 >Index: atomic/unix/s390.c >=================================================================== >--- atomic/unix/s390.c (revision 1068306) >+++ atomic/unix/s390.c (working copy) >@@ -110,7 +110,7 @@ > 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 @@ > 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 >Index: atomic/unix/mutex.c >=================================================================== >--- atomic/unix/mutex.c (revision 1068306) >+++ atomic/unix/mutex.c (working copy) >@@ -174,7 +174,7 @@ > 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 @@ > 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); >Index: atomic/unix/ppc.c >=================================================================== >--- atomic/unix/ppc.c (revision 1068306) >+++ atomic/unix/ppc.c (working copy) >@@ -142,7 +142,7 @@ > 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 @@ > 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 >Index: atomic/unix/builtins.c >=================================================================== >--- atomic/unix/builtins.c (revision 1068306) >+++ atomic/unix/builtins.c (working copy) >@@ -66,12 +66,12 @@ > 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(); > >Index: atomic/unix/solaris.c >=================================================================== >--- atomic/unix/solaris.c (revision 1068306) >+++ atomic/unix/solaris.c (working copy) >@@ -66,12 +66,12 @@ > 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); > } >Index: atomic/netware/apr_atomic.c >=================================================================== >--- atomic/netware/apr_atomic.c (revision 1068306) >+++ atomic/netware/apr_atomic.c (working copy) >@@ -64,12 +64,12 @@ > 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); > } >Index: atomic/os390/atomic.c >=================================================================== >--- atomic/os390/atomic.c (revision 1068306) >+++ atomic/os390/atomic.c (working copy) >@@ -83,7 +83,7 @@ > } > > #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 @@ > 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 @@ > 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; > >Index: test/testatomic.c >=================================================================== >--- test/testatomic.c (revision 1068306) >+++ test/testatomic.c (working copy) >@@ -84,7 +84,7 @@ > static void test_xchgptr(abts_case *tc, void *data) > { > int a; >- volatile void *target_ptr = NULL; >+ void * volatile target_ptr = NULL; > void *old_ptr; > > old_ptr = apr_atomic_xchgptr(&target_ptr, &a); >@@ -125,7 +125,7 @@ > static void test_casptr_equal(abts_case *tc, void *data) > { > int a; >- volatile void *target_ptr = NULL; >+ void * volatile target_ptr = NULL; > void *old_ptr; > > old_ptr = apr_atomic_casptr(&target_ptr, &a, NULL); >@@ -136,7 +136,7 @@ > static void test_casptr_equal_nonnull(abts_case *tc, void *data) > { > int a, b; >- volatile void *target_ptr = &a; >+ void * volatile target_ptr = &a; > void *old_ptr; > > old_ptr = apr_atomic_casptr(&target_ptr, &b, &a); >@@ -147,7 +147,7 @@ > static void test_casptr_notequal(abts_case *tc, void *data) > { > int a, b; >- volatile void *target_ptr = &a; >+ void * volatile target_ptr = &a; > void *old_ptr; > > old_ptr = apr_atomic_casptr(&target_ptr, &a, &b); >Index: include/apr_atomic.h >=================================================================== >--- include/apr_atomic.h (revision 1068306) >+++ include/apr_atomic.h (working copy) >@@ -121,7 +121,7 @@ > * @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 @@ > * @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); > > /** @} */ >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 50731
: 26622