From 588e32ea5af69193e19bd8b1ca81aa4a085a1623 Mon Sep 17 00:00:00 2001
From: capehill <[EMAIL REDACTED]>
Date: Tue, 5 Nov 2024 21:00:31 +0200
Subject: [PATCH] test: Change LoadContext() return value type from int to bool
It should be then consistent with SDL_SetError().
---
test/testgl.c | 6 +++---
test/testgles2.c | 6 +++---
test/testgles2_sdf.c | 6 +++---
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/test/testgl.c b/test/testgl.c
index cfa82d95b6703..44e1ca4237a49 100644
--- a/test/testgl.c
+++ b/test/testgl.c
@@ -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__
@@ -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. */
@@ -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;
diff --git a/test/testgles2.c b/test/testgles2.c
index 1903938fbbf99..9c7ecf6a9dba3 100644
--- a/test/testgles2.c
+++ b/test/testgles2.c
@@ -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__
@@ -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. */
@@ -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;
diff --git a/test/testgles2_sdf.c b/test/testgles2_sdf.c
index 09e2b6c40af47..d406d041b63a8 100644
--- a/test/testgles2_sdf.c
+++ b/test/testgles2_sdf.c
@@ -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__
@@ -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. */
@@ -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;