From: Adam Dickmeiss Date: Thu, 13 Aug 2015 13:32:23 +0000 (+0200) Subject: Reformat and while to for stmt X-Git-Tag: v1.12.0~2 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=2f723cbc10d81f7ddedaeaf67c111ebed9bc193b;p=pazpar2-moved-to-github.git Reformat and while to for stmt --- diff --git a/src/pazpar2_config.c b/src/pazpar2_config.c index 6983450..2f60eb4 100644 --- a/src/pazpar2_config.c +++ b/src/pazpar2_config.c @@ -1150,7 +1150,7 @@ static void info_service_databases(struct conf_service *service, WRBUF w) { struct database *db; wrbuf_puts(w, " \n"); - for(db = service->databases; db; db = db->next) + for (db = service->databases; db; db = db->next) { int i; wrbuf_puts(w, " num_settings; i++) { struct setting *s = db->settings[i]; - while (s != NULL) + for (; s; s = s->next) { - wrbuf_puts(w, " name); wrbuf_puts(w, "\""); wrbuf_puts(w, " value=\""); wrbuf_xmlputs(w, s->value); wrbuf_puts(w, "\""); wrbuf_puts(w, " />\n"); - s = s->next; } } wrbuf_puts(w, " \n"); @@ -1187,7 +1185,7 @@ void info_services(struct conf_server *server, WRBUF w) { struct conf_service *s = server->service; int i; - + wrbuf_puts(w, " \n"); for (; s; s = s->next) { @@ -1201,34 +1199,30 @@ void info_services(struct conf_server *server, WRBUF w) wrbuf_puts(w, ">\n"); if (s->settings) { - for (i=0; isettings->num_settings; i++) + for (i = 0; i < s->settings->num_settings; i++) { struct setting *S = s->settings->settings[i]; - while (S != NULL) { - wrbuf_puts(w, " next) + { + wrbuf_puts(w, " name); wrbuf_puts(w, "\""); wrbuf_puts(w, " value=\""); wrbuf_xmlputs(w, S->value); wrbuf_puts(w, "\""); - if (S->target) { + if (S->target) + { wrbuf_puts(w, " target=\""); wrbuf_xmlputs(w, S->target); wrbuf_puts(w, "\""); } - wrbuf_puts(w, " />\n"); - - S = S->next; } } } info_service_metadata(s, w); info_service_databases(s, w); - wrbuf_puts(w, " "); - - wrbuf_puts(w, "\n"); + wrbuf_puts(w, " \n"); } wrbuf_puts(w, " \n"); }