diff options
| author | Franklin Wei <franklin@rockbox.org> | 2024-07-21 18:06:37 -0400 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2024-07-31 23:29:00 +0100 |
| commit | 5de69c22b0ff037f648a740a7c01869e78587df2 (patch) | |
| tree | a4ea1196ffd2942a0937ae5d05a92710c6be6589 /palisade.c | |
| parent | c010ca122f8e5a9b9828a846cbbc0d32de489b20 (diff) | |
| download | puzzles-5de69c22b0ff037f648a740a7c01869e78587df2.zip puzzles-5de69c22b0ff037f648a740a7c01869e78587df2.tar.gz puzzles-5de69c22b0ff037f648a740a7c01869e78587df2.tar.bz2 puzzles-5de69c22b0ff037f648a740a7c01869e78587df2.tar.xz | |
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.
Diffstat (limited to 'palisade.c')
| -rw-r--r-- | palisade.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -912,7 +912,7 @@ static char *interpret_move(const game_state *state, game_ui *ui, int w = state->shared->params.w, h = state->shared->params.h; bool control = button & MOD_CTRL, shift = button & MOD_SHFT; - button &= ~MOD_MASK; + button = STRIP_BUTTON_MODIFIERS(button); if (button == LEFT_BUTTON || button == RIGHT_BUTTON) { int gx = FROMCOORD(x), gy = FROMCOORD(y), possible = BORDER_MASK; |