[Spice-devel] [server PATCH 2/8] red_worker: reuse DCC_FOREACH in WORKER_DCC_FOREACH
Uri Lublin
uril at redhat.com
Mon Jul 8 03:32:24 PDT 2013
The only thing that is needed is to get the channel out of the worker.
---
server/red_worker.c | 11 ++++-------
1 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/server/red_worker.c b/server/red_worker.c
index a7f8d79..8503d16 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,\
--
1.7.1
More information about the Spice-devel
mailing list