From 75dead7f96a3331e620d2a74ce6e3a99b6f9b342 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Tue, 17 Mar 2026 09:49:15 -0700
Subject: [PATCH] Minor cleanup
---
src/joystick/SDL_joystick.c | 35 ++++++++++++++++++-----------------
src/joystick/SDL_joystick_c.h | 6 ------
2 files changed, 18 insertions(+), 23 deletions(-)
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index 88af27c3d7b7c..dde9927008272 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -3425,16 +3425,6 @@ bool SDL_IsJoystickVIRTUAL(SDL_GUID guid)
return (guid.data[14] == 'v') ? true : false;
}
-bool SDL_IsJoystickDrumKit(Uint16 vendor_id, Uint16 product_id)
-{
- return SDL_VIDPIDInList(vendor_id, product_id, &drum_devices);
-}
-
-bool SDL_IsJoystickGuitar(Uint16 vendor_id, Uint16 product_id)
-{
- return SDL_VIDPIDInList(vendor_id, product_id, &guitar_devices);
-}
-
bool SDL_IsJoystickWheel(Uint16 vendor_id, Uint16 product_id)
{
return SDL_VIDPIDInList(vendor_id, product_id, &wheel_devices);
@@ -3455,6 +3445,16 @@ static bool SDL_IsJoystickThrottle(Uint16 vendor_id, Uint16 product_id)
return SDL_VIDPIDInList(vendor_id, product_id, &throttle_devices);
}
+static bool SDL_IsJoystickGuitar(Uint16 vendor_id, Uint16 product_id)
+{
+ return SDL_VIDPIDInList(vendor_id, product_id, &guitar_devices);
+}
+
+static bool SDL_IsJoystickDrumKit(Uint16 vendor_id, Uint16 product_id)
+{
+ return SDL_VIDPIDInList(vendor_id, product_id, &drum_devices);
+}
+
static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_GUID guid)
{
Uint16 vendor;
@@ -3462,13 +3462,6 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_GUID guid)
SDL_GetJoystickGUIDInfo(guid, &vendor, &product, NULL, NULL);
- if (SDL_IsJoystickDrumKit(vendor, product)) {
- return SDL_JOYSTICK_TYPE_DRUM_KIT;
- }
- if (SDL_IsJoystickGuitar(vendor, product)) {
- return SDL_JOYSTICK_TYPE_GUITAR;
- }
-
if (SDL_IsJoystickWheel(vendor, product)) {
return SDL_JOYSTICK_TYPE_WHEEL;
}
@@ -3485,6 +3478,14 @@ static SDL_JoystickType SDL_GetJoystickGUIDType(SDL_GUID guid)
return SDL_JOYSTICK_TYPE_THROTTLE;
}
+ if (SDL_IsJoystickGuitar(vendor, product)) {
+ return SDL_JOYSTICK_TYPE_GUITAR;
+ }
+
+ if (SDL_IsJoystickDrumKit(vendor, product)) {
+ return SDL_JOYSTICK_TYPE_DRUM_KIT;
+ }
+
if (SDL_IsJoystickXInput(guid)) {
// XInput GUID, get the type based on the XInput device subtype
switch (guid.data[15]) {
diff --git a/src/joystick/SDL_joystick_c.h b/src/joystick/SDL_joystick_c.h
index 7d701680a9ca0..46acbc5ca823a 100644
--- a/src/joystick/SDL_joystick_c.h
+++ b/src/joystick/SDL_joystick_c.h
@@ -174,12 +174,6 @@ extern bool SDL_IsJoystickVIRTUAL(SDL_GUID guid);
// Function to return whether a joystick is a wheel
extern bool SDL_IsJoystickWheel(Uint16 vendor_id, Uint16 product_id);
-// Function to return whether a joystick is a guitar
-extern bool SDL_IsJoystickGuitar(Uint16 vendor_id, Uint16 product_id);
-
-// Function to return whether a joystick is a drum kit
-extern bool SDL_IsJoystickDrumKit(Uint16 vendor_id, Uint16 product_id);
-
// Function to return whether a joystick should be ignored
extern bool SDL_ShouldIgnoreJoystick(Uint16 vendor_id, Uint16 product_id, Uint16 version, const char *name);