From a6da2fbf73c845943e31887020d0b74493832e30 Mon Sep 17 00:00:00 2001 From: Dimitriy Ryazantcev Date: Tue, 25 May 2021 12:33:23 +0300 Subject: [PATCH] Rename haptic methods to avoid confusion with joystick: `SDL_DINPUT_MaybeAddDevice`->`SDL_DINPUT_HapticMaybeAddDevice` `SDL_DINPUT_MaybeRemoveDevice`->`SDL_DINPUT_HapticMaybeRemoveDevice` `SDL_XINPUT_MaybeAddDevice`->`SDL_XINPUT_HapticMaybeAddDevice` `SDL_XINPUT_MaybeRemoveDevice`->`SDL_XINPUT_HapticMaybeRemoveDevice` --- src/haptic/windows/SDL_dinputhaptic.c | 10 +++++----- src/haptic/windows/SDL_dinputhaptic_c.h | 4 ++-- src/haptic/windows/SDL_xinputhaptic.c | 10 +++++----- src/haptic/windows/SDL_xinputhaptic_c.h | 4 ++-- src/joystick/windows/SDL_windowsjoystick.c | 8 ++++---- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/haptic/windows/SDL_dinputhaptic.c b/src/haptic/windows/SDL_dinputhaptic.c index 7f3080271..523793ebe 100644 --- a/src/haptic/windows/SDL_dinputhaptic.c +++ b/src/haptic/windows/SDL_dinputhaptic.c @@ -61,7 +61,7 @@ static BOOL CALLBACK EnumHapticsCallback(const DIDEVICEINSTANCE * pdidInstance, VOID * pContext) { (void) pContext; - SDL_DINPUT_MaybeAddDevice(pdidInstance); + SDL_DINPUT_HapticMaybeAddDevice(pdidInstance); return DIENUM_CONTINUE; /* continue enumerating */ } @@ -117,7 +117,7 @@ SDL_DINPUT_HapticInit(void) } int -SDL_DINPUT_MaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) +SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) { HRESULT ret; LPDIRECTINPUTDEVICE8 device; @@ -176,7 +176,7 @@ SDL_DINPUT_MaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) } int -SDL_DINPUT_MaybeRemoveDevice(const DIDEVICEINSTANCE * pdidInstance) +SDL_DINPUT_HapticMaybeRemoveDevice(const DIDEVICEINSTANCE * pdidInstance) { SDL_hapticlist_item *item; SDL_hapticlist_item *prev = NULL; @@ -1188,13 +1188,13 @@ SDL_DINPUT_HapticInit(void) } int -SDL_DINPUT_MaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) +SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE * pdidInstance) { return SDL_Unsupported(); } int -SDL_DINPUT_MaybeRemoveDevice(const DIDEVICEINSTANCE * pdidInstance) +SDL_DINPUT_HapticMaybeRemoveDevice(const DIDEVICEINSTANCE * pdidInstance) { return SDL_Unsupported(); } diff --git a/src/haptic/windows/SDL_dinputhaptic_c.h b/src/haptic/windows/SDL_dinputhaptic_c.h index 3766ff7f3..2056ad85d 100644 --- a/src/haptic/windows/SDL_dinputhaptic_c.h +++ b/src/haptic/windows/SDL_dinputhaptic_c.h @@ -25,8 +25,8 @@ extern int SDL_DINPUT_HapticInit(void); -extern int SDL_DINPUT_MaybeAddDevice(const DIDEVICEINSTANCE *pdidInstance); -extern int SDL_DINPUT_MaybeRemoveDevice(const DIDEVICEINSTANCE *pdidInstance); +extern int SDL_DINPUT_HapticMaybeAddDevice(const DIDEVICEINSTANCE *pdidInstance); +extern int SDL_DINPUT_HapticMaybeRemoveDevice(const DIDEVICEINSTANCE *pdidInstance); extern int SDL_DINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item); extern int SDL_DINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick); extern int SDL_DINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick); diff --git a/src/haptic/windows/SDL_xinputhaptic.c b/src/haptic/windows/SDL_xinputhaptic.c index 79b4b4cf7..9ee2d82d6 100644 --- a/src/haptic/windows/SDL_xinputhaptic.c +++ b/src/haptic/windows/SDL_xinputhaptic.c @@ -50,14 +50,14 @@ SDL_XINPUT_HapticInit(void) if (loaded_xinput) { DWORD i; for (i = 0; i < XUSER_MAX_COUNT; i++) { - SDL_XINPUT_MaybeAddDevice(i); + SDL_XINPUT_HapticMaybeAddDevice(i); } } return 0; } int -SDL_XINPUT_MaybeAddDevice(const DWORD dwUserid) +SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid) { const Uint8 userid = (Uint8)dwUserid; SDL_hapticlist_item *item; @@ -106,7 +106,7 @@ SDL_XINPUT_MaybeAddDevice(const DWORD dwUserid) } int -SDL_XINPUT_MaybeRemoveDevice(const DWORD dwUserid) +SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid) { const Uint8 userid = (Uint8)dwUserid; SDL_hapticlist_item *item; @@ -377,13 +377,13 @@ SDL_XINPUT_HapticInit(void) } int -SDL_XINPUT_MaybeAddDevice(const DWORD dwUserid) +SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid) { return SDL_Unsupported(); } int -SDL_XINPUT_MaybeRemoveDevice(const DWORD dwUserid) +SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid) { return SDL_Unsupported(); } diff --git a/src/haptic/windows/SDL_xinputhaptic_c.h b/src/haptic/windows/SDL_xinputhaptic_c.h index 98e9e4344..83686efd0 100644 --- a/src/haptic/windows/SDL_xinputhaptic_c.h +++ b/src/haptic/windows/SDL_xinputhaptic_c.h @@ -25,8 +25,8 @@ extern int SDL_XINPUT_HapticInit(void); -extern int SDL_XINPUT_MaybeAddDevice(const DWORD dwUserid); -extern int SDL_XINPUT_MaybeRemoveDevice(const DWORD dwUserid); +extern int SDL_XINPUT_HapticMaybeAddDevice(const DWORD dwUserid); +extern int SDL_XINPUT_HapticMaybeRemoveDevice(const DWORD dwUserid); extern int SDL_XINPUT_HapticOpen(SDL_Haptic * haptic, SDL_hapticlist_item *item); extern int SDL_XINPUT_JoystickSameHaptic(SDL_Haptic * haptic, SDL_Joystick * joystick); extern int SDL_XINPUT_HapticOpenFromJoystick(SDL_Haptic * haptic, SDL_Joystick * joystick); diff --git a/src/joystick/windows/SDL_windowsjoystick.c b/src/joystick/windows/SDL_windowsjoystick.c index c2eebeef3..7a2310a5a 100644 --- a/src/joystick/windows/SDL_windowsjoystick.c +++ b/src/joystick/windows/SDL_windowsjoystick.c @@ -429,11 +429,11 @@ WINDOWS_JoystickDetect(void) if (pCurList->bXInputDevice) { #if SDL_HAPTIC_XINPUT - SDL_XINPUT_MaybeRemoveDevice(pCurList->XInputUserId); + SDL_XINPUT_HapticMaybeRemoveDevice(pCurList->XInputUserId); #endif } else { #if SDL_HAPTIC_DINPUT - SDL_DINPUT_MaybeRemoveDevice(&pCurList->dxdevice); + SDL_DINPUT_HapticMaybeRemoveDevice(&pCurList->dxdevice); #endif } @@ -449,11 +449,11 @@ WINDOWS_JoystickDetect(void) if (pCurList->send_add_event) { if (pCurList->bXInputDevice) { #if SDL_HAPTIC_XINPUT - SDL_XINPUT_MaybeAddDevice(pCurList->XInputUserId); + SDL_XINPUT_HapticMaybeAddDevice(pCurList->XInputUserId); #endif } else { #if SDL_HAPTIC_DINPUT - SDL_DINPUT_MaybeAddDevice(&pCurList->dxdevice); + SDL_DINPUT_HapticMaybeAddDevice(&pCurList->dxdevice); #endif }