Changed return -1 after SDL_SetError() to return SDL_SetError().
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Wed, 25 Dec 2013 17:02:15 +0100
changeset 8081 402b8c313246
parent 8080 bf767de0bcdc
child 8082 5b83ad3f01ac
Changed return -1 after SDL_SetError() to return SDL_SetError().
src/joystick/SDL_gamecontroller.c
--- a/src/joystick/SDL_gamecontroller.c	Wed Dec 25 16:57:59 2013 +0100
+++ b/src/joystick/SDL_gamecontroller.c	Wed Dec 25 17:02:15 2013 +0100
@@ -743,8 +743,7 @@
 
     pchGUID = SDL_PrivateGetControllerGUIDFromMappingString( mappingString );
     if (!pchGUID) {
-        SDL_SetError("Couldn't parse GUID from %s", mappingString);
-        return -1;
+        return SDL_SetError("Couldn't parse GUID from %s", mappingString);
     }
 #ifdef SDL_JOYSTICK_DINPUT
     if ( !SDL_strcasecmp( pchGUID, "xinput" ) ) {
@@ -756,15 +755,13 @@
 
     pchName = SDL_PrivateGetControllerNameFromMappingString( mappingString );
     if (!pchName) {
-        SDL_SetError("Couldn't parse name from %s", mappingString);
-        return -1;
+        return SDL_SetError("Couldn't parse name from %s", mappingString);
     }
 
     pchMapping = SDL_PrivateGetControllerMappingFromMappingString( mappingString );
     if (!pchMapping) {
-        SDL_SetError("Couldn't parse %s", mappingString);
         SDL_free( pchName );
-        return -1;
+        return SDL_SetError("Couldn't parse %s", mappingString);
     }
 
     pControllerMapping = SDL_PrivateGetControllerMappingForGUID(&jGUID);