mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-04-03 23:56:02 +02:00
Shifting a number into the sign bit of a signed integer is UB
Shift as a unsigned number instead.
This commit is contained in:
committed by
Anonymous Maarten
parent
48e80c8f26
commit
df72e3f59d
@@ -101,7 +101,7 @@ static void RunBasicTest(void)
|
||||
#define VALBITS (sizeof(atomicValue) * 8)
|
||||
|
||||
#define atomicValue int
|
||||
#define CountTo ((atomicValue)((unsigned int)(1 << (VALBITS - 1)) - 1))
|
||||
#define CountTo ((atomicValue)((1u << (VALBITS - 1)) - 1))
|
||||
#define NInter (CountTo / CountInc / NThreads)
|
||||
#define Expect (CountTo - NInter * CountInc * NThreads)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user