summaryrefslogtreecommitdiff
path: root/atomic
diff options
context:
space:
mode:
authorjerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68>2002-04-18 17:15:27 +0000
committerjerenkrantz <jerenkrantz@13f79535-47bb-0310-9956-ffa450edef68>2002-04-18 17:15:27 +0000
commitef324239e3d46abea179cedf5e658e651b13c22c (patch)
tree058f0431b8a9125f8d200d6346933c1343941216 /atomic
parent77bc9bf5163a984d093d5c14abf0914c023e9b84 (diff)
downloadlibapr-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
Diffstat (limited to 'atomic')
-rw-r--r--atomic/unix/apr_atomic.c3
1 files changed, 1 insertions, 2 deletions
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)