Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Avoid -Wconversion warning for htons
  • Loading branch information
Andreas Jaeger committed Jun 21, 2012
1 parent 416bf84 commit 2174c6d
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 21 deletions.
9 changes: 9 additions & 0 deletions 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]
Expand Down
30 changes: 15 additions & 15 deletions NEWS
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion bits/byteswap-16.h
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion bits/byteswap.h
Expand Up @@ -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>
Expand Down
4 changes: 2 additions & 2 deletions sysdeps/s390/bits/byteswap-16.h
Expand Up @@ -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 { \
Expand All @@ -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 { \
Expand Down
4 changes: 2 additions & 2 deletions sysdeps/s390/bits/byteswap.h
@@ -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.
Expand Down Expand Up @@ -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>
Expand Down

0 comments on commit 2174c6d

Please sign in to comment.