From b9aed2d60cfc5cf98a91a39c46b7c219a44dfcf1 Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Thu, 18 Oct 2012 19:53:34 +0400 Subject: [PATCH] Specify AO_fetch_and_add/sub1 result is unused in test_atomic * tests/test_atomic.c (add1sub1_thr): Explicitly cast result of AO_fetch_and_sub1 and AO_fetch_and_add1 to void (to outline that the result is unused intentionally); reformat code. --- tests/test_atomic.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/test_atomic.c b/tests/test_atomic.c index 30dbc05..6ce690a 100644 --- a/tests/test_atomic.c +++ b/tests/test_atomic.c @@ -44,11 +44,11 @@ void * add1sub1_thr(void * id) int i; for (i = 0; i < NITERS; ++i) - if (me & 1) - AO_fetch_and_sub1(&counter); - else - AO_fetch_and_add1(&counter); - + if ((me & 1) != 0) { + (void)AO_fetch_and_sub1(&counter); + } else { + (void)AO_fetch_and_add1(&counter); + } return 0; } -- 2.40.0