From: ivmai Date: Wed, 3 Feb 2010 07:03:59 +0000 (+0000) Subject: 2010-02-03 Ivan Maidanski X-Git-Tag: libatomic_ops-7_2alpha5-20100601~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=421728d72ab80f82fc1d835129d17e2abe609d39;p=libatomic_ops 2010-02-03 Ivan Maidanski * src/atomic_ops_stack.c (AO_stack_push_explicit_aux_release): Define "i" variable only if used (to suppress a compiler warning). --- diff --git a/ChangeLog b/ChangeLog index afa0ef3..63d6161 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-02-03 Ivan Maidanski + + * src/atomic_ops_stack.c (AO_stack_push_explicit_aux_release): + Define "i" variable only if used (to suppress a compiler warning). + 2010-02-02 Ivan Maidanski * src/atomic_ops/sysdeps/sunc/x86.h (AO_test_and_set_full): Fix diff --git a/src/atomic_ops_stack.c b/src/atomic_ops_stack.c index 6de7a57..2f03145 100644 --- a/src/atomic_ops_stack.c +++ b/src/atomic_ops_stack.c @@ -92,7 +92,6 @@ void AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x, AO_stack_aux *a) { - int i; AO_t x_bits = (AO_t)x; AO_t next; @@ -106,7 +105,7 @@ AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x, AO_t entry2 = AO_load(a -> AO_stack_bl + 1); if (entry1 == x_bits || entry2 == x_bits) { - /* Entry is currently being removed. Change it a little. */ + /* Entry is currently being removed. Change it a little. */ ++x_bits; if ((x_bits & AO_BIT_MASK) == 0) /* Version count overflowed; */ @@ -116,11 +115,13 @@ AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x, } } # else + { + int i; for (i = 0; i < AO_BL_SIZE; ++i) { if (AO_load(a -> AO_stack_bl + i) == x_bits) { - /* Entry is currently being removed. Change it a little. */ + /* Entry is currently being removed. Change it a little. */ ++x_bits; if ((x_bits & AO_BIT_MASK) == 0) /* Version count overflowed; */ @@ -129,6 +130,7 @@ AO_stack_push_explicit_aux_release(volatile AO_t *list, AO_t *x, goto retry; } } + } # endif /* x_bits is not currently being deleted */ do