Do not leave not initialized fields in the middle

Some old GNU compilers does not allow this (like CentOS 7 one)

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Frediano Ziglio 2019-05-20 21:53:57 +01:00 committed by Frediano Ziglio
parent e0b395fb68
commit 2f7474427b
6 changed files with 11 additions and 2 deletions

View File

@ -90,6 +90,8 @@ static SpiceWatch *base_watch_add(int fd, int event_mask, SpiceWatchFunc func, v
static SpiceCoreInterface core = {
.base = {
.type = NULL,
.description = NULL,
.major_version = SPICE_INTERFACE_CORE_MAJOR,
.minor_version = SPICE_INTERFACE_CORE_MINOR,
},

View File

@ -252,6 +252,7 @@ static QXLInterface display_sif = {
},
.attached_worker = attached_worker,
.set_compression_level = set_compression_level,
.set_mm_time = NULL,
.get_init_info = get_init_info,
.get_command = get_display_command,
.req_cmd_notification = req_display_notification,

View File

@ -799,6 +799,7 @@ static QXLInterface display_sif = {
},
.attached_worker = attached_worker,
.set_compression_level = set_compression_level,
.set_mm_time = NULL,
.get_init_info = get_init_info,
/* the callbacks below are called from spice server thread context */
@ -809,6 +810,8 @@ static QXLInterface display_sif = {
.req_cursor_notification = req_cursor_notification,
.notify_update = notify_update,
.flush_resources = flush_resources,
.async_complete = NULL,
.update_area_complete = NULL,
.set_client_capabilities = set_client_capabilities,
.client_monitors_config = client_monitors_config,
};

View File

@ -726,6 +726,7 @@ mock_update_client_playback_delay(void *opaque, uint32_t delay_ms)
}
static VideoEncoderRateControlCbs rate_control_cbs = {
.opaque = NULL,
.get_roundtrip_ms = mock_get_roundtrip_ms,
.get_source_fps = mock_get_source_fps,
.update_client_playback_delay = mock_update_client_playback_delay,

View File

@ -42,6 +42,7 @@ static uint8_t *add_stream_hdr(uint8_t *p, StreamMsgType type, uint32_t size)
{
StreamDevHeader hdr = {
.protocol_version = STREAM_DEVICE_PROTOCOL,
.padding = 0,
.type = GUINT16_TO_LE(type),
.size = GUINT32_TO_LE(size),
};

View File

@ -96,14 +96,15 @@ static SpiceCharDeviceInterface vmc_interface = {
};
static SpiceCharDeviceInstance vmc_instance = {
.base = { NULL },
.subtype = "vdagent",
};
static void test_multiple_vmc_devices(void)
{
SpiceCharDeviceInstance vmc_instances[2] = {
{ .subtype = "vdagent", },
{ .subtype = "vdagent", }
{ .base = { NULL }, .subtype = "vdagent", },
{ .base = { NULL }, .subtype = "vdagent", }
};
int status;