Tree wide: Use compound literals when dealing with value_t.
[collectd.git] / src / uptime.c
index cbe2f8c..34c3e85 100644 (file)
@@ -58,14 +58,11 @@ static time_t boottime;
 extern kstat_ctl_t *kc;
 #endif /* #endif HAVE_LIBKSTAT */
 
-static void uptime_submit (gauge_t uptime)
+static void uptime_submit (gauge_t value)
 {
-       value_t values[1];
        value_list_t vl = VALUE_LIST_INIT;
 
-       values[0].gauge = uptime;
-
-       vl.values = values;
+       vl.values = &(value_t) { .gauge = value };
        vl.values_len = 1;
 
        sstrncpy (vl.host, hostname_g, sizeof (vl.host));