Guard the key_is_pressed/key_was_pressed arguments better

Instead of using the argument as-is, which could be misinterpreted as a
reference (at least by linkers), wrap them in parens to make it clear they are
not.

Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
pull/135/head
Gergely Nagy 8 years ago
parent 477c426385
commit c05573ea40

@ -7,7 +7,7 @@
#define IS_PRESSED B00000010 #define IS_PRESSED B00000010
#define WAS_PRESSED B00000001 #define WAS_PRESSED B00000001
#define key_was_pressed(keyState) (keyState & WAS_PRESSED) #define key_was_pressed(keyState) ((keyState) & WAS_PRESSED)
#define key_is_pressed(keyState) (keyState & IS_PRESSED) #define key_is_pressed(keyState) ((keyState) & IS_PRESSED)
#define key_toggled_on(keyState) (key_is_pressed(keyState) && ! key_was_pressed(keyState)) #define key_toggled_on(keyState) (key_is_pressed(keyState) && ! key_was_pressed(keyState))
#define key_toggled_off(keyState) (key_was_pressed(keyState) && ! key_is_pressed(keyState)) #define key_toggled_off(keyState) (key_was_pressed(keyState) && ! key_is_pressed(keyState))

Loading…
Cancel
Save