static void submit_value (int cpu_num, int cpu_state, const char *type, value_t value)
{
static void submit_value (int cpu_num, int cpu_state, const char *type, value_t value)
{
/* This function is called for all known CPU states, but each read
* method will only report a subset. The remaining states are left as
* NAN and we ignore them here. */
/* This function is called for all known CPU states, but each read
* method will only report a subset. The remaining states are left as
* NAN and we ignore them here. */
- value.gauge = percent;
- submit_value (cpu_num, cpu_state, "percent", value);
+ submit_value (cpu_num, cpu_state, "percent",
+ (value_t) { .gauge = value });
- value_t value;
-
- value.derive = derive;
- submit_value (cpu_num, cpu_state, "cpu", value);
+ submit_value (cpu_num, cpu_state, "cpu",
+ (value_t) { .derive = value });