From 2af81e96f54d9deed52231b4c8cea79623b68fab Mon Sep 17 00:00:00 2001 From: Uri Lublin Date: Thu, 27 Jun 2013 00:36:34 +0300 Subject: red_worker: use only DRAWABLE_FOREACH_GLZ_SAFE --- server/red_worker.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index 0599a0eb..ffd278ce 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; } -- cgit