Fixed C variable declarations

This commit is contained in:
Sam Lantinga 2013-02-11 18:13:52 -08:00
parent a4a01c70db
commit 57163e457f

View file

@ -129,9 +129,11 @@ int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
{ {
case SDL_JOYAXISMOTION: case SDL_JOYAXISMOTION:
{ {
SDL_GameController *controllerlist;
if ( event->jaxis.axis >= k_nMaxReverseEntries ) break; if ( event->jaxis.axis >= k_nMaxReverseEntries ) break;
SDL_GameController *controllerlist = SDL_gamecontrollers; controllerlist = SDL_gamecontrollers;
while ( controllerlist ) while ( controllerlist )
{ {
if ( controllerlist->joystick->instance_id == event->jaxis.which ) if ( controllerlist->joystick->instance_id == event->jaxis.which )
@ -153,9 +155,11 @@ int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
case SDL_JOYBUTTONDOWN: case SDL_JOYBUTTONDOWN:
case SDL_JOYBUTTONUP: case SDL_JOYBUTTONUP:
{ {
SDL_GameController *controllerlist;
if ( event->jbutton.button >= k_nMaxReverseEntries ) break; if ( event->jbutton.button >= k_nMaxReverseEntries ) break;
SDL_GameController *controllerlist = SDL_gamecontrollers; controllerlist = SDL_gamecontrollers;
while ( controllerlist ) while ( controllerlist )
{ {
if ( controllerlist->joystick->instance_id == event->jbutton.which ) if ( controllerlist->joystick->instance_id == event->jbutton.which )
@ -176,9 +180,11 @@ int SDL_GameControllerEventWatcher(void *userdata, SDL_Event * event)
break; break;
case SDL_JOYHATMOTION: case SDL_JOYHATMOTION:
{ {
SDL_GameController *controllerlist;
if ( event->jhat.hat >= 4 ) break; if ( event->jhat.hat >= 4 ) break;
SDL_GameController *controllerlist = SDL_gamecontrollers; controllerlist = SDL_gamecontrollers;
while ( controllerlist ) while ( controllerlist )
{ {
if ( controllerlist->joystick->instance_id == event->jhat.which ) if ( controllerlist->joystick->instance_id == event->jhat.which )