[Spice-commits] server/red-channel.c

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Aug 2 10:12:01 UTC 2019


 server/red-channel.c |   20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)

New commits:
commit 314c57c233e34b0d35824b0edfa01ece69e7f754
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Mon May 27 20:17:39 2019 +0100

    red-channel: Inline red_channel_pipes_create_batch
    
    The function is called only by red_channel_pipes_new_add.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Victor Toso <victortoso at redhat.com>

diff --git a/server/red-channel.c b/server/red-channel.c
index e09edacf..c36b68dc 100644
--- a/server/red-channel.c
+++ b/server/red-channel.c
@@ -598,32 +598,27 @@ static bool red_channel_no_item_being_sent(RedChannel *channel)
  * TODO - inline? macro? right now this is the simplest from code amount
  */
 
-typedef void (*rcc_item_t)(RedChannelClient *rcc, RedPipeItem *item);
-
 /**
- * red_channel_pipes_create_batch:
+ * red_channel_pipes_new_add:
  * @channel: a channel
  * @creator: a callback to create pipe item (not null)
  * @data: the data to pass to the creator
- * @pipe_add: a callback to add non-null pipe items (not null)
  *
  * Returns: the number of added items
  **/
-static int red_channel_pipes_create_batch(RedChannel *channel,
-                                new_pipe_item_t creator, void *data,
-                                rcc_item_t pipe_add)
+int red_channel_pipes_new_add(RedChannel *channel,
+                              new_pipe_item_t creator, void *data)
 {
     RedChannelClient *rcc;
     RedPipeItem *item;
     int num = 0, n = 0;
 
     spice_assert(creator != NULL);
-    spice_assert(pipe_add != NULL);
 
     FOREACH_CLIENT(channel, rcc) {
         item = (*creator)(rcc, data, num++);
         if (item) {
-            (*pipe_add)(rcc, item);
+            red_channel_client_pipe_add(rcc, item);
             n++;
         }
     }
@@ -631,13 +626,6 @@ static int red_channel_pipes_create_batch(RedChannel *channel,
     return n;
 }
 
-int red_channel_pipes_new_add(RedChannel *channel,
-                              new_pipe_item_t creator, void *data)
-{
-    return red_channel_pipes_create_batch(channel, creator, data,
-                                          red_channel_client_pipe_add);
-}
-
 uint32_t red_channel_max_pipe_size(RedChannel *channel)
 {
     RedChannelClient *rcc;


More information about the Spice-commits mailing list