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:
hujun5
2026-01-28 20:08:10 +08:00
committed by Alan C. Assis
parent 3a214b5808
commit 2df1ecca3c
+1 -1
View File
@@ -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)