From 2a38bca9312cfbfcd2a36409c48263ecf3cb643d Mon Sep 17 00:00:00 2001 From: Pan7 Date: Fri, 24 Jul 2015 22:56:00 +0200 Subject: [PATCH] SDL_Init zero check --- code/sdl/sdl_glimp.c | 2 +- code/sdl/sdl_input.c | 2 +- code/sdl/sdl_snd.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/code/sdl/sdl_glimp.c b/code/sdl/sdl_glimp.c index 1402031f..107ce4e4 100644 --- a/code/sdl/sdl_glimp.c +++ b/code/sdl/sdl_glimp.c @@ -491,7 +491,7 @@ static qboolean GLimp_StartDriverAndSetMode(int mode, qboolean fullscreen, qbool { const char *driverName; - if (SDL_Init(SDL_INIT_VIDEO) == -1) + if (SDL_Init(SDL_INIT_VIDEO) != 0) { ri.Printf( PRINT_ALL, "SDL_Init( SDL_INIT_VIDEO ) FAILED (%s)\n", SDL_GetError()); return qfalse; diff --git a/code/sdl/sdl_input.c b/code/sdl/sdl_input.c index 1264ef0d..74b46c5d 100644 --- a/code/sdl/sdl_input.c +++ b/code/sdl/sdl_input.c @@ -431,7 +431,7 @@ static void IN_InitJoystick( void ) if (!SDL_WasInit(SDL_INIT_JOYSTICK)) { Com_DPrintf("Calling SDL_Init(SDL_INIT_JOYSTICK)...\n"); - if (SDL_Init(SDL_INIT_JOYSTICK) == -1) + if (SDL_Init(SDL_INIT_JOYSTICK) != 0) { Com_DPrintf("SDL_Init(SDL_INIT_JOYSTICK) failed: %s\n", SDL_GetError()); return; diff --git a/code/sdl/sdl_snd.c b/code/sdl/sdl_snd.c index 710c0362..609aed9e 100644 --- a/code/sdl/sdl_snd.c +++ b/code/sdl/sdl_snd.c @@ -156,7 +156,7 @@ qboolean SNDDMA_Init(void) if (!SDL_WasInit(SDL_INIT_AUDIO)) { - if (SDL_Init(SDL_INIT_AUDIO) == -1) + if (SDL_Init(SDL_INIT_AUDIO) != 0) { Com_Printf( "FAILED (%s)\n", SDL_GetError( ) ); return qfalse;