aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Preiml <apreiml@strohwolke.at>2018-09-06 08:46:50 +0200
committerArmin Preiml <apreiml@strohwolke.at>2018-09-08 13:24:01 +0200
commit2dec0d894b3db4c6bdffadbb3b506c32fcfd6354 (patch)
tree01837663dcab712d698bc74afad321fc44369804
parent79eaa26b3e74e9332564dfde1e39fe695a0fb18b (diff)
downloadsway-2dec0d894b3db4c6bdffadbb3b506c32fcfd6354.tar.xz
get_tree: percent cast to double on division
-rw-r--r--sway/ipc-json.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sway/ipc-json.c b/sway/ipc-json.c
index fc65b5f2..682186d5 100644
--- a/sway/ipc-json.c
+++ b/sway/ipc-json.c
@@ -153,8 +153,8 @@ static void ipc_json_describe_output(struct sway_output *output,
}
if (parent_box.width != 0 && parent_box.height != 0) {
- double percent = (output->width / parent_box.width)
- * (output->height / parent_box.height);
+ double percent = ((double)output->width / (double)parent_box.width)
+ * ((double)output->height / (double)parent_box.height);
json_object_object_add(object, "percent", json_object_new_double(percent));
}
}
@@ -292,8 +292,8 @@ static void ipc_json_describe_container(struct sway_container *c, json_object *o
}
if (parent_box.width != 0 && parent_box.height != 0) {
- double percent = (c->width / parent_box.width)
- * (c->height / parent_box.height);
+ double percent = ((double)c->width / (double)parent_box.width)
+ * ((double)c->height / (double)parent_box.height);
json_object_object_add(object, "percent", json_object_new_double(percent));
}