summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUri Lublin <uril@redhat.com>2013-06-26 23:34:58 +0300
committerUri Lublin <uril@redhat.com>2013-07-16 23:37:25 +0300
commite4029833da5bde9a70993daeb78345a0f331d1c6 (patch)
tree6783aa999db13d94c2974ceb720e993a6fec94e3
parent255abf0a5726ed203937dce61ec570842c137708 (diff)
downloadspice-e4029833da5bde9a70993daeb78345a0f331d1c6.tar.gz
spice-e4029833da5bde9a70993daeb78345a0f331d1c6.tar.xz
spice-e4029833da5bde9a70993daeb78345a0f331d1c6.zip
red_worker: reuse DCC_FOREACH in WORKER_DCC_FOREACH
The only thing that is needed is to get the channel out of the worker.
-rw-r--r--server/red_worker.c11
1 files 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,\