diff --git a/src/null_joystick.c b/src/null_joystick.c index 2311d91f7..afd65e15d 100644 --- a/src/null_joystick.c +++ b/src/null_joystick.c @@ -31,7 +31,7 @@ ////// GLFW platform API ////// ////////////////////////////////////////////////////////////////////////// -int _glfwPlatformPollJoystick(int jid, int mode) +int _glfwPlatformPollJoystick(_GLFWjoystick* js, int mode) { return GLFW_FALSE; } diff --git a/src/win32_joystick.c b/src/win32_joystick.c index 759d1d44a..d6bd6c5d4 100644 --- a/src/win32_joystick.c +++ b/src/win32_joystick.c @@ -576,11 +576,14 @@ void _glfwDetectJoystickConnectionWin32(void) void _glfwDetectJoystickDisconnectionWin32(void) { int jid; + _GLFWjoystick* js; for (jid = 0; jid <= GLFW_JOYSTICK_LAST; jid++) { - if (_glfw.joysticks[jid].present) - _glfwPlatformPollJoystick(jid, _GLFW_POLL_PRESENCE); + js = &_glfw.joysticks[jid]; + + if (js->present) + _glfwPlatformPollJoystick(js, _GLFW_POLL_PRESENCE); } }