X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fvmem.c;h=027f7bdde163918eea9cd2b5a60d202bb1c0658f;hb=e1bfa71aca1f37c2f293dc9adb44065c6e7a9ad9;hp=7bb0433cb233f1865bb747d3e5d700437c9df7ca;hpb=0c004681a480e919b779584814eb396f6e6948ca;p=collectd.git diff --git a/src/vmem.c b/src/vmem.c index 7bb0433c..027f7bdd 100644 --- a/src/vmem.c +++ b/src/vmem.c @@ -25,6 +25,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" @@ -64,12 +65,13 @@ static void submit (const char *plugin_instance, const char *type, static void submit_two (const char *plugin_instance, const char *type, const char *type_instance, derive_t c0, derive_t c1) { - value_t values[2]; - - values[0].derive = c0; - values[1].derive = c1; + value_t values[] = { + { .derive = c0 }, + { .derive = c1 }, + }; - submit (plugin_instance, type, type_instance, values, 2); + submit (plugin_instance, type, type_instance, + values, STATIC_ARRAY_SIZE (values)); } /* void submit_one */ static void submit_one (const char *plugin_instance, const char *type, @@ -147,7 +149,7 @@ static int vmem_read (void) if (fields[1] == endptr) continue; - /* + /* * Number of pages * * The total number of {inst} pages, e. g dirty pages. @@ -167,7 +169,7 @@ static int vmem_read (void) } } - /* + /* * Page in and page outs. For memory and swap. */ else if (strcmp ("pgpgin", key) == 0)