Add STRIP_BUTTON_MODIFIERS() macro to refactor modifier flag stripping.

There are many places in the code which use the (x & ~MOD_MASK) idiom. This
new macro makes possible their refactoring in the future.
This commit is contained in:
Franklin Wei
2024-07-21 04:36:30 -04:00
committed by Simon Tatham
parent fd304c53cc
commit 894115ad3d

View File

@ -72,6 +72,7 @@ enum {
(m) == CURSOR_RIGHT || (m) == CURSOR_LEFT )
#define IS_CURSOR_SELECT(m) ( (m) == CURSOR_SELECT || (m) == CURSOR_SELECT2)
#define IS_UI_FAKE_KEY(m) ( (m) > UI_LOWER_BOUND && (m) < UI_UPPER_BOUND )
#define STRIP_BUTTON_MODIFIERS(m) ( (unsigned)(m) & ~MOD_MASK )
/*
* Flags in the back end's `flags' word.