mirror of
https://github.com/apache/nuttx.git
synced 2026-05-22 22:20:01 +08:00
semaphore.h: fix ubsan error
Replace left-shift of 1 by 31 bits with direct hexadecimal constant to eliminate undefined behavior warning when left-shifting signed values beyond their bit width on platforms with strict sanitizer checking. Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
@@ -66,7 +66,7 @@
|
||||
|
||||
/* Mutex related helper macros */
|
||||
|
||||
#define NXSEM_MBLOCKING_BIT (((uint32_t)1) << 31)
|
||||
#define NXSEM_MBLOCKING_BIT ((uint32_t)0x80000000)
|
||||
#define NXSEM_NO_MHOLDER ((uint32_t)0x7ffffffe)
|
||||
#define NXSEM_MRESET ((uint32_t)0x7fffffff)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user