summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2022-01-12 13:03:00 +0000
committerYann Ylavic <ylavic@apache.org>2022-01-12 13:03:00 +0000
commit1363824e06d492f66560c4b7c73f8d3b0af1c2bf (patch)
tree39e4a2cf7c17fc4696ea6b5094ac39c48830328d
parent20c4846e95b340a53c1ab497e9ce2c371bd6bb5c (diff)
downloadapr-1363824e06d492f66560c4b7c73f8d3b0af1c2bf.tar.gz
Merge r1896803 from trunk:
testatomic: Fix gcc-11 warnings. Not sure why it wants the "a" local variable to point to something since we only use its pointer, but that's how it is.. While at it let's initialize "b" too. Submitted by: ylavic git-svn-id: https://svn.apache.org/repos/asf/apr/apr/branches/1.7.x@1896962 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--test/testatomic.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/test/testatomic.c b/test/testatomic.c
index d8e93437c..bf388c754 100644
--- a/test/testatomic.c
+++ b/test/testatomic.c
@@ -90,7 +90,7 @@ static void test_xchgptr(abts_case *tc, void *data)
old_ptr = apr_atomic_xchgptr(&target_ptr, &a);
ABTS_PTR_EQUAL(tc, ref, old_ptr);
- ABTS_PTR_EQUAL(tc, &a, (void *) target_ptr);
+ ABTS_PTR_EQUAL(tc, (void *)&a, (void *)target_ptr);
}
static void test_cas_equal(abts_case *tc, void *data)
@@ -125,35 +125,35 @@ static void test_cas_notequal(abts_case *tc, void *data)
static void test_casptr_equal(abts_case *tc, void *data)
{
- int a;
+ int a = 0;
volatile void *target_ptr = NULL;
void *old_ptr;
old_ptr = apr_atomic_casptr(&target_ptr, &a, NULL);
ABTS_PTR_EQUAL(tc, NULL, old_ptr);
- ABTS_PTR_EQUAL(tc, &a, (void *) target_ptr);
+ ABTS_PTR_EQUAL(tc, (void *)&a, (void *)target_ptr);
}
static void test_casptr_equal_nonnull(abts_case *tc, void *data)
{
- int a, b;
+ int a = 0, b = 0;
volatile void *target_ptr = &a;
void *old_ptr;
old_ptr = apr_atomic_casptr(&target_ptr, &b, &a);
- ABTS_PTR_EQUAL(tc, &a, old_ptr);
- ABTS_PTR_EQUAL(tc, &b, (void *) target_ptr);
+ ABTS_PTR_EQUAL(tc, (void *)&a, old_ptr);
+ ABTS_PTR_EQUAL(tc, (void *)&b, (void *)target_ptr);
}
static void test_casptr_notequal(abts_case *tc, void *data)
{
- int a, b;
+ int a = 0, b = 0;
volatile void *target_ptr = &a;
void *old_ptr;
old_ptr = apr_atomic_casptr(&target_ptr, &a, &b);
- ABTS_PTR_EQUAL(tc, &a, old_ptr);
- ABTS_PTR_EQUAL(tc, &a, (void *) target_ptr);
+ ABTS_PTR_EQUAL(tc, (void *)&a, old_ptr);
+ ABTS_PTR_EQUAL(tc, (void *)&a, (void *)target_ptr);
}
static void test_add32(abts_case *tc, void *data)