SDL_PrivateJoystickForceRecentering: fix wrong loop counter usage. The typo seems to have been added by commit c7782fd6142b
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
diff --git a/src/joystick/SDL_joystick.c b/src/joystick/SDL_joystick.c
index ee54930..465a38d 100644
--- a/src/joystick/SDL_joystick.c
+++ b/src/joystick/SDL_joystick.c
@@ -469,24 +469,17 @@ SDL_JoystickOpen(int device_index)
return joystick;
}
-
int
SDL_JoystickAttachVirtual(SDL_JoystickType type,
- int naxes,
- int nbuttons,
- int nhats)
+ int naxes, int nbuttons, int nhats)
{
#if SDL_JOYSTICK_VIRTUAL
- return SDL_JoystickAttachVirtualInner(type,
- naxes,
- nbuttons,
- nhats);
+ return SDL_JoystickAttachVirtualInner(type, naxes, nbuttons, nhats);
#else
return SDL_SetError("SDL not built with virtual-joystick support");
#endif
}
-
int
SDL_JoystickDetachVirtual(int device_index)
{
@@ -509,7 +502,6 @@ SDL_JoystickDetachVirtual(int device_index)
#endif
}
-
SDL_bool
SDL_JoystickIsVirtual(int device_index)
{
@@ -532,7 +524,6 @@ SDL_JoystickIsVirtual(int device_index)
#endif
}
-
int
SDL_JoystickSetVirtualAxis(SDL_Joystick * joystick, int axis, Sint16 value)
{
@@ -543,7 +534,6 @@ SDL_JoystickSetVirtualAxis(SDL_Joystick * joystick, int axis, Sint16 value)
#endif
}
-
int
SDL_JoystickSetVirtualButton(SDL_Joystick * joystick, int button, Uint8 value)
{
@@ -554,7 +544,6 @@ SDL_JoystickSetVirtualButton(SDL_Joystick * joystick, int button, Uint8 value)
#endif
}
-
int
SDL_JoystickSetVirtualHat(SDL_Joystick * joystick, int hat, Uint8 value)
{
@@ -565,7 +554,6 @@ SDL_JoystickSetVirtualHat(SDL_Joystick * joystick, int hat, Uint8 value)
#endif
}
-
/*
* Checks to make sure the joystick is valid.
*/
@@ -1226,7 +1214,7 @@ SDL_PrivateJoystickForceRecentering(SDL_Joystick *joystick)
}
for (i = 0; i < joystick->ntouchpads; i++) {
- SDL_JoystickTouchpadInfo *touchpad = &joystick->touchpads[j];
+ SDL_JoystickTouchpadInfo *touchpad = &joystick->touchpads[i];
for (j = 0; j < touchpad->nfingers; ++j) {
SDL_PrivateJoystickTouchpad(joystick, i, j, SDL_RELEASED, 0.0f, 0.0f, 0.0f);