Merge pull request #74 from GabrielRavier/parenthesizeFlagsMacros

Parenthesize flag macros
This commit is contained in:
Clownacy 2019-11-04 19:08:30 +00:00 committed by GitHub
commit 4e322f25c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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];