[Spice-devel] [PATCH spice-server 3/3] display-channel: Reuse GLIST_FOREACH macro in drawable_remove_from_pipes

Frediano Ziglio fziglio at redhat.com
Wed Dec 13 14:01:59 UTC 2017


Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/display-channel.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/server/display-channel.c b/server/display-channel.c
index 38a8a0e70..dae3eb75c 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -441,17 +441,12 @@ static void current_remove_drawable(DisplayChannel *display, Drawable *item)
 static void drawable_remove_from_pipes(Drawable *drawable)
 {
     RedDrawablePipeItem *dpi;
-    GList *l;
 
-    l = drawable->pipes;
-    while (l) {
-        GList *next = l->next;
+    GLIST_FOREACH(drawable->pipes, RedDrawablePipeItem, dpi) {
         RedChannelClient *rcc;
 
-        dpi = l->data;
         rcc = RED_CHANNEL_CLIENT(dpi->dcc);
         red_channel_client_pipe_remove_and_release(rcc, &dpi->dpi_pipe_item);
-        l = next;
     }
 }
 
-- 
2.14.3



More information about the Spice-devel mailing list