SDL_rawinputjoystick.c: fix ambiguous 'else' warning
authorOzkan Sezer
Thu, 26 Nov 2020 10:47:33 +0300
changeset 1439386796edcae76
parent 14392 64754dd5b541
child 14394 01fafed8a3d9
SDL_rawinputjoystick.c: fix ambiguous 'else' warning

src/joystick/windows/SDL_rawinputjoystick.c: In function 'RAWINPUT_HandleStatePacket':
src/joystick/windows/SDL_rawinputjoystick.c:1343:9: warning: suggest explicit braces to avoid ambiguous 'else'
src/joystick/windows/SDL_rawinputjoystick.c
     1.1 --- a/src/joystick/windows/SDL_rawinputjoystick.c	Wed Nov 25 16:46:42 2020 -0800
     1.2 +++ b/src/joystick/windows/SDL_rawinputjoystick.c	Thu Nov 26 10:47:33 2020 +0300
     1.3 @@ -1318,7 +1318,7 @@
     1.4      };
     1.5      Uint32 match_state = ctx->match_state;
     1.6      /* Update match_state with button bit, then fall through */
     1.7 -#define SDL_PrivateJoystickButton(joystick, button, state) if (button < SDL_arraysize(button_map)) if (state) match_state |= 1 << button_map[button]; else match_state &= ~(1 << button_map[button]); SDL_PrivateJoystickButton(joystick, button, state)
     1.8 +#define SDL_PrivateJoystickButton(joystick, button, state) if (button < SDL_arraysize(button_map)) { if (state) match_state |= 1 << button_map[button]; else match_state &= ~(1 << button_map[button]); } SDL_PrivateJoystickButton(joystick, button, state)
     1.9      /* Grab high 4 bits of value, then fall through */
    1.10  #define SDL_PrivateJoystickAxis(joystick, axis, value) if (axis < SDL_arraysize(axis_map)) match_state = (match_state & ~(0xF << (4 * axis_map[axis] + 16))) | ((value) & 0xF000) << (4 * axis_map[axis] + 4); SDL_PrivateJoystickAxis(joystick, axis, value)
    1.11  #endif