From 8cd08646bba0d8833e5cf6c0bbd8e28b8d1af8de Mon Sep 17 00:00:00 2001 From: David Ludwig Date: Mon, 16 Mar 2020 17:19:18 -0400 Subject: [PATCH] virtual joysticks: move variable decls to top of function (for C90 compat; Bug 5038) --- src/joystick/virtual/SDL_virtualjoystick.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/joystick/virtual/SDL_virtualjoystick.c b/src/joystick/virtual/SDL_virtualjoystick.c index 57bb21694..623ed1c97 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]); } }