diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2014-10-30 08:54:11 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2014-10-30 09:07:49 +1000 |
commit | b227d974569b4c315a72b85fe839c5f455396678 (patch) | |
tree | db82f44c62617dd2acab501dc592963e9afccb3c /include | |
parent | e9db7682028bb0464c211c1f7bb6983fcfb6f37b (diff) |
include: fix compiler warning about casting int to uint16_t
/usr/include/xorg/misc.h:141:30: warning: implicit conversion loses integer
precision: 'int' to 'uint16_t' (aka 'unsigned short') [-Wconversion]
return ((x & 0xff) << 8) | ((x >> 8) & 0xff);
~~~~~~ ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
Function sig is a uint16_t, so just force the cast.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/misc.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/misc.h b/include/misc.h index 9c2f573b9..f5b85eefa 100644 --- a/include/misc.h +++ b/include/misc.h @@ -138,7 +138,7 @@ lswapl(uint32_t x) static inline uint16_t lswaps(uint16_t x) { - return ((x & 0xff) << 8) | ((x >> 8) & 0xff); + return (uint16_t)((x & 0xff) << 8) | ((x >> 8) & 0xff); } #undef min |