diff options
Diffstat (limited to 'swaygrab')
-rw-r--r-- | swaygrab/json.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/swaygrab/json.c b/swaygrab/json.c index 286085c3..f0e8fa90 100644 --- a/swaygrab/json.c +++ b/swaygrab/json.c | |||
@@ -50,8 +50,7 @@ static json_object *get_focused_container_r(json_object *c) { | |||
50 | } else { | 50 | } else { |
51 | json_object *nodes, *node, *child; | 51 | json_object *nodes, *node, *child; |
52 | json_object_object_get_ex(c, "nodes", &nodes); | 52 | json_object_object_get_ex(c, "nodes", &nodes); |
53 | int i; | 53 | for (json_ar_len_t i = 0; i < json_object_array_length(nodes); i++) { |
54 | for (i = 0; i < json_object_array_length(nodes); i++) { | ||
55 | node = json_object_array_get_idx(nodes, i); | 54 | node = json_object_array_get_idx(nodes, i); |
56 | 55 | ||
57 | if ((child = get_focused_container_r(node))) { | 56 | if ((child = get_focused_container_r(node))) { |
@@ -60,7 +59,7 @@ static json_object *get_focused_container_r(json_object *c) { | |||
60 | } | 59 | } |
61 | 60 | ||
62 | json_object_object_get_ex(c, "floating_nodes", &nodes); | 61 | json_object_object_get_ex(c, "floating_nodes", &nodes); |
63 | for (i = 0; i < json_object_array_length(nodes); i++) { | 62 | for (json_ar_len_t i = 0; i < json_object_array_length(nodes); i++) { |
64 | node = json_object_array_get_idx(nodes, i); | 63 | node = json_object_array_get_idx(nodes, i); |
65 | 64 | ||
66 | if ((child = get_focused_container_r(node))) { | 65 | if ((child = get_focused_container_r(node))) { |
@@ -83,7 +82,7 @@ char *get_focused_output() { | |||
83 | if (!outputs) { | 82 | if (!outputs) { |
84 | sway_abort("Unabled to get focused output. No nodes in tree."); | 83 | sway_abort("Unabled to get focused output. No nodes in tree."); |
85 | } | 84 | } |
86 | for (int i = 0; i < json_object_array_length(outputs); i++) { | 85 | for (json_ar_len_t i = 0; i < json_object_array_length(outputs); i++) { |
87 | output = json_object_array_get_idx(outputs, i); | 86 | output = json_object_array_get_idx(outputs, i); |
88 | 87 | ||
89 | if (get_focused_container_r(output)) { | 88 | if (get_focused_container_r(output)) { |
@@ -131,7 +130,7 @@ json_object *get_output_container(const char *output) { | |||
131 | json_object *outputs, *json_output, *name; | 130 | json_object *outputs, *json_output, *name; |
132 | json_object_object_get_ex(tree, "nodes", &outputs); | 131 | json_object_object_get_ex(tree, "nodes", &outputs); |
133 | 132 | ||
134 | for (int i = 0; i < json_object_array_length(outputs); i++) { | 133 | for (json_ar_len_t i = 0; i < json_object_array_length(outputs); i++) { |
135 | json_output = json_object_array_get_idx(outputs, i); | 134 | json_output = json_object_array_get_idx(outputs, i); |
136 | json_object_object_get_ex(json_output, "name", &name); | 135 | json_object_object_get_ex(json_output, "name", &name); |
137 | 136 | ||