Emscripten: Changed return -1 after SDL_SetError() to return SDL_SetError().

This commit is contained in:
Philipp Wiesemann 2015-08-09 20:00:51 +02:00
parent c67213f331
commit 3362c9f196

View File

@ -200,8 +200,7 @@ SDL_SYS_JoystickInit(void)
/* Check if gamepad is supported by browser */ /* Check if gamepad is supported by browser */
if (numjs == EMSCRIPTEN_RESULT_NOT_SUPPORTED) { if (numjs == EMSCRIPTEN_RESULT_NOT_SUPPORTED) {
SDL_SetError("Gamepads not supported"); return SDL_SetError("Gamepads not supported");
return -1;
} }
/* handle already connected gamepads */ /* handle already connected gamepads */
@ -222,8 +221,7 @@ SDL_SYS_JoystickInit(void)
if(retval != EMSCRIPTEN_RESULT_SUCCESS) { if(retval != EMSCRIPTEN_RESULT_SUCCESS) {
SDL_SYS_JoystickQuit(); SDL_SYS_JoystickQuit();
SDL_SetError("Could not set gamepad connect callback"); return SDL_SetError("Could not set gamepad connect callback");
return -1;
} }
retval = emscripten_set_gamepaddisconnected_callback(NULL, retval = emscripten_set_gamepaddisconnected_callback(NULL,
@ -231,8 +229,7 @@ SDL_SYS_JoystickInit(void)
Emscripten_JoyStickDisconnected); Emscripten_JoyStickDisconnected);
if(retval != EMSCRIPTEN_RESULT_SUCCESS) { if(retval != EMSCRIPTEN_RESULT_SUCCESS) {
SDL_SYS_JoystickQuit(); SDL_SYS_JoystickQuit();
SDL_SetError("Could not set gamepad disconnect callback"); return SDL_SetError("Could not set gamepad disconnect callback");
return -1;
} }
return 0; return 0;