[Spice-devel] [PATCH 2/6] some minor cleanup on previous patch

Frediano Ziglio fziglio at redhat.com
Fri May 6 09:34:49 UTC 2016


This patch should be squashed in the previous.
- make some function static;
- remove unused functions and structures;
- remove not necessary includes;
- indentation fixes.

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/main-channel-client.c | 11 ++++-------
 server/main-channel-client.h | 16 +++-------------
 server/red-worker.c          |  1 -
 server/reds.c                |  1 -
 server/sound.c               |  1 -
 server/stream.c              |  1 -
 6 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/server/main-channel-client.c b/server/main-channel-client.c
index bed0f55..bac5316 100644
--- a/server/main-channel-client.c
+++ b/server/main-channel-client.c
@@ -58,7 +58,9 @@ struct MainChannelClient {
     int seamless_mig_dst;
 };
 
-RedPipeItem *main_notify_item_new(void *data, int num)
+static int main_channel_client_push_ping(MainChannelClient *mcc, int size);
+
+static RedPipeItem *main_notify_item_new(void *data, int num)
 {
     RedNotifyPipeItem *item = spice_malloc(sizeof(RedNotifyPipeItem));
     const char *msg = data;
@@ -94,7 +96,7 @@ static RedPipeItem *red_ping_item_new(int size)
     return &item->base;
 }
 
-int main_channel_client_push_ping(MainChannelClient *mcc, int size)
+static int main_channel_client_push_ping(MainChannelClient *mcc, int size)
 {
     RedPipeItem *item;
 
@@ -400,11 +402,6 @@ gboolean main_channel_client_migrate_src_complete(MainChannelClient *mcc,
     return ret;
 }
 
-uint32_t main_channel_client_get_link_id(MainChannelClient *mcc)
-{
-    return mcc->connection_id;
-}
-
 #ifdef RED_STATISTICS
 static void do_ping_client(MainChannelClient *mcc,
     const char *opt, int has_interval, int interval)
diff --git a/server/main-channel-client.h b/server/main-channel-client.h
index e103edc..7e4daf9 100644
--- a/server/main-channel-client.h
+++ b/server/main-channel-client.h
@@ -23,9 +23,9 @@ typedef struct MainChannel MainChannel;
 typedef struct MainChannelClient MainChannelClient;
 
 MainChannelClient *main_channel_client_create(MainChannel *main_chan, RedClient *client,
-                                                     RedsStream *stream, uint32_t connection_id,
-                                                     int num_common_caps, uint32_t *common_caps,
-                                                     int num_caps, uint32_t *caps);
+                                              RedsStream *stream, uint32_t connection_id,
+                                              int num_common_caps, uint32_t *common_caps,
+                                              int num_caps, uint32_t *caps);
 
 void main_channel_client_push_agent_tokens(MainChannelClient *mcc, uint32_t num_tokens);
 void main_channel_client_push_agent_data(MainChannelClient *mcc, uint8_t* data, size_t len,
@@ -54,11 +54,8 @@ void main_channel_client_migrate_dst_complete(MainChannelClient *mcc);
 gboolean main_channel_client_migrate_src_complete(MainChannelClient *mcc,
                                                   gboolean success);
 
-int main_channel_client_push_ping(MainChannelClient *mcc, int size);
 void main_channel_client_handle_pong(MainChannelClient *mcc, SpiceMsgPing *ping, uint32_t size);
 
-uint32_t main_channel_client_get_link_id(MainChannelClient *mcc);
-
 /*
  * return TRUE if network test had been completed successfully.
  * If FALSE, bitrate_per_sec is set to MAX_UINT64 and the roundtrip is set to 0
@@ -99,11 +96,6 @@ enum {
     RED_PIPE_ITEM_TYPE_MAIN_AGENT_CONNECTED_TOKENS,
 };
 
-typedef struct RefsPipeItem {
-    RedPipeItem base;
-    int *refs;
-} RefsPipeItem;
-
 typedef struct RedPingPipeItem {
     RedPipeItem base;
     int size;
@@ -158,6 +150,4 @@ typedef struct RedMultiMediaTimePipeItem {
     int time;
 } RedMultiMediaTimePipeItem;
 
-RedPipeItem *main_notify_item_new(void *data, int num);
-
 #endif /* __MAIN_CHANNEL_CLIENT_H__ */
diff --git a/server/red-worker.c b/server/red-worker.c
index f21fefb..aa04988 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -51,7 +51,6 @@
 #include "red-worker.h"
 #include "cursor-channel.h"
 #include "tree.h"
-#include "main-channel-client.h"
 
 #define CMD_RING_POLL_TIMEOUT 10 //milli
 #define CMD_RING_POLL_RETRIES 1
diff --git a/server/reds.c b/server/reds.c
index 88c3407..67c262a 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -57,7 +57,6 @@
 #include "agent-msg-filter.h"
 #include "inputs-channel.h"
 #include "main-channel.h"
-#include "main-channel-client.h"
 #include "red-qxl.h"
 #include "main-dispatcher.h"
 #include "sound.h"
diff --git a/server/sound.c b/server/sound.c
index d790c7a..aae841c 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -32,7 +32,6 @@
 #include "spice.h"
 #include "red-common.h"
 #include "main-channel.h"
-#include "main-channel-client.h"
 #include "reds.h"
 #include "red-qxl.h"
 #include "sound.h"
diff --git a/server/stream.c b/server/stream.c
index ca2cdaa..8884480 100644
--- a/server/stream.c
+++ b/server/stream.c
@@ -20,7 +20,6 @@
 
 #include "stream.h"
 #include "display-channel.h"
-#include "main-channel-client.h"
 
 #define FPS_TEST_INTERVAL 1
 #define FOREACH_STREAMS(display, item)                  \
-- 
2.5.5



More information about the Spice-devel mailing list