Skip to content

Commit ed92b6c

Browse files
Sackzementsezero
authored andcommitted
Fix uninitialized variable warning when compiling tests with clang compiler
(cherry picked from commit 38e0094)
1 parent e8aa955 commit ed92b6c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/testautomation_rect.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -701,8 +701,8 @@ int rect_testIntersectRectEmpty(void *arg)
701701
*/
702702
int rect_testIntersectRectParam(void *arg)
703703
{
704-
SDL_Rect rectA;
705-
SDL_Rect rectB = { 0 };
704+
const SDL_Rect rectA = { 0, 0, 32, 32 };
705+
const SDL_Rect rectB = { 0, 0, 32, 32 };
706706
SDL_Rect result;
707707
SDL_bool intersection;
708708

@@ -956,8 +956,8 @@ int rect_testHasIntersectionEmpty(void *arg)
956956
*/
957957
int rect_testHasIntersectionParam(void *arg)
958958
{
959-
SDL_Rect rectA;
960-
SDL_Rect rectB = { 0 };
959+
const SDL_Rect rectA = { 0, 0, 32, 32 };
960+
const SDL_Rect rectB = { 0, 0, 32, 32 };
961961
SDL_bool intersection;
962962

963963
/* invalid parameter combinations */
@@ -1492,7 +1492,8 @@ int rect_testUnionRectInside(void *arg)
14921492
*/
14931493
int rect_testUnionRectParam(void *arg)
14941494
{
1495-
SDL_Rect rectA, rectB = { 0 };
1495+
const SDL_Rect rectA = { 0, 0, 32, 32 };
1496+
const SDL_Rect rectB = { 0, 0, 32, 32 };
14961497
SDL_Rect result;
14971498

14981499
/* invalid parameter combinations */

0 commit comments

Comments
 (0)