Fixed compiler warning (and undefined behavior) in game controller event filter.
authorSam Lantinga <slouken@libsdl.org>
Mon, 11 Feb 2013 17:25:58 -0800
changeset 6847 c0fa29d3fade
parent 6846 97eb26e2dee0
child 6848 478ecc8a58b3
Fixed compiler warning (and undefined behavior) in game controller event filter.
src/joystick/SDL_gamecontroller.c
--- a/src/joystick/SDL_gamecontroller.c	Mon Feb 11 17:02:13 2013 -0800
+++ b/src/joystick/SDL_gamecontroller.c	Mon Feb 11 17:25:58 2013 -0800
@@ -1065,7 +1065,8 @@
 int
 SDL_PrivateGameControllerButton(SDL_GameController * gamecontroller, SDL_CONTROLLER_BUTTON button, Uint8 state)
 {
-    if ( button == SDL_CONTROLLER_BUTTON_INVALID ) return;
+    if ( button == SDL_CONTROLLER_BUTTON_INVALID )
+        return (0);
 
     int posted;
 #if !SDL_EVENTS_DISABLED