From 46d9066a69473eca5c7afd3b6b3224f2bbc425cf Mon Sep 17 00:00:00 2001
From: Anonymous Maarten <[EMAIL REDACTED]>
Date: Thu, 22 Aug 2024 17:33:07 +0200
Subject: [PATCH] Fix warnings shown when making SDL_bool a typedef of bool
---
src/dynapi/SDL_dynapi_procs.h | 2 +-
src/render/vulkan/SDL_render_vulkan.c | 2 +-
src/stdlib/SDL_stdlib.c | 8 ++++----
src/video/SDL_RLEaccel_c.h | 2 +-
src/video/SDL_video_unsupported.c | 2 +-
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/dynapi/SDL_dynapi_procs.h b/src/dynapi/SDL_dynapi_procs.h
index 471bb8432b516..c86bff47214df 100644
--- a/src/dynapi/SDL_dynapi_procs.h
+++ b/src/dynapi/SDL_dynapi_procs.h
@@ -792,7 +792,7 @@ SDL_DYNAPI_PROC(int,SDL_SetStringProperty,(SDL_PropertiesID a, const char *b, co
SDL_DYNAPI_PROC(int,SDL_SetSurfaceAlphaMod,(SDL_Surface *a, Uint8 b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetSurfaceBlendMode,(SDL_Surface *a, SDL_BlendMode b),(a,b),return)
SDL_DYNAPI_PROC(SDL_bool,SDL_SetSurfaceClipRect,(SDL_Surface *a, const SDL_Rect *b),(a,b),return)
-SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorKey,(SDL_Surface *a, int b, Uint32 c),(a,b,c),return)
+SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorKey,(SDL_Surface *a, SDL_bool b, Uint32 c),(a,b,c),return)
SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorMod,(SDL_Surface *a, Uint8 b, Uint8 c, Uint8 d),(a,b,c,d),return)
SDL_DYNAPI_PROC(int,SDL_SetSurfaceColorspace,(SDL_Surface *a, SDL_Colorspace b),(a,b),return)
SDL_DYNAPI_PROC(int,SDL_SetSurfacePalette,(SDL_Surface *a, SDL_Palette *b),(a,b),return)
diff --git a/src/render/vulkan/SDL_render_vulkan.c b/src/render/vulkan/SDL_render_vulkan.c
index 81ca222114600..40941cc5f61ce 100644
--- a/src/render/vulkan/SDL_render_vulkan.c
+++ b/src/render/vulkan/SDL_render_vulkan.c
@@ -3720,7 +3720,7 @@ static int VULKAN_RunCommandQueue(SDL_Renderer *renderer, SDL_RenderCommand *cmd
rendererData->recreateSwapchain = SDL_FALSE;
}
- if (VULKAN_UpdateVertexBuffer(renderer, vertices, vertsize, &stateCache) < 0) {
+ if (!VULKAN_UpdateVertexBuffer(renderer, vertices, vertsize, &stateCache)) {
return -1;
}
diff --git a/src/stdlib/SDL_stdlib.c b/src/stdlib/SDL_stdlib.c
index 3a8443735d510..5ae573e305d9b 100644
--- a/src/stdlib/SDL_stdlib.c
+++ b/src/stdlib/SDL_stdlib.c
@@ -272,7 +272,7 @@ float SDL_fmodf(float x, float y)
#endif
}
-SDL_bool SDL_isinf(double x)
+int SDL_isinf(double x)
{
#ifdef HAVE_ISINF
return isinf(x);
@@ -281,7 +281,7 @@ SDL_bool SDL_isinf(double x)
#endif
}
-SDL_bool SDL_isinff(float x)
+int SDL_isinff(float x)
{
#ifdef HAVE_ISINF_FLOAT_MACRO
return isinf(x);
@@ -292,7 +292,7 @@ SDL_bool SDL_isinff(float x)
#endif
}
-SDL_bool SDL_isnan(double x)
+int SDL_isnan(double x)
{
#ifdef HAVE_ISNAN
return isnan(x);
@@ -301,7 +301,7 @@ SDL_bool SDL_isnan(double x)
#endif
}
-SDL_bool SDL_isnanf(float x)
+int SDL_isnanf(float x)
{
#ifdef HAVE_ISNAN_FLOAT_MACRO
return isnan(x);
diff --git a/src/video/SDL_RLEaccel_c.h b/src/video/SDL_RLEaccel_c.h
index cbf4c4908ee2d..95c54a5df28f5 100644
--- a/src/video/SDL_RLEaccel_c.h
+++ b/src/video/SDL_RLEaccel_c.h
@@ -27,6 +27,6 @@
/* Useful functions and variables from SDL_RLEaccel.c */
extern int SDL_RLESurface(SDL_Surface *surface);
-extern void SDL_UnRLESurface(SDL_Surface *surface, int recode);
+extern void SDL_UnRLESurface(SDL_Surface *surface, SDL_bool recode);
#endif /* SDL_RLEaccel_c_h_ */
diff --git a/src/video/SDL_video_unsupported.c b/src/video/SDL_video_unsupported.c
index 05ba3c743b74e..caf19787a9ad1 100644
--- a/src/video/SDL_video_unsupported.c
+++ b/src/video/SDL_video_unsupported.c
@@ -43,7 +43,7 @@ void SDL_SetWindowsMessageHook(SDL_WindowsMessageHook callback, void *userdata)
#endif /* SDL_PLATFORM_WIN32 || SDL_PLATFORM_GDK */
SDL_DECLSPEC int SDLCALL SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex);
-SDL_bool SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex)
+int SDL_GetDXGIOutputInfo(SDL_DisplayID displayID, int *adapterIndex, int *outputIndex)
{
(void)displayID;
(void)adapterIndex;