[Spice-devel] [server PATCH 4/8] red_worker: use only DRAWABLE_FOREACH_GLZ_SAFE

Uri Lublin uril at redhat.com
Mon Jul 8 03:32:26 PDT 2013


---
 server/red_worker.c |   11 ++---------
 1 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index 0599a0e..ffd278c 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -1146,13 +1146,6 @@ static inline uint64_t red_now(void);
          (link) = ring_next(&(drawable)->pipes, (link)),\
          dpi = (link) ? SPICE_CONTAINEROF((link), DrawablePipeItem, base) : NULL)
 
-#define DRAWABLE_FOREACH_GLZ(drawable, link, glz) \
-    for (link = (drawable) ? ring_get_head(&drawable->glz_ring) : NULL,\
-        glz = (link) ? SPICE_CONTAINEROF((link), RedGlzDrawable, drawable_link) : NULL;\
-        (link);\
-        (link) = ring_next(&drawable->glz_ring, (link)),\
-        glz = (link) ? SPICE_CONTAINEROF((link), RedGlzDrawable, drawable_link) : NULL)
-
 #define DRAWABLE_FOREACH_GLZ_SAFE(drawable, link, next, glz) \
     for (link = (drawable) ? ring_get_head(&drawable->glz_ring) : NULL,\
         next = (link) ? ring_next(&drawable->glz_ring, link) : NULL,\
@@ -5547,12 +5540,12 @@ static void red_display_destroy_compress_bufs(DisplayChannel *display_channel)
 static RedGlzDrawable *red_display_get_glz_drawable(DisplayChannelClient *dcc, Drawable *drawable)
 {
     RedGlzDrawable *ret;
-    RingItem *item;
+    RingItem *item, *next;
 
     // TODO - I don't really understand what's going on here, so doing the technical equivalent
     // now that we have multiple glz_dicts, so the only way to go from dcc to drawable glz is to go
     // over the glz_ring (unless adding some better data structure then a ring)
-    DRAWABLE_FOREACH_GLZ(drawable, item, ret) {
+    DRAWABLE_FOREACH_GLZ_SAFE(drawable, item, next, ret) {
         if (ret->dcc == dcc) {
             return ret;
         }
-- 
1.7.1



More information about the Spice-devel mailing list