Code

hugepages plugin: Implement the "ValuesPages", "ValuesBytes" and "ValuesPercentage...
[collectd.git] / src / vmem.c
index 46ffa13b1108582b3de120decc22180cf569c2d3..027f7bdde163918eea9cd2b5a60d202bb1c0658f 100644 (file)
@@ -65,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];
+  value_t values[] = {
+    { .derive = c0 },
+    { .derive = c1 },
+  };
 
-  values[0].derive = c0;
-  values[1].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,