summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-02-02 12:47:07 +0400
committerIvan Maidanski <ivmai@mail.ru>2013-02-02 12:47:07 +0400
commitd60dd92a34c7e54db11c6d4813b634179087d397 (patch)
treeb78985b50a7a133a0a6782b4d8c0ad71faf57bf6
parent124dc9d1ce01403dd6c9fc982f20f81d3f8a0280 (diff)
downloadlibatomic_ops-d60dd92a34c7e54db11c6d4813b634179087d397.tar.gz
Adjust type of 'flag' and 'tmp' local variables in gcc/arm.h
(code refactoring) * src/atomic_ops/sysdeps/gcc/arm.h (AO_store, AO_fetch_compare_and_swap): Change type of "flag" local variable from AO_t to int (only if AO_BROKEN_TASKSWITCH_CLREX). * src/atomic_ops/sysdeps/gcc/arm.h (AO_test_and_set, AO_fetch_and_add, AO_fetch_and_add1, AO_fetch_and_sub1): Change type of "flag" local variable from unsigned long to int. * src/atomic_ops/sysdeps/gcc/arm.h (AO_fetch_and_add, AO_fetch_and_add1, AO_fetch_and_sub1): Change type of "tmp" local variable from unsigned long to AO_t.
-rw-r--r--src/atomic_ops/sysdeps/gcc/arm.h19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/atomic_ops/sysdeps/gcc/arm.h b/src/atomic_ops/sysdeps/gcc/arm.h
index 6ea3d31..59e6058 100644
--- a/src/atomic_ops/sysdeps/gcc/arm.h
+++ b/src/atomic_ops/sysdeps/gcc/arm.h
@@ -155,7 +155,7 @@
# ifdef AO_BROKEN_TASKSWITCH_CLREX
AO_INLINE void AO_store(volatile AO_t *addr, AO_t value)
{
- AO_t flag;
+ int flag;
__asm__ __volatile__("@AO_store\n"
AO_THUMB_GO_ARM
@@ -195,7 +195,7 @@
AO_test_and_set(volatile AO_TS_t *addr)
{
AO_TS_VAL_t oldval;
- unsigned long flag;
+ int flag;
__asm__ __volatile__("@AO_test_and_set\n"
AO_THUMB_GO_ARM
@@ -215,8 +215,8 @@
AO_INLINE AO_t
AO_fetch_and_add(volatile AO_t *p, AO_t incr)
{
- unsigned long flag, tmp;
- AO_t result;
+ AO_t result, tmp;
+ int flag;
__asm__ __volatile__("@AO_fetch_and_add\n"
AO_THUMB_GO_ARM
@@ -236,8 +236,8 @@ AO_fetch_and_add(volatile AO_t *p, AO_t incr)
AO_INLINE AO_t
AO_fetch_and_add1(volatile AO_t *p)
{
- unsigned long flag, tmp;
- AO_t result;
+ AO_t result, tmp;
+ int flag;
__asm__ __volatile__("@AO_fetch_and_add1\n"
AO_THUMB_GO_ARM
@@ -257,8 +257,8 @@ AO_fetch_and_add1(volatile AO_t *p)
AO_INLINE AO_t
AO_fetch_and_sub1(volatile AO_t *p)
{
- unsigned long flag, tmp;
- AO_t result;
+ AO_t result, tmp;
+ int flag;
__asm__ __volatile__("@AO_fetch_and_sub1\n"
AO_THUMB_GO_ARM
@@ -306,7 +306,8 @@ AO_fetch_and_sub1(volatile AO_t *p)
AO_INLINE AO_t
AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val)
{
- AO_t fetched_val, flag;
+ AO_t fetched_val;
+ int flag;
__asm__ __volatile__("@AO_fetch_compare_and_swap\n"
AO_THUMB_GO_ARM