]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
alpha: Fix the return type of the atomic.h macros.
authorRichard Henderson <rth@twiddle.net>
Fri, 26 Mar 2010 17:25:53 +0000 (10:25 -0700)
committerRichard Henderson <rth@twiddle.net>
Fri, 26 Mar 2010 20:17:51 +0000 (13:17 -0700)
Signed-off-by: Richard Henderson <rth@twiddle.net>
ChangeLog.alpha
sysdeps/alpha/bits/atomic.h

index 4cf27f4204eb21bf8be7f2256f9af5c7363d85d8..4e2eb5b844ca590f8e58db35da3bd2b424ae7350 100644 (file)
@@ -1,3 +1,11 @@
+2010-03-26  Richard Henderson  <rth@redhat.com>
+
+       * sysdeps/alpha/bits/atomic.h (__arch_exchange_8_int,
+       __arch_exchange_16_int, __arch_exchange_32_int,
+       __arch_exchange_64_int, __arch_exchange_and_add_32_int,
+       __arch_exchange_and_add_64_int): Use __typeof to get the
+       return type correct without warning.
+
 2010-03-23  Matt Turner  <mattst88@gmail.com>
             Aurelien Jarno  <aurelien@aurel32.net>
 
index 36a740c758fae38c223e16491a87e9ab91e9bb89..602fde3ff9a5d4f95b14a7e72ae7194483f6cdf0 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 2003 Free Software Foundation, Inc.
+/* Copyright (C) 2003, 2010 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -221,7 +221,7 @@ typedef uintmax_t uatomic_max_t;
 
 #define __arch_exchange_8_int(mem, value, mb1, mb2)                    \
 ({                                                                     \
-  unsigned long __ret, __tmp, __addr64, __sval;                                \
+  unsigned long __tmp, __addr64, __sval; __typeof(*mem) __ret;         \
   __asm__ __volatile__ (                                               \
                mb1                                                     \
        "       andnot  %[__addr8],7,%[__addr64]\n"                     \
@@ -244,7 +244,7 @@ typedef uintmax_t uatomic_max_t;
 
 #define __arch_exchange_16_int(mem, value, mb1, mb2)                   \
 ({                                                                     \
-  unsigned long __ret, __tmp, __addr64, __sval;                                \
+  unsigned long __tmp, __addr64, __sval; __typeof(*mem) __ret;         \
   __asm__ __volatile__ (                                               \
                mb1                                                     \
        "       andnot  %[__addr16],7,%[__addr64]\n"                    \
@@ -267,7 +267,7 @@ typedef uintmax_t uatomic_max_t;
 
 #define __arch_exchange_32_int(mem, value, mb1, mb2)                   \
 ({                                                                     \
-  signed int __ret, __tmp;                                             \
+  signed int __tmp; __typeof(*mem) __ret;                              \
   __asm__ __volatile__ (                                               \
                mb1                                                     \
        "1:     ldl_l   %[__ret],%[__mem]\n"                            \
@@ -284,7 +284,7 @@ typedef uintmax_t uatomic_max_t;
 
 #define __arch_exchange_64_int(mem, value, mb1, mb2)                   \
 ({                                                                     \
-  unsigned long __ret, __tmp;                                          \
+  unsigned long __tmp; __typeof(*mem) __ret;                           \
   __asm__ __volatile__ (                                               \
                mb1                                                     \
        "1:     ldq_l   %[__ret],%[__mem]\n"                            \
@@ -316,7 +316,7 @@ typedef uintmax_t uatomic_max_t;
 
 #define __arch_exchange_and_add_32_int(mem, value, mb1, mb2)           \
 ({                                                                     \
-  signed int __ret, __tmp;                                             \
+  signed int __tmp; __typeof(*mem) __ret;                              \
   __asm__ __volatile__ (                                               \
                mb1                                                     \
        "1:     ldl_l   %[__ret],%[__mem]\n"                            \
@@ -333,7 +333,7 @@ typedef uintmax_t uatomic_max_t;
 
 #define __arch_exchange_and_add_64_int(mem, value, mb1, mb2)           \
 ({                                                                     \
-  unsigned long __ret, __tmp;                                          \
+  unsigned long __tmp; __typeof(*mem) __ret;                           \
   __asm__ __volatile__ (                                               \
                mb1                                                     \
        "1:     ldq_l   %[__ret],%[__mem]\n"                            \