diff options
author | Ivan Maidanski <ivmai@mail.ru> | 2016-10-11 10:01:35 +0300 |
---|---|---|
committer | Ivan Maidanski <ivmai@mail.ru> | 2016-10-11 10:01:35 +0300 |
commit | 2430131b2515f4e24f81368a573a3b8966849b53 (patch) | |
tree | 4a5e3fcd5f2459d18be2c4f0cf65a38dc5b2b77b | |
parent | 9b7cecba55f5864577a803f4558bd9b9f304ac33 (diff) | |
download | libatomic_ops-2430131b2515f4e24f81368a573a3b8966849b53.tar.gz |
Eliminate 'scope of variable can be reduced' cppcheck warning in AO_stack
* src/atomic_ops_stack.c [AO_HAVE_compare_and_swap_double]
(AO_stack_push_release): Move local variable declaration to the inner
scope where the variable is actually used.
-rw-r--r-- | src/atomic_ops_stack.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/atomic_ops_stack.c b/src/atomic_ops_stack.c index ad12f06..6bd7cf0 100644 --- a/src/atomic_ops_stack.c +++ b/src/atomic_ops_stack.c @@ -250,9 +250,10 @@ AO_t *AO_stack_pop_acquire(AO_stack_t *list) void AO_stack_push_release(AO_stack_t *list, AO_t *element) { AO_t version; - AO_t next_ptr; do { + AO_t next_ptr; + /* Again version must be loaded first, for different reason. */ version = AO_load_acquire(&(list -> version)); next_ptr = AO_load(&(list -> ptr)); |