From 5de69c22b0ff037f648a740a7c01869e78587df2 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Sun, 21 Jul 2024 18:06:37 -0400 Subject: 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. --- pattern.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pattern.c') diff --git a/pattern.c b/pattern.c index de0fb97..d38cada 100644 --- a/pattern.c +++ b/pattern.c @@ -1292,7 +1292,7 @@ static char *interpret_move(const game_state *state, game_ui *ui, int x, int y, int button) { bool control = button & MOD_CTRL, shift = button & MOD_SHFT; - button &= ~MOD_MASK; + button = STRIP_BUTTON_MODIFIERS(button); x = FROMCOORD(state->common->w, x); y = FROMCOORD(state->common->h, y); -- cgit v1.1