From 95fa1a69e4985e479486d7e730a59d538a6d70a3 Mon Sep 17 00:00:00 2001 From: Romain Vimont Date: Mon, 13 Apr 2020 16:29:12 +0200 Subject: [PATCH] Workaround compiler warning Some compilers warns on uninitialized value in impossible case: warning: variable 'result' is used uninitialized whenever switch default is taken [-Wsometimes-uninitialized] --- app/src/input_manager.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/src/input_manager.c b/app/src/input_manager.c index 39e1252d..589eb842 100644 --- a/app/src/input_manager.c +++ b/app/src/input_manager.c @@ -463,12 +463,11 @@ rotate_position(struct screen *screen, int32_t x, int32_t y) { result.x = w - x; result.y = h - y; break; - case 3: + default: + assert(rotation == 3); result.x = y; result.y = w - x; break; - default: - assert(!"Unreachable"); } return result; }