Fixed C variable declarations
authorSam Lantinga <slouken@libsdl.org>
Mon, 11 Feb 2013 18:13:52 -0800
changeset 6850ad3416a14319
parent 6849 b9dcf6242476
child 6851 a58fc7ff4a0f
Fixed C variable declarations
src/joystick/SDL_gamecontroller.c
     1.1 --- a/src/joystick/SDL_gamecontroller.c	Mon Feb 11 17:40:09 2013 -0800
     1.2 +++ b/src/joystick/SDL_gamecontroller.c	Mon Feb 11 18:13:52 2013 -0800
     1.3 @@ -129,9 +129,11 @@
     1.4  	{
     1.5  	case SDL_JOYAXISMOTION:
     1.6  		{
     1.7 +			SDL_GameController *controllerlist;
     1.8 +
     1.9  			if ( event->jaxis.axis >= k_nMaxReverseEntries ) break;
    1.10  
    1.11 -			SDL_GameController *controllerlist = SDL_gamecontrollers;
    1.12 +			controllerlist = SDL_gamecontrollers;
    1.13  			while ( controllerlist )
    1.14  			{
    1.15  				if ( controllerlist->joystick->instance_id == event->jaxis.which )
    1.16 @@ -153,9 +155,11 @@
    1.17  	case SDL_JOYBUTTONDOWN:
    1.18  	case SDL_JOYBUTTONUP:
    1.19  		{
    1.20 +			SDL_GameController *controllerlist;
    1.21 +
    1.22  			if ( event->jbutton.button >= k_nMaxReverseEntries ) break;
    1.23  
    1.24 -			SDL_GameController *controllerlist = SDL_gamecontrollers;
    1.25 +			controllerlist = SDL_gamecontrollers;
    1.26  			while ( controllerlist )
    1.27  			{
    1.28  				if ( controllerlist->joystick->instance_id == event->jbutton.which )
    1.29 @@ -176,9 +180,11 @@
    1.30  		break;
    1.31  	case SDL_JOYHATMOTION:
    1.32  		{
    1.33 +			SDL_GameController *controllerlist;
    1.34 +
    1.35  			if ( event->jhat.hat >= 4 ) break;
    1.36  
    1.37 -			SDL_GameController *controllerlist = SDL_gamecontrollers;
    1.38 +			controllerlist = SDL_gamecontrollers;
    1.39  			while ( controllerlist )
    1.40  			{
    1.41  				if ( controllerlist->joystick->instance_id == event->jhat.which )