diff options
author | Craig Tiller <ctiller@google.com> | 2015-12-16 09:51:57 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-12-16 09:51:57 -0800 |
commit | 9e38c21b65736d7b484f7c7369d44b1e6f7f200d (patch) | |
tree | 5d5773afdcf21bcde2fe169e0c39121f7dc8e831 | |
parent | aff6d610c389761863f7e4d948ea7effbadb5d76 (diff) | |
parent | 1ce471a670b475d6ba0b73c16271c604752a64af (diff) |
Merge pull request #4484 from alfatraining/fix_test/gpr_stack_lockfree_test
fix gpr_stack_lockfree_test assert bug on 64 bits
-rw-r--r-- | src/core/support/stack_lockfree.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/support/stack_lockfree.c b/src/core/support/stack_lockfree.c index df9a09894c..fc934d404c 100644 --- a/src/core/support/stack_lockfree.c +++ b/src/core/support/stack_lockfree.c @@ -128,8 +128,8 @@ int gpr_stack_lockfree_push(gpr_stack_lockfree *stack, int entry) { gpr_atm old_val; old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index], - (gpr_atm)(1UL << pushed_bit)); - GPR_ASSERT((old_val & (gpr_atm)(1UL << pushed_bit)) == 0); + ((gpr_atm)1 << pushed_bit)); + GPR_ASSERT((old_val & (((gpr_atm)1) << pushed_bit)) == 0); } #endif @@ -166,8 +166,8 @@ int gpr_stack_lockfree_pop(gpr_stack_lockfree *stack) { gpr_atm old_val; old_val = gpr_atm_no_barrier_fetch_add(&stack->pushed[pushed_index], - -(gpr_atm)(1UL << pushed_bit)); - GPR_ASSERT((old_val & (gpr_atm)(1UL << pushed_bit)) != 0); + -((gpr_atm)1 << pushed_bit)); + GPR_ASSERT((old_val & (((gpr_atm)1) << pushed_bit)) != 0); } #endif |