aboutsummaryrefslogtreecommitdiffstats
path: root/sway/tree/layout.c
diff options
context:
space:
mode:
authorLibravatar Dominique Martinet <asmadeus@codewreck.org>2018-04-13 22:35:34 +0900
committerLibravatar Dominique Martinet <asmadeus@codewreck.org>2018-04-13 22:47:27 +0900
commit8490d1662c36bc78d575cd80b68f5a8669e8867f (patch)
treeebce8201b2bb16e204d06f8cfe9eb8bc248c4d94 /sway/tree/layout.c
parentFix gcc string truncation warnings (diff)
downloadsway-8490d1662c36bc78d575cd80b68f5a8669e8867f.tar.gz
sway-8490d1662c36bc78d575cd80b68f5a8669e8867f.tar.zst
sway-8490d1662c36bc78d575cd80b68f5a8669e8867f.zip
Fix gcc maybe-uninitialized warning
Diffstat (limited to 'sway/tree/layout.c')
-rw-r--r--sway/tree/layout.c7
1 files 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,
288 288
289 switch (current->type) { 289 switch (current->type) {
290 case C_OUTPUT: { 290 case C_OUTPUT: {
291 enum wlr_direction wlr_dir; 291 enum wlr_direction wlr_dir = 0;
292 sway_dir_to_wlr(move_dir, &wlr_dir); 292 if (!sway_assert(sway_dir_to_wlr(move_dir, &wlr_dir),
293 "got invalid direction: %d", move_dir)) {
294 return;
295 }
293 double ref_lx = current->x + current->width / 2; 296 double ref_lx = current->x + current->width / 2;
294 double ref_ly = current->y + current->height / 2; 297 double ref_ly = current->y + current->height / 2;
295 struct wlr_output *next = wlr_output_layout_adjacent_output( 298 struct wlr_output *next = wlr_output_layout_adjacent_output(