From e4029833da5bde9a70993daeb78345a0f331d1c6 Mon Sep 17 00:00:00 2001 From: Uri Lublin Date: Wed, 26 Jun 2013 23:34:58 +0300 Subject: red_worker: reuse DCC_FOREACH in WORKER_DCC_FOREACH The only thing that is needed is to get the channel out of the worker. --- server/red_worker.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server/red_worker.c b/server/red_worker.c index a7f8d795..8503d166 100644 --- a/server/red_worker.c +++ b/server/red_worker.c @@ -1131,13 +1131,10 @@ static inline uint64_t red_now(void); dcc = SPICE_CONTAINEROF((link), DisplayChannelClient, common.base.channel_link)) #define WORKER_FOREACH_DCC(worker, link, dcc) \ - for (link = ((worker) && (worker)->display_channel) ?\ - ring_get_head(&(worker)->display_channel->common.base.clients) : NULL,\ - dcc = link ? SPICE_CONTAINEROF((link), DisplayChannelClient,\ - common.base.channel_link) : NULL;\ - (link); \ - (link) = ring_next(&(worker)->display_channel->common.base.clients, link),\ - dcc = SPICE_CONTAINEROF((link), DisplayChannelClient, common.base.channel_link)) + DCC_FOREACH(link, dcc, \ + ((((worker) && (worker)->display_channel))? \ + (&(worker)->display_channel->common.base) : NULL)) + #define DRAWABLE_FOREACH_DPI(drawable, link, dpi) \ for (link = (drawable) ? ring_get_head(&(drawable)->pipes) : NULL,\ -- cgit