From 584ef1dbf5750cd96da17b10613a4bbac3b9a6f9 Mon Sep 17 00:00:00 2001 From: Stephen Chandler Paul Date: Tue, 17 Jun 2014 18:03:26 -0400 Subject: [PATCH] tablet: remove parentheses around tablet_(un)set_status Having parantheses around tablet_has_status() is completely appropriate, but not for setting/unsetting a status. There's no legitimate reason we'd ever be checking the return value of tablet_(un)set_status() since it already stores it's result in a variable. As such, having it expand with parantheses around it means that if it's accidentally used in a conditional instead of tablet_has_status() our compiler won't throw any sort of warning. And the subtle differences between tablet_has_status() and tablet_set_status() are very easy to miss when trying to debug this. Removing the parantheses causes gcc to warn if the function is used as a conditional unintentionally. Signed-off-by: Stephen Chandler Paul Reviewed-by: Peter Hutterer Signed-off-by: Peter Hutterer --- src/evdev-tablet.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/evdev-tablet.c b/src/evdev-tablet.c index 11122c40..3b82e917 100644 --- a/src/evdev-tablet.c +++ b/src/evdev-tablet.c @@ -27,8 +27,8 @@ #include #include -#define tablet_set_status(tablet_,s_) ((tablet_)->status |= (s_)) -#define tablet_unset_status(tablet_,s_) ((tablet_)->status &= ~(s_)) +#define tablet_set_status(tablet_,s_) (tablet_)->status |= (s_) +#define tablet_unset_status(tablet_,s_) (tablet_)->status &= ~(s_) #define tablet_has_status(tablet_,s_) (!!((tablet_)->status & (s_))) #define tablet_get_pressed_buttons(tablet_,field_) \