capture: use gint32 instead of GPid

GPid just isn't portable as a data type for on-disk storage, so
be more explicit and use gint32 directly.
This commit is contained in:
Christian Hergert
2019-05-06 20:03:33 -07:00
parent 191754e505
commit 607ef387e7
4 changed files with 29 additions and 29 deletions

View File

@ -88,7 +88,7 @@ sp_capture_condition_match (const SpCaptureCondition *self,
case SP_CAPTURE_CONDITION_WHERE_PID_IN:
for (guint i = 0; i < self->u.where_pid_in->len; i++)
{
if (frame->pid == g_array_index (self->u.where_pid_in, GPid, i))
if (frame->pid == g_array_index (self->u.where_pid_in, gint32, i))
return TRUE;
}
return FALSE;
@ -169,7 +169,7 @@ sp_capture_condition_copy (const SpCaptureCondition *self)
case SP_CAPTURE_CONDITION_WHERE_PID_IN:
return sp_capture_condition_new_where_pid_in (
self->u.where_pid_in->len,
(const GPid *)(gpointer)self->u.where_pid_in->data);
(const gint32 *)(gpointer)self->u.where_pid_in->data);
case SP_CAPTURE_CONDITION_WHERE_COUNTER_IN:
return sp_capture_condition_new_where_counter_in (
@ -261,8 +261,8 @@ sp_capture_condition_new_where_time_between (gint64 begin_time,
}
SpCaptureCondition *
sp_capture_condition_new_where_pid_in (guint n_pids,
const GPid *pids)
sp_capture_condition_new_where_pid_in (guint n_pids,
const gint32 *pids)
{
SpCaptureCondition *self;
@ -270,9 +270,9 @@ sp_capture_condition_new_where_pid_in (guint n_pids,
self = g_slice_new0 (SpCaptureCondition);
self->type = SP_CAPTURE_CONDITION_WHERE_PID_IN;
self->u.where_pid_in = g_array_sized_new (FALSE, FALSE, sizeof (GPid), n_pids);
self->u.where_pid_in = g_array_sized_new (FALSE, FALSE, sizeof (gint32), n_pids);
g_array_set_size (self->u.where_pid_in, n_pids);
memcpy (self->u.where_pid_in->data, pids, sizeof (GPid) * n_pids);
memcpy (self->u.where_pid_in->data, pids, sizeof (gint32) * n_pids);
return self;
}