From 2f723cbc10d81f7ddedaeaf67c111ebed9bc193b Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 13 Aug 2015 15:32:23 +0200 Subject: [PATCH] Reformat and while to for stmt --- src/pazpar2_config.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) 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"); } -- 1.7.10.4