X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmemcachec.c;h=1b6ab673d772f0ebaf1386ed31fd778960eba192;hb=8d8d888262e8cc375266ae1fdba03314dbd9149c;hp=629b99bab12dc9fa5290c3cb8bb34e87ef3d7bb5;hpb=826293bf3acfdcee6632f5d8f0b6be013f2cebab;p=collectd.git diff --git a/src/memcachec.c b/src/memcachec.c index 629b99ba..1b6ab673 100644 --- a/src/memcachec.c +++ b/src/memcachec.c @@ -22,6 +22,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "configfile.h" @@ -199,7 +200,6 @@ static int cmc_config_add_match (web_page_t *page, /* {{{ */ { web_match_t *match; int status; - int i; if (ci->values_num != 0) { @@ -214,7 +214,7 @@ static int cmc_config_add_match (web_page_t *page, /* {{{ */ } status = 0; - for (i = 0; i < ci->children_num; i++) + for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; @@ -271,7 +271,7 @@ static int cmc_config_add_match (web_page_t *page, /* {{{ */ match->dstype); if (match->match == NULL) { - ERROR ("memcachec plugin: tail_match_add_match_simple failed."); + ERROR ("memcachec plugin: match_create_simple failed."); cmc_web_match_free (match); return (-1); } @@ -296,7 +296,6 @@ static int cmc_config_add_page (oconfig_item_t *ci) /* {{{ */ { web_page_t *page; int status; - int i; if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) { @@ -323,7 +322,7 @@ static int cmc_config_add_page (oconfig_item_t *ci) /* {{{ */ /* Process all children */ status = 0; - for (i = 0; i < ci->children_num; i++) + for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; @@ -400,12 +399,11 @@ static int cmc_config (oconfig_item_t *ci) /* {{{ */ int success; int errors; int status; - int i; success = 0; errors = 0; - for (i = 0; i < ci->children_num; i++) + for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; @@ -464,7 +462,6 @@ static void cmc_submit (const web_page_t *wp, const web_match_t *wm, /* {{{ */ static int cmc_read_page (web_page_t *wp) /* {{{ */ { - web_match_t *wm; memcached_return rc; size_t string_length; uint32_t flags; @@ -482,7 +479,7 @@ static int cmc_read_page (web_page_t *wp) /* {{{ */ return (-1); } - for (wm = wp->matches; wm != NULL; wm = wm->next) + for (web_match_t *wm = wp->matches; wm != NULL; wm = wm->next) { cu_match_value_t *mv; @@ -511,9 +508,7 @@ static int cmc_read_page (web_page_t *wp) /* {{{ */ static int cmc_read (void) /* {{{ */ { - web_page_t *wp; - - for (wp = pages_g; wp != NULL; wp = wp->next) + for (web_page_t *wp = pages_g; wp != NULL; wp = wp->next) cmc_read_page (wp); return (0);