1
0
Fork 0

tests: Fix a -Wmaybe-uninitialized warning

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 <pwithnall@gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3770>
This commit is contained in:
Philip Withnall 2024-05-23 11:49:41 +01:00 committed by Marge Bot
parent ca1434ff1e
commit 173332e928

View file

@ -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)