[Spice-devel] [PATCH 9/9] Print warnings on untested code paths

Jonathon Jongsma jjongsma at redhat.com
Fri Oct 28 17:06:29 UTC 2016


---
 server/display-channel.c | 3 +++
 server/sound.c           | 1 +
 2 files changed, 4 insertions(+)

diff --git a/server/display-channel.c b/server/display-channel.c
index b483b57..e46d067 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1904,6 +1904,9 @@ void display_channel_create_surface(DisplayChannel *display, uint32_t surface_id
         int i;
         RedsState *reds = red_channel_get_server(RED_CHANNEL(display));
         GArray *renderers = reds_get_renderers(reds);
+        /* These days, noone is trying to use multiple renderers, the software one
+         * is always used */
+        g_warn_if_fail(renderers->len == 1);
         for (i = 0; i < renderers->len; i++) {
             uint32_t renderer = g_array_index(renderers, uint32_t, i);
             surface->context.canvas = create_canvas_for_surface(display, surface, renderer);
diff --git a/server/sound.c b/server/sound.c
index c222c8d..ee88eee 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -1638,6 +1638,7 @@ void snd_set_playback_compression(int on)
     SndWorker *now = workers;
 
     for (; now; now = now->next) {
+        g_critical("untested code path");
         uint32_t type;
         g_object_get(now->base_channel, "channel-type", &type, NULL);
         if (type == SPICE_CHANNEL_PLAYBACK && now->connection) {
-- 
2.7.4



More information about the Spice-devel mailing list