Skip to content

Commit

Permalink
Renamed SDL_Del* to SDL_Remove*
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 31, 2024
1 parent cf1d8e2 commit f827c13
Show file tree
Hide file tree
Showing 45 changed files with 118 additions and 98 deletions.
10 changes: 10 additions & 0 deletions build-scripts/SDL_migration.cocci
Original file line number Diff line number Diff line change
Expand Up @@ -3633,3 +3633,13 @@ identifier func =~ "^(SDL_AddEventWatch|SDL_AddHintCallback|SDL_AddSurfaceAltern
- SDL_AtomicGetPtr
+ SDL_AtomicGetPointer
(...)
@@
@@
- SDL_DelEventWatch
+ SDL_RemoveEventWatch
(...)
@@
@@
- SDL_DelHintCallback
+ SDL_RemoveHintCallback
(...)
6 changes: 6 additions & 0 deletions docs/README-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ The following functions have been removed:
The following enums have been renamed:
* SDL_eventaction => SDL_EventAction

The following functions have been renamed:
* SDL_DelEventWatch() => SDL_RemoveEventWatch()

## SDL_gamecontroller.h

SDL_gamecontroller.h has been renamed SDL_gamepad.h, and all APIs have been renamed to match.
Expand Down Expand Up @@ -862,6 +865,9 @@ The following environment variables have been removed:
The following functions have been removed:
* SDL_ClearHints() - replaced with SDL_ResetHints()

The following functions have been renamed:
* SDL_DelHintCallback() => SDL_RemoveHintCallback()

## SDL_init.h

On Haiku OS, SDL no longer sets the current working directory to the executable's path during SDL_Init(). If you need this functionality, the fastest solution is to add this code directly after the call to SDL_Init:
Expand Down
4 changes: 2 additions & 2 deletions include/SDL3/SDL_events.h
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter *filter,
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_DelEventWatch
* \sa SDL_RemoveEventWatch
* \sa SDL_SetEventFilter
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, void *userdata);
Expand All @@ -1397,7 +1397,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddEventWatch(SDL_EventFilter filter, v
*
* \sa SDL_AddEventWatch
*/
extern SDL_DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter, void *userdata);
extern SDL_DECLSPEC void SDLCALL SDL_RemoveEventWatch(SDL_EventFilter filter, void *userdata);

/**
* Run a specific filter function on the current event queue, removing any
Expand Down
4 changes: 2 additions & 2 deletions include/SDL3/SDL_hints.h
Original file line number Diff line number Diff line change
Expand Up @@ -4307,7 +4307,7 @@ typedef void(SDLCALL *SDL_HintCallback)(void *userdata, const char *name, const
*
* \since This function is available since SDL 3.0.0.
*
* \sa SDL_DelHintCallback
* \sa SDL_RemoveHintCallback
*/
extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *userdata);

Expand All @@ -4325,7 +4325,7 @@ extern SDL_DECLSPEC SDL_bool SDLCALL SDL_AddHintCallback(const char *name, SDL_H
*
* \sa SDL_AddHintCallback
*/
extern SDL_DECLSPEC void SDLCALL SDL_DelHintCallback(const char *name,
extern SDL_DECLSPEC void SDLCALL SDL_RemoveHintCallback(const char *name,
SDL_HintCallback callback,
void *userdata);

Expand Down
4 changes: 4 additions & 0 deletions include/SDL3/SDL_oldnames.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
#define SDL_DROPCOMPLETE SDL_EVENT_DROP_COMPLETE
#define SDL_DROPFILE SDL_EVENT_DROP_FILE
#define SDL_DROPTEXT SDL_EVENT_DROP_TEXT
#define SDL_DelEventWatch SDL_RemoveEventWatch
#define SDL_FINGERDOWN SDL_EVENT_FINGER_DOWN
#define SDL_FINGERMOTION SDL_EVENT_FINGER_MOTION
#define SDL_FINGERUP SDL_EVENT_FINGER_UP
Expand Down Expand Up @@ -298,6 +299,7 @@
#define SDL_MouseIsHaptic SDL_IsMouseHaptic

/* ##SDL_hints.h */
#define SDL_DelHintCallback SDL_RemoveHintCallback
#define SDL_HINT_ALLOW_TOPMOST SDL_HINT_WINDOW_ALLOW_TOPMOST
#define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_JOYSTICK_DIRECTINPUT
#define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT
Expand Down Expand Up @@ -739,6 +741,7 @@
#define SDL_DROPCOMPLETE SDL_DROPCOMPLETE_renamed_SDL_EVENT_DROP_COMPLETE
#define SDL_DROPFILE SDL_DROPFILE_renamed_SDL_EVENT_DROP_FILE
#define SDL_DROPTEXT SDL_DROPTEXT_renamed_SDL_EVENT_DROP_TEXT
#define SDL_DelEventWatch SDL_DelEventWatch_renamed_SDL_RemoveEventWatch
#define SDL_FINGERDOWN SDL_FINGERDOWN_renamed_SDL_EVENT_FINGER_DOWN
#define SDL_FINGERMOTION SDL_FINGERMOTION_renamed_SDL_EVENT_FINGER_MOTION
#define SDL_FINGERUP SDL_FINGERUP_renamed_SDL_EVENT_FINGER_UP
Expand Down Expand Up @@ -920,6 +923,7 @@
#define SDL_MouseIsHaptic SDL_MouseIsHaptic_renamed_SDL_IsMouseHaptic

/* ##SDL_hints.h */
#define SDL_DelHintCallback SDL_DelHintCallback_renamed_SDL_RemoveHintCallback
#define SDL_HINT_ALLOW_TOPMOST SDL_HINT_ALLOW_TOPMOST_renamed_SDL_HINT_WINDOW_ALLOW_TOPMOST
#define SDL_HINT_DIRECTINPUT_ENABLED SDL_HINT_DIRECTINPUT_ENABLED_renamed_SDL_HINT_JOYSTICK_DIRECTINPUT
#define SDL_HINT_GDK_TEXTINPUT_DEFAULT SDL_HINT_GDK_TEXTINPUT_DEFAULT_renamed_SDL_HINT_GDK_TEXTINPUT_DEFAULT_TEXT
Expand Down
4 changes: 2 additions & 2 deletions src/SDL_hints.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ SDL_bool SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *

SDL_LockProperties(hints);

SDL_DelHintCallback(name, callback, userdata);
SDL_RemoveHintCallback(name, callback, userdata);

SDL_Hint *hint = (SDL_Hint *)SDL_GetPointerProperty(hints, name, NULL);
if (hint) {
Expand Down Expand Up @@ -305,7 +305,7 @@ SDL_bool SDL_AddHintCallback(const char *name, SDL_HintCallback callback, void *
return result;
}

void SDL_DelHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
void SDL_RemoveHintCallback(const char *name, SDL_HintCallback callback, void *userdata)
{
if (!name || !*name) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/core/linux/SDL_ibus.c
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ void SDL_IBus_Quit(void)

// !!! FIXME: should we close(inotify_fd) here?

SDL_DelHintCallback(SDL_HINT_IME_IMPLEMENTED_UI, IBus_SetCapabilities, NULL);
SDL_RemoveHintCallback(SDL_HINT_IME_IMPLEMENTED_UI, IBus_SetCapabilities, NULL);

SDL_memset(&ibus_cursor_rect, 0, sizeof(ibus_cursor_rect));
}
Expand Down
4 changes: 2 additions & 2 deletions src/dynapi/SDL_dynapi.sym
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ SDL3_0.0.0 {
SDL_CreateWindowWithProperties;
SDL_CursorVisible;
SDL_DateTimeToTime;
SDL_DelEventWatch;
SDL_DelHintCallback;
SDL_RemoveEventWatch;
SDL_RemoveHintCallback;
SDL_Delay;
SDL_DelayNS;
SDL_DestroyAudioStream;
Expand Down
4 changes: 2 additions & 2 deletions src/dynapi/SDL_dynapi_overrides.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@
#define SDL_CreateWindowWithProperties SDL_CreateWindowWithProperties_REAL
#define SDL_CursorVisible SDL_CursorVisible_REAL
#define SDL_DateTimeToTime SDL_DateTimeToTime_REAL
#define SDL_DelEventWatch SDL_DelEventWatch_REAL
#define SDL_DelHintCallback SDL_DelHintCallback_REAL
#define SDL_RemoveEventWatch SDL_RemoveEventWatch_REAL
#define SDL_RemoveHintCallback SDL_RemoveHintCallback_REAL
#define SDL_Delay SDL_Delay_REAL
#define SDL_DelayNS SDL_DelayNS_REAL
#define SDL_DestroyAudioStream SDL_DestroyAudioStream_REAL
Expand Down
4 changes: 2 additions & 2 deletions src/dynapi/SDL_dynapi_procs.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ SDL_DYNAPI_PROC(SDL_bool,SDL_CreateWindowAndRenderer,(const char *a, int b, int
SDL_DYNAPI_PROC(SDL_Window*,SDL_CreateWindowWithProperties,(SDL_PropertiesID a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_CursorVisible,(void),(),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_DateTimeToTime,(const SDL_DateTime *a, SDL_Time *b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_DelEventWatch,(SDL_EventFilter a, void *b),(a,b),)
SDL_DYNAPI_PROC(void,SDL_DelHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),)
SDL_DYNAPI_PROC(void,SDL_Delay,(Uint32 a),(a),)
SDL_DYNAPI_PROC(void,SDL_DelayNS,(Uint64 a),(a),)
SDL_DYNAPI_PROC(void,SDL_DestroyAudioStream,(SDL_AudioStream *a),(a),)
Expand Down Expand Up @@ -739,6 +737,8 @@ SDL_DYNAPI_PROC(void,SDL_ReleaseGPUTexture,(SDL_GPUDevice *a, SDL_GPUTexture *b)
SDL_DYNAPI_PROC(void,SDL_ReleaseGPUTransferBuffer,(SDL_GPUDevice *a, SDL_GPUTransferBuffer *b),(a,b),)
SDL_DYNAPI_PROC(void,SDL_ReleaseWindowFromGPUDevice,(SDL_GPUDevice *a, SDL_Window *b),(a,b),)
SDL_DYNAPI_PROC(SDL_bool,SDL_ReloadGamepadMappings,(void),(),return)
SDL_DYNAPI_PROC(void,SDL_RemoveEventWatch,(SDL_EventFilter a, void *b),(a,b),)
SDL_DYNAPI_PROC(void,SDL_RemoveHintCallback,(const char *a, SDL_HintCallback b, void *c),(a,b,c),)
SDL_DYNAPI_PROC(SDL_bool,SDL_RemovePath,(const char *a),(a),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_RemoveStoragePath,(SDL_Storage *a, const char *b),(a,b),return)
SDL_DYNAPI_PROC(void,SDL_RemoveSurfaceAlternateImages,(SDL_Surface *a),(a),)
Expand Down
12 changes: 6 additions & 6 deletions src/events/SDL_events.c
Original file line number Diff line number Diff line change
Expand Up @@ -1589,7 +1589,7 @@ SDL_bool SDL_AddEventWatch(SDL_EventFilter filter, void *userdata)
return result;
}

void SDL_DelEventWatch(SDL_EventFilter filter, void *userdata)
void SDL_RemoveEventWatch(SDL_EventFilter filter, void *userdata)
{
SDL_LockMutex(SDL_event_watchers_lock);
{
Expand Down Expand Up @@ -1768,7 +1768,7 @@ bool SDL_InitEvents(void)
SDL_AddHintCallback(SDL_HINT_EVENT_LOGGING, SDL_EventLoggingChanged, NULL);
SDL_AddHintCallback(SDL_HINT_POLL_SENTINEL, SDL_PollSentinelChanged, NULL);
if (!SDL_StartEventLoop()) {
SDL_DelHintCallback(SDL_HINT_EVENT_LOGGING, SDL_EventLoggingChanged, NULL);
SDL_RemoveHintCallback(SDL_HINT_EVENT_LOGGING, SDL_EventLoggingChanged, NULL);
return false;
}

Expand All @@ -1781,13 +1781,13 @@ void SDL_QuitEvents(void)
{
SDL_QuitQuit();
SDL_StopEventLoop();
SDL_DelHintCallback(SDL_HINT_POLL_SENTINEL, SDL_PollSentinelChanged, NULL);
SDL_DelHintCallback(SDL_HINT_EVENT_LOGGING, SDL_EventLoggingChanged, NULL);
SDL_RemoveHintCallback(SDL_HINT_POLL_SENTINEL, SDL_PollSentinelChanged, NULL);
SDL_RemoveHintCallback(SDL_HINT_EVENT_LOGGING, SDL_EventLoggingChanged, NULL);
#ifndef SDL_JOYSTICK_DISABLED
SDL_DelHintCallback(SDL_HINT_AUTO_UPDATE_JOYSTICKS, SDL_AutoUpdateJoysticksChanged, NULL);
SDL_RemoveHintCallback(SDL_HINT_AUTO_UPDATE_JOYSTICKS, SDL_AutoUpdateJoysticksChanged, NULL);
#endif
#ifndef SDL_SENSOR_DISABLED
SDL_DelHintCallback(SDL_HINT_AUTO_UPDATE_SENSORS, SDL_AutoUpdateSensorsChanged, NULL);
SDL_RemoveHintCallback(SDL_HINT_AUTO_UPDATE_SENSORS, SDL_AutoUpdateSensorsChanged, NULL);
#endif
#ifdef SDL_PLATFORM_ANDROID
Android_QuitEvents();
Expand Down
2 changes: 1 addition & 1 deletion src/events/SDL_keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,7 +867,7 @@ void SDL_QuitKeyboard(void)
SDL_keyboard.keymap = NULL;
}

SDL_DelHintCallback(SDL_HINT_KEYCODE_OPTIONS,
SDL_RemoveHintCallback(SDL_HINT_KEYCODE_OPTIONS,
SDL_KeycodeOptionsChanged, &SDL_keyboard);
}

Expand Down
24 changes: 12 additions & 12 deletions src/events/SDL_mouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -1121,40 +1121,40 @@ void SDL_QuitMouse(void)
}
mouse->num_system_scale_values = 0;

SDL_DelHintCallback(SDL_HINT_MOUSE_DOUBLE_CLICK_TIME,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_DOUBLE_CLICK_TIME,
SDL_MouseDoubleClickTimeChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_DOUBLE_CLICK_RADIUS,
SDL_MouseDoubleClickRadiusChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_NORMAL_SPEED_SCALE,
SDL_MouseNormalSpeedScaleChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_RELATIVE_SPEED_SCALE,
SDL_MouseRelativeSpeedScaleChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE,
SDL_MouseRelativeSystemScaleChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_EMULATE_WARP_WITH_RELATIVE,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_EMULATE_WARP_WITH_RELATIVE,
SDL_MouseWarpEmulationChanged, mouse);

SDL_DelHintCallback(SDL_HINT_TOUCH_MOUSE_EVENTS,
SDL_RemoveHintCallback(SDL_HINT_TOUCH_MOUSE_EVENTS,
SDL_TouchMouseEventsChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_TOUCH_EVENTS,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_TOUCH_EVENTS,
SDL_MouseTouchEventsChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_AUTO_CAPTURE,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_AUTO_CAPTURE,
SDL_MouseAutoCaptureChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_WARP_MOTION,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_RELATIVE_WARP_MOTION,
SDL_MouseRelativeWarpMotionChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_RELATIVE_CURSOR_VISIBLE,
SDL_MouseRelativeCursorVisibleChanged, mouse);

SDL_DelHintCallback(SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL,
SDL_RemoveHintCallback(SDL_HINT_MOUSE_RELATIVE_CLIP_INTERVAL,
SDL_MouseRelativeClipIntervalChanged, mouse);

for (int i = SDL_mouse_count; i--; ) {
Expand Down
2 changes: 1 addition & 1 deletion src/gpu/vulkan/SDL_gpu_vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -9779,7 +9779,7 @@ static void VULKAN_ReleaseWindow(
SDL_free(windowData);

SDL_ClearProperty(SDL_GetWindowProperties(window), WINDOW_PROPERTY_DATA);
SDL_DelEventWatch(VULKAN_INTERNAL_OnWindowResize, window);
SDL_RemoveEventWatch(VULKAN_INTERNAL_OnWindowResize, window);
}

static bool VULKAN_INTERNAL_RecreateSwapchain(
Expand Down
4 changes: 2 additions & 2 deletions src/hidapi/SDL_hidapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1287,8 +1287,8 @@ int SDL_hid_exit(void)
}
#endif // HAVE_LIBUSB

SDL_DelHintCallback(SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS, OnlyControllersChanged, NULL);
SDL_DelHintCallback(SDL_HINT_HIDAPI_IGNORE_DEVICES, IgnoredDevicesChanged, NULL);
SDL_RemoveHintCallback(SDL_HINT_HIDAPI_ENUMERATE_ONLY_CONTROLLERS, OnlyControllersChanged, NULL);
SDL_RemoveHintCallback(SDL_HINT_HIDAPI_IGNORE_DEVICES, IgnoredDevicesChanged, NULL);

if (SDL_hidapi_ignored_devices) {
SDL_free(SDL_hidapi_ignored_devices);
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/SDL_gamepad.c
Original file line number Diff line number Diff line change
Expand Up @@ -3680,7 +3680,7 @@ void SDL_QuitGamepads(void)

SDL_gamepads_initialized = false;

SDL_DelEventWatch(SDL_GamepadEventWatcher, NULL);
SDL_RemoveEventWatch(SDL_GamepadEventWatcher, NULL);

while (SDL_gamepads) {
SDL_gamepads->ref_count = 1;
Expand Down
6 changes: 3 additions & 3 deletions src/joystick/SDL_joystick.c
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ void SDL_QuitJoysticks(void)

SDL_QuitSteamVirtualGamepadInfo();

SDL_DelHintCallback(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
SDL_JoystickAllowBackgroundEventsChanged, NULL);

SDL_FreeVIDPIDList(&arcadestick_devices);
Expand Down Expand Up @@ -3795,11 +3795,11 @@ bool SDL_VIDPIDInList(Uint16 vendor_id, Uint16 product_id, const SDL_vidpid_list
void SDL_FreeVIDPIDList(SDL_vidpid_list *list)
{
if (list->included_hint_name) {
SDL_DelHintCallback(list->included_hint_name, SDL_VIDPIDIncludedHintChanged, list);
SDL_RemoveHintCallback(list->included_hint_name, SDL_VIDPIDIncludedHintChanged, list);
}

if (list->excluded_hint_name) {
SDL_DelHintCallback(list->excluded_hint_name, SDL_VIDPIDExcludedHintChanged, list);
SDL_RemoveHintCallback(list->excluded_hint_name, SDL_VIDPIDExcludedHintChanged, list);
}

if (list->included_entries) {
Expand Down
2 changes: 1 addition & 1 deletion src/joystick/apple/SDL_mfijoystick.m
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,7 @@ static void IOS_JoystickQuit(void)
}

#ifdef SDL_PLATFORM_TVOS
SDL_DelHintCallback(SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION,
SDL_RemoveHintCallback(SDL_HINT_APPLE_TV_REMOTE_ALLOW_ROTATION,
SDL_AppleTVRemoteRotationHintChanged, NULL);
#endif // SDL_PLATFORM_TVOS
#endif // SDL_JOYSTICK_MFI
Expand Down
4 changes: 2 additions & 2 deletions src/joystick/hidapi/SDL_hidapi_gamecube.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static void HIDAPI_DriverGameCube_RegisterHints(SDL_HintCallback callback, void

static void HIDAPI_DriverGameCube_UnregisterHints(SDL_HintCallback callback, void *userdata)
{
SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE, callback, userdata);
SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE, callback, userdata);
}

static bool HIDAPI_DriverGameCube_IsEnabled(void)
Expand Down Expand Up @@ -503,7 +503,7 @@ static void HIDAPI_DriverGameCube_FreeDevice(SDL_HIDAPI_Device *device)
{
SDL_DriverGameCube_Context *ctx = (SDL_DriverGameCube_Context *)device->context;

SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE,
SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_GAMECUBE_RUMBLE_BRAKE,
SDL_JoystickGameCubeRumbleBrakeHintChanged, ctx);
}

Expand Down
2 changes: 1 addition & 1 deletion src/joystick/hidapi/SDL_hidapi_luna.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static void HIDAPI_DriverLuna_RegisterHints(SDL_HintCallback callback, void *use

static void HIDAPI_DriverLuna_UnregisterHints(SDL_HintCallback callback, void *userdata)
{
SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_LUNA, callback, userdata);
SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_LUNA, callback, userdata);
}

static bool HIDAPI_DriverLuna_IsEnabled(void)
Expand Down
4 changes: 2 additions & 2 deletions src/joystick/hidapi/SDL_hidapi_ps3.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static void HIDAPI_DriverPS3_RegisterHints(SDL_HintCallback callback, void *user

static void HIDAPI_DriverPS3_UnregisterHints(SDL_HintCallback callback, void *userdata)
{
SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS3, callback, userdata);
SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS3, callback, userdata);
}

static bool HIDAPI_DriverPS3_IsEnabled(void)
Expand Down Expand Up @@ -1059,7 +1059,7 @@ static void HIDAPI_DriverPS3SonySixaxis_RegisterHints(SDL_HintCallback callback,

static void HIDAPI_DriverPS3SonySixaxis_UnregisterHints(SDL_HintCallback callback, void *userdata)
{
SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS3_SIXAXIS_DRIVER, callback, userdata);
SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS3_SIXAXIS_DRIVER, callback, userdata);
}

static bool HIDAPI_DriverPS3SonySixaxis_IsEnabled(void)
Expand Down
6 changes: 3 additions & 3 deletions src/joystick/hidapi/SDL_hidapi_ps4.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ static void HIDAPI_DriverPS4_RegisterHints(SDL_HintCallback callback, void *user

static void HIDAPI_DriverPS4_UnregisterHints(SDL_HintCallback callback, void *userdata)
{
SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS4, callback, userdata);
SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS4, callback, userdata);
}

static bool HIDAPI_DriverPS4_IsEnabled(void)
Expand Down Expand Up @@ -1350,9 +1350,9 @@ static void HIDAPI_DriverPS4_CloseJoystick(SDL_HIDAPI_Device *device, SDL_Joysti
{
SDL_DriverPS4_Context *ctx = (SDL_DriverPS4_Context *)device->context;

SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL,
SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS4_REPORT_INTERVAL,
SDL_PS4ReportIntervalHintChanged, ctx);
SDL_DelHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE,
SDL_RemoveHintCallback(SDL_HINT_JOYSTICK_HIDAPI_PS4_RUMBLE,
SDL_PS4RumbleHintChanged, ctx);

ctx->joystick = NULL;
Expand Down
Loading

0 comments on commit f827c13

Please sign in to comment.