From 0281b58d2fced97644b1c4a8ca169998049d36b0 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Fri, 10 Apr 2020 17:00:05 +0200 Subject: output: fix maybe-uninitialized warning GCC is complaining about a maybe-uninitialized variable when doing a release build. Even if that can't actually happen because all enum values are handled, add an abort call to silence the warning. --- types/wlr_output.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/types/wlr_output.c b/types/wlr_output.c index 514efea4..3316653a 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -480,12 +480,13 @@ static void output_pending_resolution(struct wlr_output *output, int *width, case WLR_OUTPUT_STATE_MODE_FIXED: *width = output->pending.mode->width; *height = output->pending.mode->height; - break; + return; case WLR_OUTPUT_STATE_MODE_CUSTOM: *width = output->pending.custom_mode.width; *height = output->pending.custom_mode.height; - break; + return; } + abort(); } else { *width = output->width; *height = output->height; -- cgit v1.2.3