Fix error: format specifies type 'unsigned short' but the argument has type 'int'

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-10-31 22:29:19 +08:00 committed by Petro Karashchenko
parent 5948dc8c8f
commit 3b060bad34
2 changed files with 5 additions and 5 deletions

View file

@ -65,10 +65,10 @@
#define MSBYTE(u16) ((u16) >> 8) /* Get MS byte from uint16_t */ #define MSBYTE(u16) ((u16) >> 8) /* Get MS byte from uint16_t */
#define LSBYTE(u16) ((u16) & 0xff) /* Get LS byte from uint16_t */ #define LSBYTE(u16) ((u16) & 0xff) /* Get LS byte from uint16_t */
#define GETUINT16(p) (((uint16_t)p[1] << 8) | (uint16_t)p[0]) #define GETUINT16(p) ((uint16_t)((uint16_t)(p[1] << 8) | (uint16_t)p[0]))
#define GETUINT32(p) (((uint32_t)p[3] << 24) | \ #define GETUINT32(p) ((uint32_t)((uint32_t)p[3] << 24) | \
((uint32_t)p[2] << 16) | \ ((uint32_t)p[2] << 16) | \
((uint32_t)p[1] << 8) | (uint32_t)p[0]) ((uint32_t)p[1] << 8) | (uint32_t)p[0])
/* USB directions (in endpoint addresses) */ /* USB directions (in endpoint addresses) */

View file

@ -103,7 +103,7 @@
/* GET 16-bit data: source in network order */ /* GET 16-bit data: source in network order */
#define GETUINT16(ptr,index) \ #define GETUINT16(ptr,index) \
((((uint16_t)((ptr)[index])) << 8) | ((uint16_t)(((ptr)[(index) + 1])))) ((uint16_t)((((uint16_t)((ptr)[index])) << 8) | ((uint16_t)(((ptr)[(index) + 1])))))
/* PUT 16-bit data: source in host order, result in network order */ /* PUT 16-bit data: source in host order, result in network order */