[Spice-devel] [PATCH spice-server] stream: Simplify FOREACH_STREAMS macro

Frediano Ziglio fziglio at redhat.com
Wed Sep 13 09:20:58 UTC 2017


This macro is exactly doing what RING_FOREACH just passing streams
ring.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/stream.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/server/stream.c b/server/stream.c
index 0148d1eda..51dfc8847 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -25,9 +25,7 @@
 
 #define FPS_TEST_INTERVAL 1
 #define FOREACH_STREAMS(display, item)                  \
-    for (item = ring_get_head(&(display)->priv->streams);     \
-         item != NULL;                                  \
-         item = ring_next(&(display)->priv->streams, item))
+    RING_FOREACH(item, &(display)->priv->streams)
 
 static void stream_agent_stats_print(StreamAgent *agent)
 {
-- 
2.13.5



More information about the Spice-devel mailing list