瀏覽代碼

Fix warning

Camilla Löwy 8 年之前
父節點
當前提交
472e5fc4a9
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/input.c

+ 3 - 1
src/input.c

@@ -258,8 +258,10 @@ void _glfwInputDrop(_GLFWwindow* window, int count, const char** paths)
 
 
 void _glfwInputJoystick(_GLFWjoystick* js, int event)
 void _glfwInputJoystick(_GLFWjoystick* js, int event)
 {
 {
+    const int jid = (int) (js - _glfw.joysticks);
+
     if (_glfw.callbacks.joystick)
     if (_glfw.callbacks.joystick)
-        _glfw.callbacks.joystick(js - _glfw.joysticks, event);
+        _glfw.callbacks.joystick(jid, event);
 }
 }
 
 
 void _glfwInputJoystickAxis(_GLFWjoystick* js, int axis, float value)
 void _glfwInputJoystickAxis(_GLFWjoystick* js, int axis, float value)