]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Avoid -Wconversion warning for htons
authorAndreas Jaeger <aj@suse.de>
Thu, 21 Jun 2012 13:49:33 +0000 (15:49 +0200)
committerAndreas Jaeger <aj@suse.de>
Thu, 21 Jun 2012 13:49:33 +0000 (15:49 +0200)
ChangeLog
NEWS
bits/byteswap-16.h
bits/byteswap.h
sysdeps/s390/bits/byteswap-16.h
sysdeps/s390/bits/byteswap.h

index 102ccba5c2c5c0212e8f4f5d58310c5c745bd6d8..1363c788e4ddf4b62fb6ad95ca7403f69e3c949a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2012-06-21  Andreas Jaeger  <aj@suse.de>
+
+       [BZ #12194]
+       * sysdeps/s390/bits/byteswap-16.h (__bswap_16): Avoid -Wconversion
+       warning.
+       * sysdeps/s390/bits/byteswap.h (__bswap_constant_16): Likewise.
+       * bits/byteswap-16.h (__bswap_16): Likewise.
+       * bits/byteswap.h (__bswap_constant_16): Likewise.
+
 2012-06-18  H.J. Lu  <hongjiu.lu@intel.com>
 
        [BZ #14117]
diff --git a/NEWS b/NEWS
index b46122bc1b196eac1e0808248cc6056ef23e0ff1..97ab8fead94ff4870355210530b41b5d233b18c3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,21 +16,21 @@ Version 2.16
   6884, 6890, 6894, 6895, 6907, 6911, 6959, 7064, 9739, 9902, 10110, 10135,
   10140, 10153, 10210, 10254, 10346, 10375, 10545, 10716, 10846, 11174,
   11322, 11365, 11451, 11494, 11521, 11677, 11837, 11959, 12047, 12097,
-  12193, 12297, 12298, 12301, 12340, 12354, 12416, 12495, 13058, 13223,
-  13361, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532, 13533,
-  13547, 13551, 13552, 13553, 13555, 13556, 13559, 13563, 13566, 13576,
-  13583, 13592, 13594, 13613, 13618, 13637, 13656, 13658, 13673, 13691,
-  13695, 13704, 13705, 13706, 13718, 13726, 13738, 13739, 13743, 13750,
-  13758, 13760, 13761, 13775, 13786, 13787, 13792, 13806, 13824, 13840,
-  13841, 13844, 13846, 13848, 13851, 13852, 13854, 13871, 13872, 13873,
-  13879, 13883, 13884, 13885, 13886, 13892, 13895, 13908, 13910, 13911,
-  13912, 13913, 13914, 13915, 13916, 13917, 13918, 13919, 13920, 13921,
-  13922, 13923, 13924, 13926, 13927, 13928, 13938, 13941, 13942, 13954,
-  13955, 13956, 13963, 13967, 13968, 13970, 13973, 13979, 13983, 13986,
-  13996, 14012, 14027, 14033, 14034, 14036, 14040, 14043, 14044, 14048,
-  14049, 14050, 14053, 14055, 14059, 14064, 14075, 14080, 14083, 14103,
-  14104, 14109, 14112, 14117, 14122, 14123, 14134, 14153, 14183, 14188,
-  14199, 14210, 14218, 14229, 14241
+  12193, 12194, 12297, 12298, 12301, 12340, 12354, 12416, 12495, 13058,
+  13223, 13361, 13525, 13526, 13527, 13528, 13529, 13530, 13531, 13532,
+  13533, 13547, 13551, 13552, 13553, 13555, 13556, 13559, 13563, 13566,
+  13576, 13583, 13592, 13594, 13613, 13618, 13637, 13656, 13658, 13673,
+  13691, 13695, 13704, 13705, 13706, 13718, 13726, 13738, 13739, 13743,
+  13750, 13758, 13760, 13761, 13775, 13786, 13787, 13792, 13806, 13824,
+  13840, 13841, 13844, 13846, 13848, 13851, 13852, 13854, 13871, 13872,
+  13873, 13879, 13883, 13884, 13885, 13886, 13892, 13895, 13908, 13910,
+  13911, 13912, 13913, 13914, 13915, 13916, 13917, 13918, 13919, 13920,
+  13921, 13922, 13923, 13924, 13926, 13927, 13928, 13938, 13941, 13942,
+  13954, 13955, 13956, 13963, 13967, 13968, 13970, 13973, 13979, 13983,
+  13986, 13996, 14012, 14027, 14033, 14034, 14036, 14040, 14043, 14044,
+  14048, 14049, 14050, 14053, 14055, 14059, 14064, 14075, 14080, 14083,
+  14103, 14104, 14109, 14112, 14117, 14122, 14123, 14134, 14153, 14183,
+  14188, 14199, 14210, 14218, 14229, 14241
 
 * Support for the x32 ABI on x86-64 added.  The x32 target is selected by
   configuring glibc with:
index 078dd0e17abebad6c8d440f030e11e512f654db0..6cc1d309321a313e7eda14555fb2da05f0ed84c6 100644 (file)
@@ -23,7 +23,8 @@
 #ifdef __GNUC__
 # define __bswap_16(x) \
     (__extension__                                                           \
-     ({ unsigned short int __bsx = (x); __bswap_constant_16 (__bsx); }))
+     ({ unsigned short int __bsx = (unsigned short int) (x);                 \
+       __bswap_constant_16 (__bsx); }))
 #else
 static __inline unsigned short int
 __bswap_16 (unsigned short int __bsx)
index d818293a4c78016c9c4996348ffff35a1f457960..3ca0ad6986421bd97e9867f9570739dcc022ac9b 100644 (file)
@@ -27,7 +27,7 @@
 
 /* Swap bytes in 16 bit value.  */
 #define __bswap_constant_16(x) \
-     ((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8))
+       ((unsigned short int)((((x) >> 8) & 0xffu) | (((x) & 0xffu) << 8)))
 
 /* Get __bswap_16.  */
 #include <bits/byteswap-16.h>
index 8bfec78ffe6548702150b741990d5e27430d33cd..126f382145106db5234652d670cd4cce1a917a28 100644 (file)
@@ -28,7 +28,7 @@
 # if __WORDSIZE == 64
 #  define __bswap_16(x) \
      (__extension__                                                          \
-      ({ unsigned short int __v, __x = (x);                                  \
+      ({ unsigned short int __v, __x = (unsigned short int) (x);             \
         if (__builtin_constant_p (x))                                        \
           __v = __bswap_constant_16 (__x);                                   \
         else {                                                               \
@@ -41,7 +41,7 @@
 # else
 #  define __bswap_16(x) \
      (__extension__                                                          \
-      ({ unsigned short int __v, __x = (x);                                  \
+      ({ unsigned short int __v, __x = (unsigned short int) (x);             \
         if (__builtin_constant_p (x))                                        \
           __v = __bswap_constant_16 (__x);                                   \
         else {                                                               \
index e91d4ccb8f25ef5a749421ffb0328242c3dd2346..3ae6436bb310c1b938fabbd8cc75ab0a99da6c47 100644 (file)
@@ -1,5 +1,5 @@
 /* Macros to swap the order of bytes in integer values.  s390 version.
-   Copyright (C) 2000-2003, 2008, 2011, 2012 Free Software Foundation, Inc.
+   Copyright (C) 2000-2012 Free Software Foundation, Inc.
    Contributed by Martin Schwidefsky (schwidefsky@de.ibm.com).
    This file is part of the GNU C Library.
 
@@ -27,7 +27,7 @@
 #define _BITS_BYTESWAP_H 1
 
 #define __bswap_constant_16(x) \
-     ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
+       ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
 
 /* Get __bswap_16.  */
 #include <bits/byteswap-16.h>