[Spice-devel] [[spice] 8/9] Fix -Wmissing-field-initializers
Fabiano Fidêncio
fidencio at redhat.com
Mon Sep 1 06:45:41 PDT 2014
---
server/tests/test_display_base.c | 15 ++++++---------
server/tests/test_display_resolution_changes.c | 4 ++--
server/tests/test_display_width_stride.c | 22 +++++++++++-----------
server/tests/test_playback.c | 12 ++++++------
server/tests/test_vdagent.c | 15 ++++++---------
5 files changed, 31 insertions(+), 37 deletions(-)
diff --git a/server/tests/test_display_base.c b/server/tests/test_display_base.c
index 02f3378..04dd1e8 100644
--- a/server/tests/test_display_base.c
+++ b/server/tests/test_display_base.c
@@ -815,19 +815,16 @@ static void vmc_state(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
printf("%s: %d\n", __func__, connected);
}
-static SpiceCharDeviceInterface vdagent_sif = {
- .base.type = SPICE_INTERFACE_CHAR_DEVICE,
- .base.description = "test spice virtual channel char device",
- .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
- .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
- .state = vmc_state,
- .write = vmc_write,
- .read = vmc_read,
+static SpiceBaseInterface base = {
+ .type = SPICE_INTERFACE_CHAR_DEVICE,
+ .description = "test spice virtual channel char device",
+ .major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
+ .minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
};
SpiceCharDeviceInstance vdagent_sin = {
.base = {
- .sif = &vdagent_sif.base,
+ .sif = &base,
},
.subtype = "vdagent",
};
diff --git a/server/tests/test_display_resolution_changes.c b/server/tests/test_display_resolution_changes.c
index c492653..e351e99 100644
--- a/server/tests/test_display_resolution_changes.c
+++ b/server/tests/test_display_resolution_changes.c
@@ -45,8 +45,8 @@ void set_primary_params(SPICE_GNUC_UNUSED Test *test,
}
static Command commands[] = {
- {DESTROY_PRIMARY, NULL},
- {CREATE_PRIMARY, set_primary_params},
+ {DESTROY_PRIMARY, NULL, .cb_opaque = NULL,},
+ {CREATE_PRIMARY, set_primary_params, .cb_opaque = NULL},
};
int main(void)
diff --git a/server/tests/test_display_width_stride.c b/server/tests/test_display_width_stride.c
index a071e74..77d3c12 100644
--- a/server/tests/test_display_width_stride.c
+++ b/server/tests/test_display_width_stride.c
@@ -66,17 +66,17 @@ void set_destroy_parameters(SPICE_GNUC_UNUSED Test *test,
}
static Command commands[] = {
- {SIMPLE_CREATE_SURFACE, set_surface_params},
- {SIMPLE_DRAW_SOLID, set_draw_parameters},
- {SIMPLE_DRAW_SOLID, set_draw_parameters},
- {SIMPLE_DRAW_SOLID, set_draw_parameters},
- {SIMPLE_DRAW_SOLID, set_draw_parameters},
- {SIMPLE_DRAW_SOLID, set_draw_parameters},
- {SIMPLE_DRAW_SOLID, set_draw_parameters},
- {SIMPLE_DRAW_SOLID, set_draw_parameters},
- {SIMPLE_DRAW_SOLID, set_draw_parameters},
- {SIMPLE_DRAW_SOLID, set_draw_parameters},
- {SIMPLE_DESTROY_SURFACE, set_destroy_parameters},
+ {SIMPLE_CREATE_SURFACE, set_surface_params, .cb_opaque = NULL},
+ {SIMPLE_DRAW_SOLID, set_draw_parameters, .cb_opaque = NULL},
+ {SIMPLE_DRAW_SOLID, set_draw_parameters, .cb_opaque = NULL},
+ {SIMPLE_DRAW_SOLID, set_draw_parameters, .cb_opaque = NULL},
+ {SIMPLE_DRAW_SOLID, set_draw_parameters, .cb_opaque = NULL},
+ {SIMPLE_DRAW_SOLID, set_draw_parameters, .cb_opaque = NULL},
+ {SIMPLE_DRAW_SOLID, set_draw_parameters, .cb_opaque = NULL},
+ {SIMPLE_DRAW_SOLID, set_draw_parameters, .cb_opaque = NULL},
+ {SIMPLE_DRAW_SOLID, set_draw_parameters, .cb_opaque = NULL},
+ {SIMPLE_DRAW_SOLID, set_draw_parameters, .cb_opaque = NULL},
+ {SIMPLE_DESTROY_SURFACE, set_destroy_parameters, .cb_opaque = NULL},
};
void on_client_connected(Test *test)
diff --git a/server/tests/test_playback.c b/server/tests/test_playback.c
index b31f92d..d1742de 100644
--- a/server/tests/test_playback.c
+++ b/server/tests/test_playback.c
@@ -21,11 +21,11 @@
SpicePlaybackInstance playback_instance;
-static const SpicePlaybackInterface playback_sif = {
- .base.type = SPICE_INTERFACE_PLAYBACK,
- .base.description = "test playback",
- .base.major_version = SPICE_INTERFACE_PLAYBACK_MAJOR,
- .base.minor_version = SPICE_INTERFACE_PLAYBACK_MINOR,
+static const SpiceBaseInterface base = {
+ .type = SPICE_INTERFACE_PLAYBACK,
+ .description = "test playback",
+ .major_version = SPICE_INTERFACE_PLAYBACK_MAJOR,
+ .minor_version = SPICE_INTERFACE_PLAYBACK_MINOR,
};
uint32_t *frame;
@@ -97,7 +97,7 @@ int main(void)
spice_server_set_noauth(server);
spice_server_init(server, core);
- playback_instance.base.sif = &playback_sif.base;
+ playback_instance.base.sif = &base;
spice_server_add_interface(server, &playback_instance.base);
spice_server_playback_start(&playback_instance);
diff --git a/server/tests/test_vdagent.c b/server/tests/test_vdagent.c
index 7a56c2a..191ad05 100644
--- a/server/tests/test_vdagent.c
+++ b/server/tests/test_vdagent.c
@@ -79,14 +79,11 @@ static void vmc_state(SPICE_GNUC_UNUSED SpiceCharDeviceInstance *sin,
{
}
-static SpiceCharDeviceInterface vmc_interface = {
- .base.type = SPICE_INTERFACE_CHAR_DEVICE,
- .base.description = "test spice virtual channel char device",
- .base.major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
- .base.minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
- .state = vmc_state,
- .write = vmc_write,
- .read = vmc_read,
+static SpiceBaseInterface base = {
+ .type = SPICE_INTERFACE_CHAR_DEVICE,
+ .description = "test spice virtual channel char device",
+ .major_version = SPICE_INTERFACE_CHAR_DEVICE_MAJOR,
+ .minor_version = SPICE_INTERFACE_CHAR_DEVICE_MINOR,
};
SpiceCharDeviceInstance vmc_instance = {
@@ -100,7 +97,7 @@ int main(void)
core = basic_event_loop_init();
test = test_new(core);
- vmc_instance.base.sif = &vmc_interface.base;
+ vmc_instance.base.sif = &base;
spice_server_add_interface(test->server, &vmc_instance.base);
ping_timer = core->timer_add(pinger, NULL);
--
1.9.3
More information about the Spice-devel
mailing list