From ed92b6c79b4e6116781dba70fa60251a4ae78953 Mon Sep 17 00:00:00 2001
From: Petar Popovic <[EMAIL REDACTED]>
Date: Fri, 7 Nov 2025 11:30:15 +0100
Subject: [PATCH] Fix uninitialized variable warning when compiling tests with
clang compiler
(cherry picked from commit 38e00946370a5f6e2d6c762cd9dcf6ec8ea3824d)
---
test/testautomation_rect.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/test/testautomation_rect.c b/test/testautomation_rect.c
index d1d7e1d4a7831..376aa0a277168 100644
--- a/test/testautomation_rect.c
+++ b/test/testautomation_rect.c
@@ -701,8 +701,8 @@ int rect_testIntersectRectEmpty(void *arg)
*/
int rect_testIntersectRectParam(void *arg)
{
- SDL_Rect rectA;
- SDL_Rect rectB = { 0 };
+ const SDL_Rect rectA = { 0, 0, 32, 32 };
+ const SDL_Rect rectB = { 0, 0, 32, 32 };
SDL_Rect result;
SDL_bool intersection;
@@ -956,8 +956,8 @@ int rect_testHasIntersectionEmpty(void *arg)
*/
int rect_testHasIntersectionParam(void *arg)
{
- SDL_Rect rectA;
- SDL_Rect rectB = { 0 };
+ const SDL_Rect rectA = { 0, 0, 32, 32 };
+ const SDL_Rect rectB = { 0, 0, 32, 32 };
SDL_bool intersection;
/* invalid parameter combinations */
@@ -1492,7 +1492,8 @@ int rect_testUnionRectInside(void *arg)
*/
int rect_testUnionRectParam(void *arg)
{
- SDL_Rect rectA, rectB = { 0 };
+ const SDL_Rect rectA = { 0, 0, 32, 32 };
+ const SDL_Rect rectB = { 0, 0, 32, 32 };
SDL_Rect result;
/* invalid parameter combinations */