diff options
author | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-06-26 23:59:42 +0000 |
---|---|---|
committer | ylavic <ylavic@13f79535-47bb-0310-9956-ffa450edef68> | 2022-06-26 23:59:42 +0000 |
commit | 7cd5d9de6126d4c018b9d84ae60e5029ae831a49 (patch) | |
tree | 6a56c2afbc7b1826bf4125d7e2bfe2a910f67ee9 | |
parent | 3c19f4e174c887e2a3f66320d0401eea7554344c (diff) | |
download | libapr-7cd5d9de6126d4c018b9d84ae60e5029ae831a49.tar.gz |
atomics: 1.8+ only: Provide apr_atomic_casptr2() and apr_atomic_xchgptr2().
The API of atomic_{cas,xchg}ptr() is broken, using "volatile void **" instead
of "void *volatile *" to qualify the exchanged pointer address. This does not
prevent the compiler from caching *mem into a local variable, which would break
atomicity.
Since the API of existing functions cannot change in 1.x, provide two new
apr_atomic_casptr2() and apr_atomic_xchgptr2() with the right API. Add a dox
@warning to notify users to switch to using the new functions.
The implementation is not duplicated by using common (APR_INLINE) helpers.
Relates to: r1763666 in trunk.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.8.x@1902268 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | atomic/netware/apr_atomic.c | 10 | ||||
-rw-r--r-- | atomic/os390/atomic.c | 39 | ||||
-rw-r--r-- | atomic/unix/builtins.c | 26 | ||||
-rw-r--r-- | atomic/unix/ia32.c | 26 | ||||
-rw-r--r-- | atomic/unix/mutex.c | 30 | ||||
-rw-r--r-- | atomic/unix/ppc.c | 26 | ||||
-rw-r--r-- | atomic/unix/s390.c | 28 | ||||
-rw-r--r-- | atomic/unix/solaris.c | 10 | ||||
-rw-r--r-- | atomic/win32/apr_atomic.c | 26 | ||||
-rw-r--r-- | include/apr_atomic.h | 24 | ||||
-rw-r--r-- | test/testatomic.c | 44 |
11 files changed, 248 insertions, 41 deletions
diff --git a/atomic/netware/apr_atomic.c b/atomic/netware/apr_atomic.c index 9c3df8039..416e071ab 100644 --- a/atomic/netware/apr_atomic.c +++ b/atomic/netware/apr_atomic.c @@ -72,7 +72,17 @@ APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const voi return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); } +APR_DECLARE(void *) apr_atomic_casptr2(void *volatile *mem, void *with, const void *cmp) +{ + return (void*)atomic_cmpxchg((unsigned long *)mem,(unsigned long)cmp,(unsigned long)with); +} + APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) { return (void*)atomic_xchg((unsigned long *)mem,(unsigned long)with); } + +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem, void *with) +{ + return (void*)atomic_xchg((unsigned long *)mem,(unsigned long)with); +} diff --git a/atomic/os390/atomic.c b/atomic/os390/atomic.c index e6a1693c4..68b58b6ad 100644 --- a/atomic/os390/atomic.c +++ b/atomic/os390/atomic.c @@ -85,9 +85,8 @@ apr_uint32_t apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint32_t swap, } #if APR_SIZEOF_VOIDP == 4 -void *apr_atomic_casptr(volatile void **mem_ptr, - void *swap_ptr, - const void *cmp_ptr) +static APR_INLINE +void *do_casptr(void *volatile *mem_ptr, void *swap_ptr, const void *cmp_ptr) { __cs1(&cmp_ptr, /* automatically updated from mem on __cs1 failure */ mem_ptr, /* set from swap when __cs1 succeeds */ @@ -95,9 +94,8 @@ void *apr_atomic_casptr(volatile void **mem_ptr, return (void *)cmp_ptr; } #elif APR_SIZEOF_VOIDP == 8 -void *apr_atomic_casptr(volatile void **mem_ptr, - void *swap_ptr, - const void *cmp_ptr) +static APR_INLINE +void *do_casptr(void *volatile *mem_ptr, void *swap_ptr, const void *cmp_ptr) { __csg(&cmp_ptr, /* automatically updated from mem on __csg failure */ mem_ptr, /* set from swap when __csg succeeds */ @@ -108,6 +106,20 @@ void *apr_atomic_casptr(volatile void **mem_ptr, #error APR_SIZEOF_VOIDP value not supported #endif /* APR_SIZEOF_VOIDP */ +void *apr_atomic_casptr(volatile void **mem_ptr, + void *swap_ptr, + const void *cmp_ptr) +{ + return do_casptr((void *)mem_ptr, swap_ptr, cmp_ptr); +} + +void *apr_atomic_casptr2(void *volatile *mem_ptr, + void *swap_ptr, + const void *cmp_ptr) +{ + return do_casptr(mem_ptr, swap_ptr, cmp_ptr); +} + apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) { apr_uint32_t old, new_val; @@ -120,11 +132,12 @@ apr_uint32_t apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) return old; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem_ptr, void *new_ptr) +static APR_INLINE +void *do_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)); @@ -137,3 +150,13 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem_ptr, void *new_ptr) return old_ptr; } + +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem_ptr, void *new_ptr) +{ + return do_xchgptr((void *)mem_ptr, new_ptr); +} + +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem_ptr, void *new_ptr) +{ + return do_xchgptr(mem_ptr, new_ptr); +} diff --git a/atomic/unix/builtins.c b/atomic/unix/builtins.c index 6aaae1ba2..b92e435cf 100644 --- a/atomic/unix/builtins.c +++ b/atomic/unix/builtins.c @@ -111,7 +111,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint #endif } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *ptr, const void *cmp) +static APR_INLINE +void *do_casptr(void *volatile *mem, void *ptr, const void *cmp) { #if HAVE__ATOMIC_BUILTINS __atomic_compare_exchange_n(mem, (void *)&cmp, ptr, 0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST); @@ -121,7 +122,18 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *ptr, const void #endif } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *ptr) +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *ptr, const void *cmp) +{ + return do_casptr((void *)mem, ptr, cmp); +} + +APR_DECLARE(void*) apr_atomic_casptr2(void *volatile *mem, void *ptr, const void *cmp) +{ + return do_casptr(mem, ptr, cmp); +} + +static APR_INLINE +void *do_xchgptr(void *volatile *mem, void *ptr) { #if HAVE__ATOMIC_BUILTINS return (void *)__atomic_exchange_n(mem, ptr, __ATOMIC_SEQ_CST); @@ -131,4 +143,14 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *ptr) #endif } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *ptr) +{ + return do_xchgptr((void *)mem, ptr); +} + +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem, void *ptr) +{ + return do_xchgptr(mem, ptr); +} + #endif /* USE_ATOMICS_BUILTINS */ diff --git a/atomic/unix/ia32.c b/atomic/unix/ia32.c index cdb7a5289..fb43cde88 100644 --- a/atomic/unix/ia32.c +++ b/atomic/unix/ia32.c @@ -93,7 +93,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return prev; } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +static APR_INLINE +void *do_casptr(void *volatile *mem, void *with, const void *cmp) { void *prev; #if APR_SIZEOF_VOIDP == 4 @@ -111,7 +112,18 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return do_casptr((void *)mem, with, cmp) +} + +APR_DECLARE(void*) apr_atomic_casptr2(void *volatile *mem, void *with, const void *cmp) +{ + return do_casptr(mem, with, cmp) +} + +static APR_INLINE +void *do_xchgptr(void *volatile *mem, void *with) { void *prev; #if APR_SIZEOF_VOIDP == 4 @@ -128,4 +140,14 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) return prev; } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + return do_xchgptr((void *)mem, with); +} + +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem, void *with) +{ + return do_xchgptr(mem, with); +} + #endif /* USE_ATOMICS_IA32 */ diff --git a/atomic/unix/mutex.c b/atomic/unix/mutex.c index 45bc5e2d9..f53199c76 100644 --- a/atomic/unix/mutex.c +++ b/atomic/unix/mutex.c @@ -175,12 +175,13 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return prev; } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +static APR_INLINE +void *do_casptr(void *volatile *mem, void *with, const void *cmp) { void *prev; DECLARE_MUTEX_LOCKED(mutex, *mem); - prev = *(void **)mem; + prev = *mem; if (prev == cmp) { *mem = with; } @@ -190,12 +191,23 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return do_casptr((void *)mem, with, cmp); +} + +APR_DECLARE(void*) apr_atomic_casptr2(void *volatile *mem, void *with, const void *cmp) +{ + return do_casptr(mem, with, cmp); +} + +static APR_INLINE +void *do_xchgptr(void *volatile *mem, void *with) { void *prev; DECLARE_MUTEX_LOCKED(mutex, *mem); - prev = *(void **)mem; + prev = *mem; *mem = with; MUTEX_UNLOCK(mutex); @@ -203,4 +215,14 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) return prev; } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + return do_xchgptr((void *)mem, with); +} + +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem, void *with) +{ + return do_xchgptr(mem, with); +} + #endif /* USE_ATOMICS_GENERIC */ diff --git a/atomic/unix/ppc.c b/atomic/unix/ppc.c index 46554af54..0ffcc4923 100644 --- a/atomic/unix/ppc.c +++ b/atomic/unix/ppc.c @@ -171,7 +171,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return prev; } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +static APR_INLINE +void *do_casptr(void *volatile *mem, void *with, const void *cmp) { void *prev; #if APR_SIZEOF_VOIDP == 4 @@ -208,7 +209,18 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return do_casptr((void *)mem, with, cmp); +} + +APR_DECLARE(void*) apr_atomic_casptr2(void *volatile *mem, void *with, const void *cmp) +{ + return do_casptr(mem, with, cmp); +} + +static APR_INLINE +void *do_xchgptr(void *volatile *mem, void *with) { void *prev; #if APR_SIZEOF_VOIDP == 4 @@ -239,4 +251,14 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) return prev; } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + return do_xchgptr((void *)mem, with); +} + +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem, void *with) +{ + return do_xchgptr(mem, with); +} + #endif /* USE_ATOMICS_PPC */ diff --git a/atomic/unix/s390.c b/atomic/unix/s390.c index ae5d04082..1cdfde36d 100644 --- a/atomic/unix/s390.c +++ b/atomic/unix/s390.c @@ -114,7 +114,8 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint return prev; } -APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +static APR_INLINE +void *do_casptr(void *volatile *mem, void *with, const void *cmp) { void *prev = (void *) cmp; #if APR_SIZEOF_VOIDP == 4 @@ -133,9 +134,20 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return prev; } -APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return do_casptr((void *)mem, with, cmp); +} + +APR_DECLARE(void*) apr_atomic_casptr2(void *volatile *mem, void *with, const void *cmp) +{ + return do_casptr(mem, with, cmp); +} + +static APR_INLINE +void *do_xchgptr(void *volatile *mem, void *with) { - void *prev = (void *) *mem; + void *prev = *mem; #if APR_SIZEOF_VOIDP == 4 asm volatile ("loop_%=:\n" " cs %0,%2,%1\n" @@ -156,4 +168,14 @@ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) return prev; } +APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) +{ + return do_xchgptr((void *)mem, with); +} + +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem, void *with) +{ + return do_xchgptr(mem, with); +} + #endif /* USE_ATOMICS_S390 */ diff --git a/atomic/unix/solaris.c b/atomic/unix/solaris.c index 9bc2de29a..eeef729fe 100644 --- a/atomic/unix/solaris.c +++ b/atomic/unix/solaris.c @@ -75,9 +75,19 @@ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void return atomic_cas_ptr(mem, (void*) cmp, with); } +APR_DECLARE(void*) apr_atomic_casptr2(void *volatile *mem, void *with, const void *cmp) +{ + return atomic_cas_ptr(mem, (void*) cmp, with); +} + APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) { return atomic_swap_ptr(mem, with); } +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem, void *with) +{ + return atomic_swap_ptr(mem, with); +} + #endif /* USE_ATOMICS_SOLARIS */ diff --git a/atomic/win32/apr_atomic.c b/atomic/win32/apr_atomic.c index b29ea5956..38e8aeab8 100644 --- a/atomic/win32/apr_atomic.c +++ b/atomic/win32/apr_atomic.c @@ -91,15 +91,6 @@ APR_DECLARE(apr_uint32_t) apr_atomic_cas32(volatile apr_uint32_t *mem, apr_uint3 #endif } -APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) -{ -#if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) - return InterlockedCompareExchangePointer((void* volatile*)mem, with, (void*)cmp); -#else - return InterlockedCompareExchangePointer((void**)mem, with, (void*)cmp); -#endif -} - APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint32_t val) { #if (defined(_M_IA64) || defined(_M_AMD64)) && !defined(RC_INVOKED) @@ -109,7 +100,22 @@ APR_DECLARE(apr_uint32_t) apr_atomic_xchg32(volatile apr_uint32_t *mem, apr_uint #endif } +APR_DECLARE(void *) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp) +{ + return InterlockedCompareExchangePointer((void *)mem, with, (void *)cmp); +} + +APR_DECLARE(void *) apr_atomic_casptr2(void *volatile *mem, void *with, const void *cmp) +{ + return InterlockedCompareExchangePointer(mem, with, (void *)cmp); +} + APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with) { - return InterlockedExchangePointer((void**)mem, with); + return InterlockedExchangePointer((void *)mem, with); +} + +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem, void *with) +{ + return InterlockedExchangePointer(mem, with); } diff --git a/include/apr_atomic.h b/include/apr_atomic.h index 3d203edc3..27ab22e68 100644 --- a/include/apr_atomic.h +++ b/include/apr_atomic.h @@ -187,17 +187,41 @@ APR_DECLARE(apr_uint64_t) apr_atomic_xchg64(volatile apr_uint64_t *mem, apr_uint * @param with what to swap it with * @param cmp the value to compare it to * @return the old value of the pointer + * @warning The API of this function is not correct, it does not prevent the + * compiler from caching the pointer in *mem, possibly breaking the + * atomic garantees. Use apr_atomic_casptr2() instead. */ APR_DECLARE(void*) apr_atomic_casptr(volatile void **mem, void *with, const void *cmp); /** + * compare the pointer's value with cmp. + * If they are the same swap the value with 'with' + * @param mem pointer to the pointer + * @param with what to swap it with + * @param cmp the value to compare it to + * @return the old value of the pointer + */ +APR_DECLARE(void*) apr_atomic_casptr2(void *volatile *mem, void *with, const void *cmp); + +/** * exchange a pair of pointer values * @param mem pointer to the pointer * @param with what to swap it with * @return the old value of the pointer + * @warning The API of this function is not correct, it does not prevent the + * compiler from caching the pointer in *mem, possibly breaking the + * atomic garantees. Use apr_atomic_xchgptr2() instead. */ APR_DECLARE(void*) apr_atomic_xchgptr(volatile void **mem, void *with); +/** + * exchange a pair of pointer values + * @param mem pointer to the pointer + * @param with what to swap it with + * @return the old value of the pointer + */ +APR_DECLARE(void*) apr_atomic_xchgptr2(void *volatile *mem, void *with); + /** @} */ #ifdef __cplusplus diff --git a/test/testatomic.c b/test/testatomic.c index 4b18bb61e..6488f45f5 100644 --- a/test/testatomic.c +++ b/test/testatomic.c @@ -85,10 +85,15 @@ static void test_xchgptr(abts_case *tc, void *data) { int a; void *ref = "little piggy"; - volatile void *target_ptr = ref; + void *target_ptr = ref; void *old_ptr; - old_ptr = apr_atomic_xchgptr(&target_ptr, &a); + if (data) { + old_ptr = apr_atomic_xchgptr2(&target_ptr, &a); + } + else { + old_ptr = apr_atomic_xchgptr((void *)&target_ptr, &a); + } ABTS_PTR_EQUAL(tc, ref, old_ptr); ABTS_PTR_EQUAL(tc, (void *)&a, (void *)target_ptr); } @@ -126,10 +131,15 @@ static void test_cas_notequal(abts_case *tc, void *data) static void test_casptr_equal(abts_case *tc, void *data) { int a = 0; - volatile void *target_ptr = NULL; + void *target_ptr = NULL; void *old_ptr; - old_ptr = apr_atomic_casptr(&target_ptr, &a, NULL); + if (data) { + old_ptr = apr_atomic_casptr2(&target_ptr, &a, NULL); + } + else { + old_ptr = apr_atomic_casptr((void *)&target_ptr, &a, NULL); + } ABTS_PTR_EQUAL(tc, NULL, old_ptr); ABTS_PTR_EQUAL(tc, (void *)&a, (void *)target_ptr); } @@ -137,23 +147,33 @@ static void test_casptr_equal(abts_case *tc, void *data) static void test_casptr_equal_nonnull(abts_case *tc, void *data) { int a = 0, b = 0; - volatile void *target_ptr = &a; + void *target_ptr = &a; void *old_ptr; - old_ptr = apr_atomic_casptr(&target_ptr, &b, &a); + if (data) { + old_ptr = apr_atomic_casptr2(&target_ptr, &b, &a); + } + else { + old_ptr = apr_atomic_casptr((void *)&target_ptr, &b, &a); + } ABTS_PTR_EQUAL(tc, (void *)&a, old_ptr); - ABTS_PTR_EQUAL(tc, (void *)&b, (void *)target_ptr); + ABTS_PTR_EQUAL(tc, (void *)&b, target_ptr); } static void test_casptr_notequal(abts_case *tc, void *data) { int a = 0, b = 0; - volatile void *target_ptr = &a; + void *target_ptr = &a; void *old_ptr; - old_ptr = apr_atomic_casptr(&target_ptr, &a, &b); + if (data) { + old_ptr = apr_atomic_casptr2(&target_ptr, &a, &b); + } + else { + old_ptr = apr_atomic_casptr((void *)&target_ptr, &a, &b); + } ABTS_PTR_EQUAL(tc, (void *)&a, old_ptr); - ABTS_PTR_EQUAL(tc, (void *)&a, (void *)target_ptr); + ABTS_PTR_EQUAL(tc, (void *)&a, target_ptr); } static void test_add32(abts_case *tc, void *data) @@ -925,12 +945,16 @@ abts_suite *testatomic(abts_suite *suite) abts_run_test(suite, test_dec32, NULL); abts_run_test(suite, test_xchg32, NULL); abts_run_test(suite, test_xchgptr, NULL); + abts_run_test(suite, test_xchgptr, (void *)(apr_uintptr_t)2); abts_run_test(suite, test_cas_equal, NULL); abts_run_test(suite, test_cas_equal_nonnull, NULL); abts_run_test(suite, test_cas_notequal, NULL); abts_run_test(suite, test_casptr_equal, NULL); + abts_run_test(suite, test_casptr_equal, (void *)(apr_uintptr_t)2); abts_run_test(suite, test_casptr_equal_nonnull, NULL); + abts_run_test(suite, test_casptr_equal_nonnull, (void *)(apr_uintptr_t)2); abts_run_test(suite, test_casptr_notequal, NULL); + abts_run_test(suite, test_casptr_notequal, (void *)(apr_uintptr_t)2); abts_run_test(suite, test_add32, NULL); abts_run_test(suite, test_add32_neg, NULL); abts_run_test(suite, test_inc32, NULL); |