From c797ae161929070a3e4087aa4ad4c6185b776954 Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Mon, 9 Sep 2024 14:40:50 +0200 Subject: [PATCH] Fix -Wtype-limits warning actual has type Uint8, so there's no need to compare against 0. --- test/testautomation_surface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/testautomation_surface.c b/test/testautomation_surface.c index c2de04b8d..3ae33e99b 100644 --- a/test/testautomation_surface.c +++ b/test/testautomation_surface.c @@ -1339,7 +1339,7 @@ static int SDLCALL surface_testPalettization(void *arg) int idx = i; Uint8 actual = pixels[idx]; Uint8 expected = colors[i].e; - SDLTest_AssertCheck(0 <= actual && actual < SDL_arraysize(palette_colors), "0 <= output->pixels[%d] < %d", idx, (int)SDL_arraysize(palette_colors)); + SDLTest_AssertCheck(actual < SDL_arraysize(palette_colors), "output->pixels[%d] < %d", idx, (int)SDL_arraysize(palette_colors)); SDLTest_AssertCheck(actual == expected, "Expected output->pixels[%d] == %u, got %u", idx, expected, actual); } SDLTest_AssertPass("Check palette 1:1 mapping"); @@ -1347,7 +1347,7 @@ static int SDLCALL surface_testPalettization(void *arg) int idx = SDL_arraysize(colors) + i; Uint8 actual = pixels[idx]; Uint8 expected = i; - SDLTest_AssertCheck(0 <= actual && actual < SDL_arraysize(palette_colors), "0 <= output->pixels[%d] < %d", idx, (int)SDL_arraysize(palette_colors)); + SDLTest_AssertCheck(actual < SDL_arraysize(palette_colors), "output->pixels[%d] < %d", idx, (int)SDL_arraysize(palette_colors)); SDLTest_AssertCheck(actual == expected, "Expected output->pixels[%d] == %u, got %u", idx, expected, actual); } SDL_DestroyPalette(palette);