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:
Franklin Wei
2024-07-21 18:06:37 -04:00
committed by Simon Tatham
parent c010ca122f
commit 5de69c22b0
20 changed files with 32 additions and 22 deletions

2
rect.c
View File

@ -2394,7 +2394,7 @@ static char *interpret_move(const game_state *from, game_ui *ui,
bool startdrag = false, enddrag = false, active = false, erasing = false;
char buf[80], *ret;
button &= ~MOD_MASK;
button = STRIP_BUTTON_MODIFIERS(button);
coord_round(FROMCOORD((float)x), FROMCOORD((float)y), &xc, &yc);