diff options
author | Ulrich Drepper <drepper@gmail.com> | 2011-12-23 13:52:59 -0500 |
---|---|---|
committer | Ulrich Drepper <drepper@gmail.com> | 2011-12-23 13:52:59 -0500 |
commit | 67371b5666310a0012ec39b6c9bc41fe0c1b0bc4 (patch) | |
tree | 6059d358471785cc7223dd2a11e87584211824e0 /bits | |
parent | bbe315ea364e86166bb985e2e605af029482a124 (diff) | |
download | glibc-67371b5666310a0012ec39b6c9bc41fe0c1b0bc4.tar.gz glibc-67371b5666310a0012ec39b6c9bc41fe0c1b0bc4.tar.xz glibc-67371b5666310a0012ec39b6c9bc41fe0c1b0bc4.zip |
Prevent warnings due to long long constants
Diffstat (limited to 'bits')
-rw-r--r-- | bits/byteswap.h | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/bits/byteswap.h b/bits/byteswap.h index 45cb9471e3..6df2f28c02 100644 --- a/bits/byteswap.h +++ b/bits/byteswap.h @@ -1,5 +1,6 @@ /* Macros to swap the order of bytes in integer values. - Copyright (C) 1997,1998,2000-2002,2005,2008 Free Software Foundation, Inc. + Copyright (C) 1997,1998,2000-2002,2005,2008,2011 + 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 @@ -60,20 +61,20 @@ __bswap_32 (unsigned int __bsx) #if defined __GNUC__ && __GNUC__ >= 2 /* Swap bytes in 64 bit value. */ # define __bswap_constant_64(x) \ - ((((x) & 0xff00000000000000ull) >> 56) \ - | (((x) & 0x00ff000000000000ull) >> 40) \ - | (((x) & 0x0000ff0000000000ull) >> 24) \ - | (((x) & 0x000000ff00000000ull) >> 8) \ - | (((x) & 0x00000000ff000000ull) << 8) \ - | (((x) & 0x0000000000ff0000ull) << 24) \ - | (((x) & 0x000000000000ff00ull) << 40) \ - | (((x) & 0x00000000000000ffull) << 56)) + (__extension__ ((((x) & 0xff00000000000000ull) >> 56) \ + | (((x) & 0x00ff000000000000ull) >> 40) \ + | (((x) & 0x0000ff0000000000ull) >> 24) \ + | (((x) & 0x000000ff00000000ull) >> 8) \ + | (((x) & 0x00000000ff000000ull) << 8) \ + | (((x) & 0x0000000000ff0000ull) << 24) \ + | (((x) & 0x000000000000ff00ull) << 40) \ + | (((x) & 0x00000000000000ffull) << 56))) # define __bswap_64(x) \ (__extension__ \ ({ union { __extension__ unsigned long long int __ll; \ unsigned int __l[2]; } __w, __r; \ - if (__builtin_constant_p (x)) \ + if (__builtin_constant_p (x)) \ __r.__ll = __bswap_constant_64 (x); \ else \ { \ |