src/joystick/SDL_gamecontroller.c
changeset 6850 ad3416a14319
parent 6847 c0fa29d3fade
child 6854 7b1d78036e84
--- a/src/joystick/SDL_gamecontroller.c	Mon Feb 11 17:40:09 2013 -0800
+++ b/src/joystick/SDL_gamecontroller.c	Mon Feb 11 18:13:52 2013 -0800
@@ -129,9 +129,11 @@
 	{
 	case SDL_JOYAXISMOTION:
 		{
+			SDL_GameController *controllerlist;
+
 			if ( event->jaxis.axis >= k_nMaxReverseEntries ) break;
 
-			SDL_GameController *controllerlist = SDL_gamecontrollers;
+			controllerlist = SDL_gamecontrollers;
 			while ( controllerlist )
 			{
 				if ( controllerlist->joystick->instance_id == event->jaxis.which )
@@ -153,9 +155,11 @@
 	case SDL_JOYBUTTONDOWN:
 	case SDL_JOYBUTTONUP:
 		{
+			SDL_GameController *controllerlist;
+
 			if ( event->jbutton.button >= k_nMaxReverseEntries ) break;
 
-			SDL_GameController *controllerlist = SDL_gamecontrollers;
+			controllerlist = SDL_gamecontrollers;
 			while ( controllerlist )
 			{
 				if ( controllerlist->joystick->instance_id == event->jbutton.which )
@@ -176,9 +180,11 @@
 		break;
 	case SDL_JOYHATMOTION:
 		{
+			SDL_GameController *controllerlist;
+
 			if ( event->jhat.hat >= 4 ) break;
 
-			SDL_GameController *controllerlist = SDL_gamecontrollers;
+			controllerlist = SDL_gamecontrollers;
 			while ( controllerlist )
 			{
 				if ( controllerlist->joystick->instance_id == event->jhat.which )