Commit 8cd08646bba0d8833e5cf6c0bbd8e28b8d1af8de

David Ludwig 2020-03-16T17:19:18

virtual joysticks: move variable decls to top of function (for C90 compat; Bug 5038)

diff --git a/src/joystick/virtual/SDL_virtualjoystick.c b/src/joystick/virtual/SDL_virtualjoystick.c
index 57bb216..623ed1c 100644
--- a/src/joystick/virtual/SDL_virtualjoystick.c
+++ b/src/joystick/virtual/SDL_virtualjoystick.c
@@ -343,6 +343,7 @@ static void
 VIRTUAL_JoystickUpdate(SDL_Joystick * joystick)
 {
     joystick_hwdata *hwdata;
+    int i;
 
     if (!joystick) {
         return;
@@ -353,13 +354,13 @@ VIRTUAL_JoystickUpdate(SDL_Joystick * joystick)
 
     hwdata = (joystick_hwdata *)joystick->hwdata;
 
-    for (int i = 0; i < hwdata->naxes; ++i) {
+    for (i = 0; i < hwdata->naxes; ++i) {
         SDL_PrivateJoystickAxis(joystick, i, hwdata->axes[i]);
     }
-    for (int i = 0; i < hwdata->nbuttons; ++i) {
+    for (i = 0; i < hwdata->nbuttons; ++i) {
         SDL_PrivateJoystickButton(joystick, i, hwdata->buttons[i]);
     }
-    for (int i = 0; i < hwdata->nhats; ++i) {
+    for (i = 0; i < hwdata->nhats; ++i) {
         SDL_PrivateJoystickHat(joystick, i, hwdata->hats[i]);
     }
 }