mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-03 06:38:02 +02:00
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
1 changed files with 1 additions and 1 deletions
|
|
@ -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…
Add table
Reference in a new issue