Emscripten: Changed return -1 after SDL_SetError() to return SDL_SetError().
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Sun, 09 Aug 2015 20:00:51 +0200
changeset 9835 5b266c6b0ac6
parent 9834 d3fa6d0d3793
child 9836 3d43bb56c5d6
Emscripten: Changed return -1 after SDL_SetError() to return SDL_SetError().
src/joystick/emscripten/SDL_sysjoystick.c
--- a/src/joystick/emscripten/SDL_sysjoystick.c	Fri Aug 07 01:02:35 2015 -0400
+++ b/src/joystick/emscripten/SDL_sysjoystick.c	Sun Aug 09 20:00:51 2015 +0200
@@ -200,8 +200,7 @@
 
     /* Check if gamepad is supported by browser */
     if (numjs == EMSCRIPTEN_RESULT_NOT_SUPPORTED) {
-        SDL_SetError("Gamepads not supported");
-        return -1;
+        return SDL_SetError("Gamepads not supported");
     }
 
     /* handle already connected gamepads */
@@ -222,8 +221,7 @@
 
     if(retval != EMSCRIPTEN_RESULT_SUCCESS) {
         SDL_SYS_JoystickQuit();
-        SDL_SetError("Could not set gamepad connect callback");
-        return -1;
+        return SDL_SetError("Could not set gamepad connect callback");
     }
 
     retval = emscripten_set_gamepaddisconnected_callback(NULL,
@@ -231,8 +229,7 @@
                                                          Emscripten_JoyStickDisconnected);
     if(retval != EMSCRIPTEN_RESULT_SUCCESS) {
         SDL_SYS_JoystickQuit();
-        SDL_SetError("Could not set gamepad disconnect callback");
-        return -1;
+        return SDL_SetError("Could not set gamepad disconnect callback");
     }
 
     return 0;