diff options
Diffstat (limited to 'atomic/unix/apr_atomic.c')
-rw-r--r-- | atomic/unix/apr_atomic.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 87758523d..d7a223a06 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -123,23 +123,23 @@ int apr_atomic_dec(volatile apr_atomic_t *mem) #if !defined(apr_atomic_cas) && !defined(APR_OVERRIDE_ATOMIC_CAS) apr_uint32_t apr_atomic_cas(volatile apr_uint32_t *mem, long with, long cmp) { - long prev; + apr_uint32_t prev; #if APR_HAS_THREADS apr_thread_mutex_t *lock = hash_mutex[ATOMIC_HASH(mem)]; if (apr_thread_mutex_lock(lock) == APR_SUCCESS) { - prev = *(long*)mem; - if (prev == cmp) { - *(long*)mem = with; + prev = *mem; + if (prev == (apr_uint32_t)cmp) { + *mem = (apr_uint32_t)with; } apr_thread_mutex_unlock(lock); return prev; } - return *(long*)mem; + return *mem; #else - prev = *(long*)mem; - if (prev == cmp) { - *(long*)mem = with; + prev = *mem; + if (prev == (apr_uint32_t)cmp) { + *mem = (apr_uint32_t)with; } return prev; #endif /* APR_HAS_THREADS */ |