summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2012-10-18 19:53:34 +0400
committerIvan Maidanski <ivmai@mail.ru>2012-10-18 19:53:34 +0400
commitb9aed2d60cfc5cf98a91a39c46b7c219a44dfcf1 (patch)
tree9c0dd23ad90c878e57381a9a1eb9c6004e3514c2 /tests
parent21a8083dc6e955b29e7a19b05d213bceaed5c6e9 (diff)
downloadlibatomic_ops-b9aed2d60cfc5cf98a91a39c46b7c219a44dfcf1.tar.gz
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.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_atomic.c10
1 files 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;
}