aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-03-29 22:23:41 -0400
committerDrew DeVault <sir@cmpwn.com>2018-03-29 22:23:41 -0400
commitdbda7bfbed7d4ac67f7c2932dd0b82fb5531f89a (patch)
tree852d183db161888514cdff174dd5282e67af60e6
parentddc09940b161ac2e2d21d70d8ef4d89d33e2eb20 (diff)
Move declaration into loop
-rw-r--r--sway/ipc-server.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sway/ipc-server.c b/sway/ipc-server.c
index 872c5704..9d23607b 100644
--- a/sway/ipc-server.c
+++ b/sway/ipc-server.c
@@ -538,8 +538,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
if (!buf[0]) {
// Send list of configured bar IDs
json_object *bars = json_object_new_array();
- int i;
- for (i = 0; i < config->bars->length; ++i) {
+ for (int i = 0; i < config->bars->length; ++i) {
struct bar_config *bar = config->bars->items[i];
json_object_array_add(bars, json_object_new_string(bar->id));
}
@@ -549,8 +548,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
} else {
// Send particular bar's details
struct bar_config *bar = NULL;
- int i;
- for (i = 0; i < config->bars->length; ++i) {
+ for (int i = 0; i < config->bars->length; ++i) {
bar = config->bars->items[i];
if (strcmp(buf, bar->id) == 0) {
break;