X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Ftarget_set.c;h=fee5ffdcbaac2e09e719cd9d9460f5f3cc21de7f;hb=5b4053d27b6a24e2f18e678f0d8c3343b7dfad7c;hp=73ca49fb8f071f898f328907c4aedb3a20f89ec0;hpb=810e8f5d687514841ed0ea445764ccc05e8f5299;p=collectd.git diff --git a/src/target_set.c b/src/target_set.c index 73ca49fb..fee5ffdc 100644 --- a/src/target_set.c +++ b/src/target_set.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "filter_chain.h" @@ -39,7 +40,7 @@ struct ts_data_s }; typedef struct ts_data_s ts_data_t; -int ts_util_get_key_and_string_wo_strdup (const oconfig_item_t *ci, char **ret_key, char **ret_string) /* {{{ */ +static int ts_util_get_key_and_string_wo_strdup (const oconfig_item_t *ci, char **ret_key, char **ret_string) /* {{{ */ { if ((ci->values_num != 2) || (ci->values[0].type != OCONFIG_TYPE_STRING) @@ -142,7 +143,6 @@ static int ts_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ { ts_data_t *data; int status; - int i; data = calloc (1, sizeof (*data)); if (data == NULL) @@ -159,7 +159,7 @@ static int ts_create (const oconfig_item_t *ci, void **user_data) /* {{{ */ data->meta = NULL; 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; @@ -256,9 +256,8 @@ static int ts_invoke (const data_set_t *ds, value_list_t *vl, /* {{{ */ void module_register (void) { - target_proc_t tproc; + target_proc_t tproc = { 0 }; - memset (&tproc, 0, sizeof (tproc)); tproc.create = ts_create; tproc.destroy = ts_destroy; tproc.invoke = ts_invoke;