trawick 2003/11/04 19:40:54
Modified: atomic/os390 Tag: APR_0_9_BRANCH atomic.c
Log:
fix type mismatch with picky compiler settings on z/OS
(volatile vs. non-volatile)
Revision Changes Path
No revision
No revision
1.3.2.1 +4 -4 apr/atomic/os390/atomic.c
Index: atomic.c
===================================================================
RCS file: /home/cvs/apr/atomic/os390/atomic.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -u -r1.3 -r1.3.2.1
--- atomic.c 1 Jan 2003 00:01:41 -0000 1.3
+++ atomic.c 5 Nov 2003 03:40:54 -0000 1.3.2.1
@@ -58,24 +58,24 @@
#if APR_HAS_THREADS
-apr_int32_t apr_atomic_add(apr_atomic_t *mem, apr_int32_t val)
+apr_int32_t apr_atomic_add(volatile apr_atomic_t *mem, apr_int32_t val)
{
apr_atomic_t old, new_val;
old = *mem; /* old is automatically updated on cs failure */
do {
new_val = old + val;
- } while (__cs(&old, mem, new_val));
+ } while (__cs(&old, (cs_t *)mem, new_val));
return new_val;
}
-apr_uint32_t apr_atomic_cas(apr_atomic_t *mem, apr_uint32_t swap,
+apr_uint32_t apr_atomic_cas(volatile apr_atomic_t *mem, apr_uint32_t swap,
apr_uint32_t cmp)
{
apr_uint32_t old = cmp;
- __cs(&old, mem, swap);
+ __cs(&old, (cs_t *)mem, swap);
return old; /* old is automatically updated from mem on cs failure */
}