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

Jonathon Jongsma jjongsma at redhat.com
Thu Apr 21 21:43:55 UTC 2016


---
Changes since last version:
 - split from the deprecation patch

Still not sure whether g_critical() is appropriate here vs. just removing the
code or something like that.

 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 16c7b79..b22d396 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1928,6 +1928,9 @@ void display_channel_create_surface(DisplayChannel *display, uint32_t surface_id
         QXLInstance *qxl = display->common.qxl;
         RedsState *reds = red_qxl_get_server(qxl->st);
         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 46f2cb1..453e42a 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -1620,6 +1620,7 @@ void snd_set_playback_compression(int on)
     playback_compression = !!on;
 
     for (; now; now = now->next) {
+        g_critical("untested code path");
         if (now->base_channel->type == SPICE_CHANNEL_PLAYBACK && now->connection) {
             PlaybackChannel* playback = (PlaybackChannel*)now->connection;
             SpicePlaybackState *st = SPICE_CONTAINEROF(now, SpicePlaybackState, worker);
-- 
2.4.11



More information about the Spice-devel mailing list