diff options
author | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2002-04-18 17:15:27 +0000 |
---|---|---|
committer | jerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68> | 2002-04-18 17:15:27 +0000 |
commit | ef324239e3d46abea179cedf5e658e651b13c22c (patch) | |
tree | 058f0431b8a9125f8d200d6346933c1343941216 | |
parent | 77bc9bf5163a984d093d5c14abf0914c023e9b84 (diff) | |
download | libapr-ef324239e3d46abea179cedf5e658e651b13c22c.tar.gz |
Ensure that the ATOMIC_HASH can not be negative.
Submitted by: Joe Orton <jorton@redhat.com>
Reviewed by: Justin Erenkrantz
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63277 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | CHANGES | 3 | ||||
-rw-r--r-- | atomic/unix/apr_atomic.c | 3 |
2 files changed, 4 insertions, 2 deletions
@@ -1,5 +1,8 @@ Changes with APR b1 + *) Ensure that the ATOMIC_HASH can not be negative. + [Joe Orton <jorton@redhat.com>] + *) Fix a problem with eof reporting with Unix file I/O on unbuffered files. [Stas Bekman <stas@stason.org>] diff --git a/atomic/unix/apr_atomic.c b/atomic/unix/apr_atomic.c index 5dba3c4b3..ca547808f 100644 --- a/atomic/unix/apr_atomic.c +++ b/atomic/unix/apr_atomic.c @@ -63,7 +63,7 @@ #define NUM_ATOMIC_HASH 7 /* shift by 2 to get rid of alignment issues */ -#define ATOMIC_HASH(x) (int)(((long)x>>2)%NUM_ATOMIC_HASH) +#define ATOMIC_HASH(x) (unsigned int)(((unsigned long)(x))%(unsigned int)NUM_ATOMIC_HASH) static apr_thread_mutex_t **hash_mutex; apr_status_t apr_atomic_init(apr_pool_t *p ) @@ -92,7 +92,6 @@ void apr_atomic_add(volatile apr_atomic_t *mem, apr_uint32_t val) apr_thread_mutex_unlock(lock); /* return prev; */ } - printf("debug no workee\n"); /* return *mem; */ } void apr_atomic_set(volatile apr_atomic_t *mem, apr_uint32_t val) |