diff --git a/src/cocoa_joystick.m b/src/cocoa_joystick.m index f10c0cdb..557108fc 100644 --- a/src/cocoa_joystick.m +++ b/src/cocoa_joystick.m @@ -274,13 +274,13 @@ static void matchCallback(void* context, _GLFWjoystickNS* js; int jid; - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (_glfw.ns_js[jid].present && _glfw.ns_js[jid].deviceRef == deviceRef) return; } - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (!_glfw.ns_js[jid].present) break; @@ -336,7 +336,7 @@ static void removeCallback(void* context, { int jid; - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (_glfw.ns_js[jid].deviceRef == deviceRef) { @@ -458,7 +458,7 @@ void _glfwTerminateJoysticksNS(void) { int jid; - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { _GLFWjoystickNS* js = _glfw.ns_js + jid; removeJoystick(js); diff --git a/src/linux_joystick.c b/src/linux_joystick.c index cb7a7d90..d4d9e1e2 100644 --- a/src/linux_joystick.c +++ b/src/linux_joystick.c @@ -53,7 +53,7 @@ static GLFWbool openJoystickDevice(const char* path) int jid, fd, version; _GLFWjoystickLinux* js; - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (!_glfw.linux_js.js[jid].present) continue; @@ -62,7 +62,7 @@ static GLFWbool openJoystickDevice(const char* path) return GLFW_FALSE; } - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (!_glfw.linux_js.js[jid].present) break; diff --git a/src/win32_joystick.c b/src/win32_joystick.c index 96f907bc..40916917 100644 --- a/src/win32_joystick.c +++ b/src/win32_joystick.c @@ -339,13 +339,13 @@ static BOOL CALLBACK deviceCallback(const DIDEVICEINSTANCE* di, void* user) _GLFWobjenumWin32 data; _GLFWjoystickWin32* js; - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (memcmp(&_glfw.win32_js[jid].guid, &di->guidInstance, sizeof(GUID)) == 0) return DIENUM_CONTINUE; } - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (!_glfw.win32_js[jid].present) break; @@ -451,7 +451,7 @@ static GLFWbool openXinputDevice(DWORD index) XINPUT_CAPABILITIES xic; _GLFWjoystickWin32* js; - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (_glfw.win32_js[jid].present && _glfw.win32_js[jid].device == NULL && @@ -461,7 +461,7 @@ static GLFWbool openXinputDevice(DWORD index) } } - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { if (!_glfw.win32_js[jid].present) break; @@ -679,7 +679,7 @@ void _glfwTerminateJoysticksWin32(void) { int jid; - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) closeJoystick(_glfw.win32_js + jid); if (_glfw.win32.dinput8.api) @@ -719,7 +719,7 @@ void _glfwDetectJoystickDisconnectionWin32(void) { int jid; - for (jid = GLFW_JOYSTICK_1; jid <= GLFW_JOYSTICK_LAST; jid++) + for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) pollJoystickState(_glfw.win32_js + jid, _GLFW_PRESENCE_ONLY); }