]> granicus.if.org Git - libatomic_ops/commitdiff
Adjust type of 'flag' and 'tmp' local variables in gcc/arm.h
authorIvan Maidanski <ivmai@mail.ru>
Sat, 2 Feb 2013 08:47:07 +0000 (12:47 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Sat, 2 Feb 2013 08:47:07 +0000 (12:47 +0400)
(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.

src/atomic_ops/sysdeps/gcc/arm.h

index 6ea3d31de447cd44a112887a184c0a10ede34eca..59e6058e2881f06f205c08e296e13918132419c0 100644 (file)
 # 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
   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
 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