[Spice-devel] [PATCH 3/5] remove common_graphics_channel_new_client function

Frediano Ziglio fziglio at redhat.com
Sat May 7 13:49:53 UTC 2016


The function was just calling another function with same parameters

Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
 server/cursor-channel.c | 16 ++++++++--------
 server/dcc.c            |  9 +++++----
 server/red-worker.c     | 20 --------------------
 server/red-worker.h     | 10 ----------
 4 files changed, 13 insertions(+), 42 deletions(-)

diff --git a/server/cursor-channel.c b/server/cursor-channel.c
index 87abad8..967782c 100644
--- a/server/cursor-channel.c
+++ b/server/cursor-channel.c
@@ -462,14 +462,14 @@ CursorChannelClient* cursor_channel_client_new(CursorChannel *cursor, RedClient
     spice_return_val_if_fail(!num_caps || caps, NULL);
 
     CursorChannelClient *ccc =
-        (CursorChannelClient*)common_graphics_channel_new_client(&cursor->common,
-                                                                 sizeof(CursorChannelClient),
-                                                                 client, stream,
-                                                                 FALSE,
-                                                                 common_caps,
-                                                                 num_common_caps,
-                                                                 caps,
-                                                                 num_caps);
+        (CursorChannelClient*)red_channel_client_create(sizeof(CursorChannelClient),
+                                                        &cursor->common.base,
+                                                        client, stream,
+                                                        FALSE,
+                                                        num_common_caps,
+                                                        common_caps,
+                                                        num_caps,
+                                                        caps);
     spice_return_val_if_fail(ccc != NULL, NULL);
     cursor->common.during_target_migrate = mig_target;
 
diff --git a/server/dcc.c b/server/dcc.c
index f86f376..32cb5c2 100644
--- a/server/dcc.c
+++ b/server/dcc.c
@@ -364,11 +364,12 @@ DisplayChannelClient *dcc_new(DisplayChannel *display,
 {
     DisplayChannelClient *dcc;
 
-    dcc = (DisplayChannelClient*)common_graphics_channel_new_client(
-        COMMON_GRAPHICS_CHANNEL(display), sizeof(DisplayChannelClient),
+    dcc = (DisplayChannelClient*)red_channel_client_create(
+        sizeof(DisplayChannelClient),
+        &COMMON_GRAPHICS_CHANNEL(display)->base,
         client, stream, TRUE,
-        common_caps, num_common_caps,
-        caps, num_caps);
+        num_common_caps, common_caps,
+        num_caps, caps);
     display->common.during_target_migrate = mig_target;
     dcc->id = display->common.qxl->id;
     spice_return_val_if_fail(dcc, NULL);
diff --git a/server/red-worker.c b/server/red-worker.c
index ac1d471..c5830aa 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -436,26 +436,6 @@ static int common_channel_config_socket(RedChannelClient *rcc)
     return TRUE;
 }
 
-CommonGraphicsChannelClient *common_graphics_channel_new_client(CommonGraphicsChannel *common,
-                                                                int size,
-                                                                RedClient *client,
-                                                                RedsStream *stream,
-                                                                int monitor_latency,
-                                                                uint32_t *common_caps,
-                                                                int num_common_caps,
-                                                                uint32_t *caps,
-                                                                int num_caps)
-{
-    RedChannelClient *rcc =
-        red_channel_client_create(size, &common->base, client, stream, monitor_latency,
-                                  num_common_caps, common_caps, num_caps, caps);
-    if (!rcc) {
-        return NULL;
-    }
-    return (CommonGraphicsChannelClient*)rcc;
-}
-
-
 CommonGraphicsChannel *red_worker_new_channel(RedWorker *worker, int size,
                                               const char *name,
                                               uint32_t channel_type, int migration_flags,
diff --git a/server/red-worker.h b/server/red-worker.h
index 37916a9..e1ed5a7 100644
--- a/server/red-worker.h
+++ b/server/red-worker.h
@@ -103,14 +103,4 @@ CommonGraphicsChannel *red_worker_new_channel(RedWorker *worker, int size,
                                               ChannelCbs *channel_cbs,
                                               channel_handle_parsed_proc handle_parsed);
 
-CommonGraphicsChannelClient *common_graphics_channel_new_client(CommonGraphicsChannel *common,
-                                                                int size,
-                                                                RedClient *client,
-                                                                RedsStream *stream,
-                                                                int monitor_latency,
-                                                                uint32_t *common_caps,
-                                                                int num_common_caps,
-                                                                uint32_t *caps,
-                                                                int num_caps);
-
 #endif
-- 
2.5.5



More information about the Spice-devel mailing list