From 4e07d4722d61c65e8fc4d4685e3a0861eea5d15b Mon Sep 17 00:00:00 2001
From: Christoph Reichenbach <[EMAIL REDACTED]>
Date: Sat, 4 Jun 2022 13:03:51 +0000
Subject: [PATCH] Build warning fixes for gcc-11.3
---
test/testautomation_rect.c | 4 ++--
test/testautomation_surface.c | 4 ++++
test/testautomation_video.c | 3 ++-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/test/testautomation_rect.c b/test/testautomation_rect.c
index cd8f65c34ff..6852787901a 100644
--- a/test/testautomation_rect.c
+++ b/test/testautomation_rect.c
@@ -707,7 +707,7 @@ int rect_testIntersectRectEmpty (void *arg)
int rect_testIntersectRectParam(void *arg)
{
SDL_Rect rectA;
- SDL_Rect rectB;
+ SDL_Rect rectB = {0};
SDL_Rect result;
SDL_bool intersection;
@@ -962,7 +962,7 @@ int rect_testHasIntersectionEmpty (void *arg)
int rect_testHasIntersectionParam(void *arg)
{
SDL_Rect rectA;
- SDL_Rect rectB;
+ SDL_Rect rectB = {0};
SDL_bool intersection;
/* invalid parameter combinations */
diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c
index 92c078685c9..d159c1f40e9 100644
--- a/test/testautomation_surface.c
+++ b/test/testautomation_surface.c
@@ -178,6 +178,10 @@ void _testBlitBlendMode(int mode)
bmode = SDL_BLENDMODE_ADD;
} else if (nmode==3) {
bmode = SDL_BLENDMODE_MOD;
+ } else {
+ /* Should be impossible, but some static checkers are too imprecise and will complain */
+ SDLTest_LogError("Invalid: nmode=%d", nmode);
+ return;
}
ret = SDL_SetSurfaceBlendMode( face, bmode );
if (ret != 0) checkFailCount4++;
diff --git a/test/testautomation_video.c b/test/testautomation_video.c
index 342848ac03e..edf8dff4adf 100644
--- a/test/testautomation_video.c
+++ b/test/testautomation_video.c
@@ -1372,7 +1372,8 @@ video_getSetWindowMinimumSize(void *arg)
int wVariation, hVariation;
int referenceW, referenceH;
int currentW, currentH;
- int desiredW, desiredH;
+ int desiredW = 1;
+ int desiredH = 1;
/* Get display bounds for size range */
result = SDL_GetDisplayBounds(0, &display);