virtual joysticks: move variable decls to top of function (for C90 compat; Bug 5038)
authorDavid Ludwig <dludwig@pobox.com>
Mon, 16 Mar 2020 17:19:18 -0400
changeset 1363640c8eec2d15c
parent 13635 701fe6486077
child 13637 118aed2f33e6
virtual joysticks: move variable decls to top of function (for C90 compat; Bug 5038)
src/joystick/virtual/SDL_virtualjoystick.c
     1.1 --- a/src/joystick/virtual/SDL_virtualjoystick.c	Mon Mar 16 13:28:38 2020 -0700
     1.2 +++ b/src/joystick/virtual/SDL_virtualjoystick.c	Mon Mar 16 17:19:18 2020 -0400
     1.3 @@ -343,6 +343,7 @@
     1.4  VIRTUAL_JoystickUpdate(SDL_Joystick * joystick)
     1.5  {
     1.6      joystick_hwdata *hwdata;
     1.7 +    int i;
     1.8  
     1.9      if (!joystick) {
    1.10          return;
    1.11 @@ -353,13 +354,13 @@
    1.12  
    1.13      hwdata = (joystick_hwdata *)joystick->hwdata;
    1.14  
    1.15 -    for (int i = 0; i < hwdata->naxes; ++i) {
    1.16 +    for (i = 0; i < hwdata->naxes; ++i) {
    1.17          SDL_PrivateJoystickAxis(joystick, i, hwdata->axes[i]);
    1.18      }
    1.19 -    for (int i = 0; i < hwdata->nbuttons; ++i) {
    1.20 +    for (i = 0; i < hwdata->nbuttons; ++i) {
    1.21          SDL_PrivateJoystickButton(joystick, i, hwdata->buttons[i]);
    1.22      }
    1.23 -    for (int i = 0; i < hwdata->nhats; ++i) {
    1.24 +    for (i = 0; i < hwdata->nhats; ++i) {
    1.25          SDL_PrivateJoystickHat(joystick, i, hwdata->hats[i]);
    1.26      }
    1.27  }