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:
Peter Hutterer 2014-10-30 08:54:11 +10:00
parent e9db768202
commit b227d97456

View File

@ -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