Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Emscripten: Changed return -1 after SDL_SetError() to return SDL_SetE…
…rror().
  • Loading branch information
philippwiesemann committed Aug 9, 2015
1 parent c67213f commit 3362c9f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/joystick/emscripten/SDL_sysjoystick.c
Expand Up @@ -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 */
Expand All @@ -222,17 +221,15 @@ 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,
0,
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;
Expand Down

0 comments on commit 3362c9f

Please sign in to comment.