From 3362c9f196667de1224c64facd97e83c4311d8f6 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Sun, 9 Aug 2015 20:00:51 +0200 Subject: [PATCH] Emscripten: Changed return -1 after SDL_SetError() to return SDL_SetError(). --- src/joystick/emscripten/SDL_sysjoystick.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/joystick/emscripten/SDL_sysjoystick.c b/src/joystick/emscripten/SDL_sysjoystick.c index df963e5d4..92b937155 100644 --- a/src/joystick/emscripten/SDL_sysjoystick.c +++ b/src/joystick/emscripten/SDL_sysjoystick.c @@ -200,8 +200,7 @@ SDL_SYS_JoystickInit(void) /* 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 @@ SDL_SYS_JoystickInit(void) 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 @@ SDL_SYS_JoystickInit(void) 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;