From: Florian Forster Date: Mon, 15 Jan 2007 12:49:15 +0000 (+0100) Subject: src/plugin.h: Added `VALUE_LIST_INIT', a static initializer for value_list_t. X-Git-Tag: collectd-4.0.0~232^2~2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=020e7b31e4e22d27ce624dd94ea6a084a1e59bfc;p=collectd.git src/plugin.h: Added `VALUE_LIST_INIT', a static initializer for value_list_t. --- diff --git a/src/load.c b/src/load.c index e715dcf9..2cc761b6 100644 --- a/src/load.c +++ b/src/load.c @@ -60,7 +60,7 @@ static data_set_t ds = static void load_submit (double snum, double mnum, double lnum) { value_t values[3]; - value_list_t vl; + value_list_t vl = VALUE_LIST_INIT; values[0].gauge = snum; values[1].gauge = mnum; diff --git a/src/network.c b/src/network.c index 5d588804..33f581dc 100644 --- a/src/network.c +++ b/src/network.c @@ -374,7 +374,7 @@ static int parse_packet (void *buffer, int buffer_len) part_header_t *header; int status; - value_list_t vl; + value_list_t vl = VALUE_LIST_INIT; char type[DATA_MAX_NAME_LEN]; DBG ("buffer = %p; buffer_len = %i;", buffer, buffer_len); diff --git a/src/nfs.c b/src/nfs.c index efe1e024..d6e85168 100644 --- a/src/nfs.c +++ b/src/nfs.c @@ -199,7 +199,7 @@ static void nfs_procedures_submit (const char *plugin_instance, unsigned long long *val, const char **names, int len) { value_t values[1]; - value_list_t vl; + value_list_t vl = VALUE_LIST_INIT; int i; vl.values = values; diff --git a/src/plugin.h b/src/plugin.h index 83818718..3b94ff71 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -52,6 +52,8 @@ struct value_list_s }; typedef struct value_list_s value_list_t; +#define VALUE_LIST_INIT { NULL, 0, 0, "localhost", "", "", "" } + struct data_source_s { char name[DATA_MAX_NAME_LEN]; diff --git a/src/traffic.c b/src/traffic.c index 91b624ff..59b59e83 100644 --- a/src/traffic.c +++ b/src/traffic.c @@ -226,7 +226,7 @@ static void if_submit (const char *dev, const char *type, unsigned long long tx) { value_t values[2]; - value_list_t vl; + value_list_t vl = VALUE_LIST_INIT; if (check_ignore_if (dev)) return;