Skip to content

Commit

Permalink
test: Change LoadContext() return value type from int to bool
Browse files Browse the repository at this point in the history
It should be then consistent with SDL_SetError().
  • Loading branch information
capehill authored and slouken committed Nov 5, 2024
1 parent ecfd143 commit 588e32e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions test/testgl.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ static SDL_GLContext context;
static GL_Context ctx;
static bool suspend_when_occluded;

static int LoadContext(GL_Context *data)
static bool LoadContext(GL_Context *data)
{
#ifdef SDL_VIDEO_DRIVER_UIKIT
#define __SDL_NOGETPROCADDR__
Expand All @@ -55,7 +55,7 @@ static int LoadContext(GL_Context *data)

#include "../src/render/opengl/SDL_glfuncs.h"
#undef SDL_PROC
return 0;
return true;
}

/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
Expand Down Expand Up @@ -284,7 +284,7 @@ int main(int argc, char *argv[])
}

/* Important: call this *after* creating the context */
if (LoadContext(&ctx) < 0) {
if (!LoadContext(&ctx)) {
SDL_Log("Could not load GL functions\n");
quit(2);
return 0;
Expand Down
6 changes: 3 additions & 3 deletions test/testgles2.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ static bool suspend_when_occluded;
static GLES2_Context ctx;
static shader_data *datas;

static int LoadContext(GLES2_Context *data)
static bool LoadContext(GLES2_Context *data)
{
#ifdef SDL_VIDEO_DRIVER_UIKIT
#define __SDL_NOGETPROCADDR__
Expand All @@ -92,7 +92,7 @@ static int LoadContext(GLES2_Context *data)

#include "../src/render/opengles2/SDL_gles2funcs.h"
#undef SDL_PROC
return 0;
return true;
}

/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
Expand Down Expand Up @@ -764,7 +764,7 @@ int main(int argc, char *argv[])
}

/* Important: call this *after* creating the context */
if (LoadContext(&ctx) < 0) {
if (!LoadContext(&ctx)) {
SDL_Log("Could not load GLES2 functions\n");
quit(2);
return 0;
Expand Down
6 changes: 3 additions & 3 deletions test/testgles2_sdf.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static SDL_GLContext *context = NULL;
static int depth = 16;
static GLES2_Context ctx;

static int LoadContext(GLES2_Context *data)
static bool LoadContext(GLES2_Context *data)
{
#ifdef SDL_VIDEO_DRIVER_UIKIT
#define __SDL_NOGETPROCADDR__
Expand All @@ -83,7 +83,7 @@ static int LoadContext(GLES2_Context *data)

#include "../src/render/opengles2/SDL_gles2funcs.h"
#undef SDL_PROC
return 0;
return true;
}

/* Call this instead of exit(), so we can clean up SDL: atexit() is evil. */
Expand Down Expand Up @@ -523,7 +523,7 @@ int main(int argc, char *argv[])
}

/* Important: call this *after* creating the context */
if (LoadContext(&ctx) < 0) {
if (!LoadContext(&ctx)) {
SDL_Log("Could not load GLES2 functions\n");
quit(2);
return 0;
Expand Down

0 comments on commit 588e32e

Please sign in to comment.