mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-02-04 12:50:33 +01:00
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 <thatslyude@gmail.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
0f70e2b309
commit
584ef1dbf5
1 changed files with 2 additions and 2 deletions
|
|
@ -27,8 +27,8 @@
|
|||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
|
||||
#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_) \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue