aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/tile
diff options
context:
space:
mode:
authorChris Metcalf <cmetcalf@ezchip.com>2015-08-04 12:02:10 -0400
committerChris Metcalf <cmetcalf@ezchip.com>2015-08-04 12:07:53 -0400
commit0d261f406d7c8f70b4ad7ca7d9247da1db3dfb41 (patch)
tree690d97fa7ac0fb9a31b97085ae77c7063507db97 /sysdeps/tile
parentbbab82c25da9b504c0804119840de7aeab0eeeba (diff)
downloadglibc-0d261f406d7c8f70b4ad7ca7d9247da1db3dfb41.tar
glibc-0d261f406d7c8f70b4ad7ca7d9247da1db3dfb41.tar.gz
glibc-0d261f406d7c8f70b4ad7ca7d9247da1db3dfb41.tar.bz2
glibc-0d261f406d7c8f70b4ad7ca7d9247da1db3dfb41.zip
tilepro: fix warnings in sysdeps/tile/tilepro/bits/atomic.h
Using a ({ }) structure avoids the "value computed is not used" that a simple () structure causes.
Diffstat (limited to 'sysdeps/tile')
-rw-r--r--sysdeps/tile/tilepro/bits/atomic.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/sysdeps/tile/tilepro/bits/atomic.h b/sysdeps/tile/tilepro/bits/atomic.h
index 491e586cee..e0ef9fb5e7 100644
--- a/sysdeps/tile/tilepro/bits/atomic.h
+++ b/sysdeps/tile/tilepro/bits/atomic.h
@@ -39,10 +39,12 @@ int __atomic_cmpxchg_32 (volatile int *mem, int newval, int oldval)
}
#define atomic_compare_and_exchange_val_acq(mem, n, o) \
- ((__typeof (*(mem))) \
- ((sizeof (*(mem)) == 4) ? \
- __atomic_cmpxchg_32 ((int *) (mem), (int) (n), (int) (o)) : \
- __atomic_error_bad_argument_size()))
+ ({ \
+ if (sizeof (*(mem)) != 4) \
+ __atomic_error_bad_argument_size (); \
+ (__typeof (*(mem))) \
+ __atomic_cmpxchg_32 ((int *) (mem), (int) (n), (int) (o)); \
+ })
/* Atomically compute:
int old = *ptr;
@@ -64,10 +66,12 @@ int __atomic_update_32 (volatile int *mem, int mask, int addend)
/* Size-checked verson of __atomic_update_32. */
#define __atomic_update(mem, mask, addend) \
- ((__typeof (*(mem))) \
- ((sizeof (*(mem)) == 4) ? \
- __atomic_update_32 ((int *) (mem), (int) (mask), (int) (addend)) : \
- __atomic_error_bad_argument_size ()))
+ ({ \
+ if (sizeof (*(mem)) != 4) \
+ __atomic_error_bad_argument_size (); \
+ (__typeof (*(mem))) \
+ __atomic_update_32 ((int *) (mem), (int) (mask), (int) (addend)); \
+ })
#define atomic_exchange_acq(mem, newvalue) \
__atomic_update ((mem), 0, (newvalue))