From b3dca03ebf7bee554eb93010ced563f8748a3ad0 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 30 May 2026 14:05:45 -0400 Subject: [PATCH] SDL_migration.cocci: Add joystick/gamepad event state functions. (cherry picked from commit e1aaebff8784fe6316bc90171f8c13d6f7071ad5) --- build-scripts/SDL_migration.cocci | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/build-scripts/SDL_migration.cocci b/build-scripts/SDL_migration.cocci index 3cfaae5520..abfc50551a 100644 --- a/build-scripts/SDL_migration.cocci +++ b/build-scripts/SDL_migration.cocci @@ -111,6 +111,42 @@ expression e1; - SDL_GetEventState(e1) + SDL_EventEnabled(e1) + +// SDL_JoystickEventState() - replaced with SDL_SetJoystickEventsEnabled() +@@ +@@ +( +- SDL_JoystickEventState(SDL_IGNORE) ++ SDL_SetJoystickEventsEnabled(false) +| +- SDL_JoystickEventState(SDL_DISABLE) ++ SDL_SetJoystickEventsEnabled(false) +| +- SDL_JoystickEventState(SDL_ENABLE) ++ SDL_SetJoystickEventsEnabled(true) +| +- SDL_JoystickEventState(SDL_QUERY) ++ SDL_JoystickEventsEnabled() +) + + +// SDL_GameControllerEventState() - replaced with SDL_SetGamepadEventsEnabled() +@@ +@@ +( +- SDL_GameControllerEventState(SDL_IGNORE) ++ SDL_SetGamepadEventsEnabled(false) +| +- SDL_GameControllerEventState(SDL_DISABLE) ++ SDL_SetGamepadEventsEnabled(false) +| +- SDL_GameControllerEventState(SDL_ENABLE) ++ SDL_SetGamepadEventsEnabled(true) +| +- SDL_GameControllerEventState(SDL_QUERY) ++ SDL_GamepadEventsEnabled() +) + @@ expression e; @@