mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
Refactor button & ~MOD_MASK' as
STRIP_BUTTON_MODIFIERS(button)'.
This refactors all instances of bitwise-ANDs with `~MOD_MASK'. There is a handful of more complex instances I left unchanged (in cube.c, midend.c, and twiddle.c), since those AND with `~MOD_MASK | MOD_NUM_KEYPAD' or similar. I don't think it's worth writing a macro for those cases. Also document this new macro's usage in devel.but.
This commit is contained in:

committed by
Simon Tatham

parent
c010ca122f
commit
5de69c22b0
2
pearl.c
2
pearl.c
@ -2167,7 +2167,7 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
||||
char tmpbuf[80];
|
||||
|
||||
bool shift = button & MOD_SHFT, control = button & MOD_CTRL;
|
||||
button &= ~MOD_MASK;
|
||||
button = STRIP_BUTTON_MODIFIERS(button);
|
||||
|
||||
if (IS_MOUSE_DOWN(button)) {
|
||||
ui->cursor_active = false;
|
||||
|
Reference in New Issue
Block a user