[PATCH v2 3/6] RedChannel: Use more FOREACH_CLIENT macro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/red-channel.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/server/red-channel.c b/server/red-channel.c
index 9359bc4..f2aa0de 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -486,14 +486,13 @@ void red_channel_apply_clients_data(RedChannel *channel, channel_client_callback
 
 int red_channel_all_blocked(RedChannel *channel)
 {
-    GList *link;
+    GList *link, *next;
     RedChannelClient *rcc;
 
     if (!channel || !channel->clients) {
         return FALSE;
     }
-    for (link = channel->clients; link != NULL; link = link->next) {
-        rcc = link->data;
+    FOREACH_CLIENT(channel, link, next, rcc) {
         if (!red_channel_client_is_blocked(rcc)) {
             return FALSE;
         }
@@ -784,13 +783,12 @@ void red_channel_pipes_new_add_tail(RedChannel *channel, new_pipe_item_t creator
 
 uint32_t red_channel_max_pipe_size(RedChannel *channel)
 {
-    GList *link;
+    GList *link, *next;
     RedChannelClient *rcc;
     uint32_t pipe_size = 0;
 
-    for (link = channel->clients; link != NULL; link = link->next) {
+    FOREACH_CLIENT(channel, link, next, rcc) {
         uint32_t new_size;
-        rcc = link->data;
         new_size = red_channel_client_get_pipe_size(rcc);
         pipe_size = MAX(pipe_size, new_size);
     }
-- 
2.7.4

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]