capture: only use <=32 bit bit fields

This commit is contained in:
Christian Hergert
2019-05-06 15:08:36 -07:00
parent 29c0ebf009
commit e63c267192
2 changed files with 14 additions and 7 deletions

View File

@ -94,7 +94,8 @@ typedef struct
gint32 pid; gint32 pid;
gint64 time; gint64 time;
guint8 type; guint8 type;
guint64 padding : 56; guint32 padding1;
guint32 padding2 : 24;
guint8 data[0]; guint8 data[0];
} SpCaptureFrame; } SpCaptureFrame;
@ -125,7 +126,8 @@ typedef struct
{ {
SpCaptureFrame frame; SpCaptureFrame frame;
guint16 n_addrs; guint16 n_addrs;
guint64 padding : 48; guint32 padding1;
guint32 padding2 : 16;
SpCaptureAddress addrs[0]; SpCaptureAddress addrs[0];
} SpCaptureSample; } SpCaptureSample;
@ -159,7 +161,8 @@ typedef struct
{ {
SpCaptureFrame frame; SpCaptureFrame frame;
guint16 n_counters; guint16 n_counters;
guint64 padding : 48; guint32 padding1;
guint32 padding2 : 16;
SpCaptureCounter counters[0]; SpCaptureCounter counters[0];
} SpCaptureFrameCounterDefine; } SpCaptureFrameCounterDefine;
@ -178,7 +181,8 @@ typedef struct
{ {
SpCaptureFrame frame; SpCaptureFrame frame;
guint16 n_values; guint16 n_values;
guint64 padding : 48; guint32 padding1;
guint32 padding2 : 16;
SpCaptureCounterValues values[0]; SpCaptureCounterValues values[0];
} SpCaptureFrameCounterSet; } SpCaptureFrameCounterSet;

View File

@ -117,7 +117,8 @@ sp_capture_writer_frame_init (SpCaptureFrame *frame_,
frame_->pid = pid; frame_->pid = pid;
frame_->time = time_; frame_->time = time_;
frame_->type = type; frame_->type = type;
frame_->padding = 0; frame_->padding1 = 0;
frame_->padding2 = 0;
} }
static void static void
@ -1076,7 +1077,8 @@ sp_capture_writer_define_counters (SpCaptureWriter *self,
pid, pid,
time, time,
SP_CAPTURE_FRAME_CTRDEF); SP_CAPTURE_FRAME_CTRDEF);
def->padding = 0; def->padding1 = 0;
def->padding2 = 0;
def->n_counters = n_counters; def->n_counters = n_counters;
for (i = 0; i < n_counters; i++) for (i = 0; i < n_counters; i++)
@ -1137,7 +1139,8 @@ sp_capture_writer_set_counters (SpCaptureWriter *self,
pid, pid,
time, time,
SP_CAPTURE_FRAME_CTRSET); SP_CAPTURE_FRAME_CTRSET);
set->padding = 0; set->padding1 = 0;
set->padding2 = 0;
set->n_values = n_groups; set->n_values = n_groups;
for (i = 0, group = 0, field = 0; i < n_counters; i++) for (i = 0, group = 0, field = 0; i < n_counters; i++)