projects
/
platform
/
upstream
/
libatomic_ops.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
21a8083
)
Specify AO_fetch_and_add/sub1 result is unused in test_atomic
author
Ivan Maidanski
<ivmai@mail.ru>
Thu, 18 Oct 2012 15:53:34 +0000
(19:53 +0400)
committer
Ivan Maidanski
<ivmai@mail.ru>
Thu, 18 Oct 2012 15:53:34 +0000
(19:53 +0400)
* 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
patch
|
blob
|
history
diff --git
a/tests/test_atomic.c
b/tests/test_atomic.c
index
30dbc05
..
6ce690a
100644
(file)
--- 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;
}