diff --git a/Makefile b/Makefile index 4b83c132..1c8dfd5f 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,6 @@ VERSION := 0.4 LIBS := -levent CFLAGS += -g -O2 -override CFLAGS += -std=gnu99 -Wall all: $(OUT) diff --git a/dnstc.c b/dnstc.c index 5f9feddf..49901747 100644 --- a/dnstc.c +++ b/dnstc.c @@ -122,7 +122,8 @@ static int dnstc_onenter(parser_section *section) instance->config.bindaddr.sin_family = AF_INET; instance->config.bindaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - for (parser_entry *entry = §ion->entries[0]; entry->key; entry++) + parser_entry *entry; + for (entry = §ion->entries[0]; entry->key; entry++) entry->addr = (strcmp(entry->key, "local_ip") == 0) ? (void*)&instance->config.bindaddr.sin_addr : (strcmp(entry->key, "local_port") == 0) ? (void*)&instance->config.bindaddr.sin_port : @@ -136,7 +137,8 @@ static int dnstc_onexit(parser_section *section) dnstc_instance *instance = section->data; section->data = NULL; - for (parser_entry *entry = §ion->entries[0]; entry->key; entry++) + parser_entry *entry; + for (entry = §ion->entries[0]; entry->key; entry++) entry->addr = NULL; instance->config.bindaddr.sin_port = htons(instance->config.bindaddr.sin_port); diff --git a/parser.c b/parser.c index 61988284..50a71c1f 100644 --- a/parser.c +++ b/parser.c @@ -477,7 +477,8 @@ int parser_run(parser_context *context) parser_error(context, "expected token before ``{''"); // } - I love folding } else { - for (parser_section *p = context->sections; p; p = p->next) { + parser_section *p; + for (p = context->sections; p; p = p->next) { if (strcmp(p->name, section_token) == 0) { section = p; break; diff --git a/redsocks.c b/redsocks.c index 878576ff..f69d69c5 100644 --- a/redsocks.c +++ b/redsocks.c @@ -125,7 +125,8 @@ static int redsocks_onenter(parser_section *section) instance->config.min_backoff_ms = 100; instance->config.max_backoff_ms = 60000; - for (parser_entry *entry = §ion->entries[0]; entry->key; entry++) + parser_entry *entry; + for (entry = §ion->entries[0]; entry->key; entry++) entry->addr = (strcmp(entry->key, "local_ip") == 0) ? (void*)&instance->config.bindaddr.sin_addr : (strcmp(entry->key, "local_port") == 0) ? (void*)&instance->config.bindaddr.sin_port : @@ -152,7 +153,8 @@ static int redsocks_onexit(parser_section *section) redsocks_instance *instance = section->data; section->data = NULL; - for (parser_entry *entry = §ion->entries[0]; entry->key; entry++) + parser_entry *entry; + for (entry = §ion->entries[0]; entry->key; entry++) entry->addr = NULL; instance->config.bindaddr.sin_port = htons(instance->config.bindaddr.sin_port); diff --git a/redudp.c b/redudp.c index 05460dcd..226e2898 100644 --- a/redudp.c +++ b/redudp.c @@ -707,7 +707,8 @@ static int redudp_onenter(parser_section *section) instance->config.udp_timeout = 30; instance->config.udp_timeout_stream = 180; - for (parser_entry *entry = §ion->entries[0]; entry->key; entry++) + parser_entry *entry; + for (entry = §ion->entries[0]; entry->key; entry++) entry->addr = (strcmp(entry->key, "local_ip") == 0) ? (void*)&instance->config.bindaddr.sin_addr : (strcmp(entry->key, "local_port") == 0) ? (void*)&instance->config.bindaddr.sin_port : @@ -730,7 +731,8 @@ static int redudp_onexit(parser_section *section) redudp_instance *instance = section->data; section->data = NULL; - for (parser_entry *entry = §ion->entries[0]; entry->key; entry++) + parser_entry *entry; + for (entry = §ion->entries[0]; entry->key; entry++) entry->addr = NULL; instance->config.bindaddr.sin_port = htons(instance->config.bindaddr.sin_port); diff --git a/utils.c b/utils.c index 7de39690..686fa38e 100644 --- a/utils.c +++ b/utils.c @@ -53,7 +53,8 @@ int red_recv_udp_pkt(int fd, char *buf, size_t buflen, struct sockaddr_in *inadd if (toaddr) { memset(toaddr, 0, sizeof(*toaddr)); - for (struct cmsghdr* cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { + struct cmsghdr* cmsg; + for (cmsg = CMSG_FIRSTHDR(&msg); cmsg; cmsg = CMSG_NXTHDR(&msg, cmsg)) { if ( cmsg->cmsg_level == SOL_IP && cmsg->cmsg_type == IP_ORIGDSTADDR &&