diff options
author | Yann Ylavic <ylavic@apache.org> | 2022-06-26 11:47:11 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2022-06-26 11:47:11 +0000 |
commit | 51c205578e2a10d1f28417179ac3ec2a3994ecfb (patch) | |
tree | 051a907c24123f743c9600f2c869a13f959cf78f /atomic/os390 | |
parent | 289e1190dc612308e7497eb1f76b4863b34908a6 (diff) | |
download | apr-51c205578e2a10d1f28417179ac3ec2a3994ecfb.tar.gz |
atomic: Avoid casts and/or use correct ones.
* atomic/os390/atomic.c(apr_atomic_xchgptr):
Dereferencing without casting is fine/better.
* atomic/unix/mutex.c(apr_atomic_casptr, apr_atomic_xchgptr):
Dereferencing without casting is fine/better.
* atomic/win32/apr_atomic.c(apr_atomic_add32, apr_atomic_sub32,
apr_atomic_inc32, apr_atomic_dev32,
apr_atomic_set32, apr_atomic_cas32,
apr_atomic_xchg32):
Native Interlocked 32bit functions expect "long volatile *",
don't cast out volatility.
* atomic/win32/apr_atomic.c(apr_atomic_casptr):
32bit InterlockedCompareExchangePointer() expects "long volatile *",
don't cast to (void **).
* atomic/win32/apr_atomic.c(apr_atomic_xchgptr):
InterlockedExchangePointer() for both 32bit and 64bit expects
"void *volatile *", no need to cast.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1902257 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'atomic/os390')
-rw-r--r-- | atomic/os390/atomic.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index 249ee15c2..9442f27ea 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -124,7 +124,7 @@ APR_DECLARE(void*) apr_atomic_xchgptr(void *volatile *mem_ptr, void *new_ptr) { void *old_ptr; - old_ptr = *(void **)mem_ptr; /* old is automatically updated on cs failure */ + old_ptr = *mem_ptr; /* old is automatically updated on cs failure */ #if APR_SIZEOF_VOIDP == 4 do { } while (__cs1(&old_ptr, mem_ptr, &new_ptr)); |