From 173332e92859e36f7269fc5345db51329b50ea6c Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 23 May 2024 11:49:41 +0100 Subject: [PATCH] tests: Fix a -Wmaybe-uninitialized warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since the `switch` didn’t have a default case, the `cull_front` and `cull_back` variables could technically be used uninitialised if the `cull_mode` was unrecognised. That seems unlikely to happen as presumably other code makes sure the `cull_mode` is valid, but it doesn’t hurt to add a `default:` case to squash the compiler warning. Signed-off-by: Philip Withnall Part-of: --- src/tests/cogl/conform/test-backface-culling.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tests/cogl/conform/test-backface-culling.c b/src/tests/cogl/conform/test-backface-culling.c index d567b565b..301887e18 100644 --- a/src/tests/cogl/conform/test-backface-culling.c +++ b/src/tests/cogl/conform/test-backface-culling.c @@ -201,6 +201,9 @@ validate_result (CoglFramebuffer *framebuffer, int y_offset) cull_front = TRUE; cull_back = TRUE; break; + + default: + g_assert_not_reached (); } if (FRONT_WINDING (draw_num) == COGL_WINDING_CLOCKWISE)