Commit a6da2fbf73c845943e31887020d0b74493832e30

Dimitriy Ryazantcev 2021-05-25T12:33:23

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`

diff --git a/src/haptic/windows/SDL_dinputhaptic.c b/src/haptic/windows/SDL_dinputhaptic.c
index 7f30802..523793e 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 3766ff7..2056ad8 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 79b4b4c..9ee2d82 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 98e9e43..83686ef 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 c2eebee..7a2310a 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
             }