shithub: cstory

Download patch

ref: 4e322f25c4760774c122c4e7b1662a64d58d5d2d
parent: 6408303c53bbc5a8be917e171449d0e57d59fb72
parent: 159bc5d869346ce3c4f213988e8cceffa47c12fa
author: Clownacy <Clownacy@users.noreply.github.com>
date: Mon Nov 4 14:08:30 EST 2019

Merge pull request #74 from GabrielRavier/parenthesizeFlagsMacros

Parenthesize flag macros

--- a/src/Flags.cpp
+++ b/src/Flags.cpp
@@ -6,9 +6,9 @@
 
 // Macros for setting, un-setting and getting flags
 // Each flag is stored in a bit, so we can use the exact same macros we'd use for bits
-#define SET_FLAG(x, i) ((x)[(i) / 8] |= 1 << (i) % 8)
-#define UNSET_FLAG(x, i) ((x)[(i) / 8] &= ~(1 << (i) % 8))
-#define GET_FLAG(x, i) ((x)[(i) / 8] & (1 << (i) % 8))
+#define SET_FLAG(x, i) ((x)[(i) / 8] |= 1 << ((i) % 8))
+#define UNSET_FLAG(x, i) ((x)[(i) / 8] &= ~(1 << ((i) % 8)))
+#define GET_FLAG(x, i) ((x)[(i) / 8] & (1 << ((i) % 8)))
 
 unsigned char gFlagNPC[1000];
 unsigned char gSkipFlag[8];