X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fmadwifi.c;h=42474bc7050c313aa967e8c59a7962dccc47fbaa;hb=fcbad61c7f63eb73694a10b47a51f32a7de3847b;hp=728fcd8cc9f22d30395fe77f2ecf570ec6091c48;hpb=f0d468892e1c173b226f739be48291981473b4fb;p=collectd.git diff --git a/src/madwifi.c b/src/madwifi.c index 728fcd8c..42474bc7 100644 --- a/src/madwifi.c +++ b/src/madwifi.c @@ -92,7 +92,6 @@ #include "common.h" #include "plugin.h" -#include "configfile.h" #include "utils_ignorelist.h" #include @@ -539,7 +538,7 @@ static int madwifi_config (const char *key, const char *value) static void submit (const char *dev, const char *type, const char *ti1, - const char *ti2, value_t *val, int len) + const char *ti2, value_t *val, size_t len) { value_list_t vl = VALUE_LIST_INIT; @@ -559,28 +558,26 @@ static void submit (const char *dev, const char *type, const char *ti1, } static void submit_derive (const char *dev, const char *type, const char *ti1, - const char *ti2, derive_t val) + const char *ti2, derive_t value) { - value_t item; - item.derive = val; - submit (dev, type, ti1, ti2, &item, 1); + submit (dev, type, ti1, ti2, &(value_t) { .derive = value }, 1); } static void submit_derive2 (const char *dev, const char *type, const char *ti1, const char *ti2, derive_t val1, derive_t val2) { - value_t items[2]; - items[0].derive = val1; - items[1].derive = val2; - submit (dev, type, ti1, ti2, items, 2); + value_t values[] = { + { .derive = val1 }, + { .derive = val2 }, + }; + + submit (dev, type, ti1, ti2, values, STATIC_ARRAY_SIZE (values)); } static void submit_gauge (const char *dev, const char *type, const char *ti1, - const char *ti2, gauge_t val) + const char *ti2, gauge_t value) { - value_t item; - item.gauge = val; - submit (dev, type, ti1, ti2, &item, 1); + submit (dev, type, ti1, ti2, &(value_t) { .gauge = value }, 1); } static void submit_antx (const char *dev, const char *name,