diff options
author | Simon Ser <contact@emersion.fr> | 2020-04-10 17:00:05 +0200 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2020-04-10 17:05:00 +0200 |
commit | 0281b58d2fced97644b1c4a8ca169998049d36b0 (patch) | |
tree | ef74cf0d438b027e1637c9fd9465dd748fc64c11 | |
parent | 83c1ba77834d7710918e4fe15c5cb40c4736d6db (diff) |
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.
-rw-r--r-- | types/wlr_output.c | 5 |
1 files 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; |