From 8490d1662c36bc78d575cd80b68f5a8669e8867f Mon Sep 17 00:00:00 2001 From: Dominique Martinet Date: Fri, 13 Apr 2018 22:35:34 +0900 Subject: Fix gcc maybe-uninitialized warning --- sway/tree/layout.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/sway/tree/layout.c b/sway/tree/layout.c index ae76ca26..0b637822 100644 --- a/sway/tree/layout.c +++ b/sway/tree/layout.c @@ -288,8 +288,11 @@ void container_move(struct sway_container *container, switch (current->type) { case C_OUTPUT: { - enum wlr_direction wlr_dir; - sway_dir_to_wlr(move_dir, &wlr_dir); + enum wlr_direction wlr_dir = 0; + if (!sway_assert(sway_dir_to_wlr(move_dir, &wlr_dir), + "got invalid direction: %d", move_dir)) { + return; + } double ref_lx = current->x + current->width / 2; double ref_ly = current->y + current->height / 2; struct wlr_output *next = wlr_output_layout_adjacent_output( -- cgit v1.2.3-54-g00ecf