capture: make counter value a union of int64 and double

This allows us to use the type field of the counter to specify if the
counter is a double or a 64-bit integer.
This commit is contained in:
Christian Hergert
2016-04-15 04:54:55 -07:00
parent 88cc6485dd
commit 49e9ad9db8
5 changed files with 39 additions and 31 deletions

View File

@ -606,7 +606,7 @@ sp_capture_reader_read_counter_define (SpCaptureReader *self)
for (i = 0; i < def->n_counters; i++)
{
def->counters[i].id = GUINT32_SWAP_LE_BE (def->counters[i].id);
def->counters[i].value = GUINT64_SWAP_LE_BE (def->counters[i].value);
def->counters[i].value.v64 = GUINT64_SWAP_LE_BE (def->counters[i].value.v64);
}
}
@ -657,7 +657,7 @@ sp_capture_reader_read_counter_set (SpCaptureReader *self)
for (j = 0; j < G_N_ELEMENTS (set->values[0].values); i++)
{
set->values[i].ids[j] = GUINT32_SWAP_LE_BE (set->values[i].ids[j]);
set->values[i].values[j] = GUINT64_SWAP_LE_BE (set->values[i].values[j]);
set->values[i].values[j].v64 = GUINT64_SWAP_LE_BE (set->values[i].values[j].v64);
}
}
}