Skip to content

Commit 6a524ad

Browse files
authored
Merge pull request #154 from positron96/patch-2
Fix bitWrite with parenthesis
2 parents 173e8ea + 5e2880e commit 6a524ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

api/Common.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typedef void (*voidFuncPtrParam)(void*);
6565
#define bitSet(value, bit) ((value) |= (1UL << (bit)))
6666
#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
6767
#define bitToggle(value, bit) ((value) ^= (1UL << (bit)))
68-
#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
68+
#define bitWrite(value, bit, bitvalue) ((bitvalue) ? bitSet((value), (bit)) : bitClear((value), (bit)))
6969

7070
#ifndef bit
7171
#define bit(b) (1UL << (b))

0 commit comments

Comments
 (0)