Fixes for undefined behaviour on signed shift (#3453)
Fixes for undefined behaviour on signed shift Change literal 1 to unsigned to allow safe bitshift of 31. Caught by cppcheck. Make 0xFF unsigned to prevent a left shift into signed bit. Spotted by @orestisf1993
This commit is contained in:
@ -87,7 +87,7 @@ typedef struct i3_ipc_header {
|
||||
* Events from i3 to clients. Events have the first bit set high.
|
||||
*
|
||||
*/
|
||||
#define I3_IPC_EVENT_MASK (1 << 31)
|
||||
#define I3_IPC_EVENT_MASK (1UL << 31)
|
||||
|
||||
/* The workspace event will be triggered upon changes in the workspace list */
|
||||
#define I3_IPC_EVENT_WORKSPACE (I3_IPC_EVENT_MASK | 0)
|
||||
|
Reference in New Issue
Block a user