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>
This commit is contained in:
parent
e9db768202
commit
b227d97456
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user