[Spice-devel] [PATCH 10/11] reds: Remove spice_char_device_state_create()

Frediano Ziglio fziglio at redhat.com
Fri Apr 1 12:37:48 UTC 2016


From: Christophe Fergeau <cfergeau at redhat.com>

Nothing is using it anymore now that CharDevice classes are
gobjectified.
---
 server/char-device.c | 42 ------------------------------------------
 server/char-device.h |  9 +--------
 2 files changed, 1 insertion(+), 50 deletions(-)

diff --git a/server/char-device.c b/server/char-device.c
index f492657..693e8bb 100644
--- a/server/char-device.c
+++ b/server/char-device.c
@@ -103,13 +103,6 @@ typedef struct RedCharDeviceMsgToClientItem {
     RedCharDeviceMsgToClient *msg;
 } RedCharDeviceMsgToClientItem;
 
-static RedCharDevice *red_char_device_new(SpiceCharDeviceInstance *sin,
-                                          RedsState *reds,
-                                          uint32_t client_tokens_interval,
-                                          uint32_t self_tokens,
-                                          RedCharDeviceCallbacks *cbs,
-                                          void *opaque);
-
 static RedCharDeviceMsgToClient *
 red_char_device_read_one_msg_from_device(RedCharDevice *dev)
 {
@@ -731,17 +724,6 @@ void red_char_device_write_buffer_release(RedCharDevice *dev,
  * char_device_state management *
  ********************************/
 
-RedCharDevice *red_char_device_create(SpiceCharDeviceInstance *sin,
-                                      RedsState *reds,
-                                      uint32_t client_tokens_interval,
-                                      uint32_t self_tokens,
-                                      RedCharDeviceCallbacks *cbs,
-                                      void *opaque)
-{
-    return red_char_device_new(sin, reds, client_tokens_interval,
-                               self_tokens, cbs, opaque);
-}
-
 void red_char_device_reset_dev_instance(RedCharDevice *state,
                                         SpiceCharDeviceInstance *sin)
 {
@@ -1253,30 +1235,6 @@ red_char_device_init(RedCharDevice *self)
     g_signal_connect(self, "notify::sin", G_CALLBACK(red_char_device_on_sin_changed), NULL);
 }
 
-static RedCharDevice *
-red_char_device_new(SpiceCharDeviceInstance *sin,
-                    RedsState *reds,
-                    uint32_t client_tokens_interval,
-                    uint32_t self_tokens,
-                    RedCharDeviceCallbacks *cbs,
-                    void *opaque)
-{
-    RedCharDevice *char_dev;
-
-    char_dev = g_object_new(RED_TYPE_CHAR_DEVICE,
-                            "sin", sin,
-                            "reds", reds,
-                            "client-tokens-interval", (guint64) client_tokens_interval,
-                            "self-tokens", (guint64) self_tokens,
-                            "opaque", opaque,
-                            NULL);
-
-    /* TODO: redundant with the "opaque" property in g_object_new */
-    red_char_device_set_callbacks(char_dev, cbs, opaque);
-
-    return char_dev;
-}
-
 /* TODO: needs to be moved to class vfuncs once all child classes are gobjects */
 void
 red_char_device_set_callbacks(RedCharDevice *dev,
diff --git a/server/char-device.h b/server/char-device.h
index d92cbab..4a4045d 100644
--- a/server/char-device.h
+++ b/server/char-device.h
@@ -61,7 +61,7 @@ void red_char_device_set_callbacks(RedCharDevice *dev,
  *
  * How to use the api:
  * ==================
- * device attached: call red_char_device_create
+ * device attached: create new object instantiating a RedCharDevice child class
  * device detached: call red_char_device_destroy/reset
  *
  * client connected and associated with a device: red_char_device__add
@@ -170,13 +170,6 @@ struct RedCharDeviceCallbacks {
     void (*remove_client)(RedClient *client, void *opaque);
 };
 
-RedCharDevice *red_char_device_create(SpiceCharDeviceInstance *sin,
-                                      struct RedsState *reds,
-                                      uint32_t client_tokens_interval,
-                                      uint32_t self_tokens,
-                                      RedCharDeviceCallbacks *cbs,
-                                      void *opaque);
-
 void red_char_device_reset_dev_instance(RedCharDevice *dev,
                                         SpiceCharDeviceInstance *sin);
 void red_char_device_destroy(RedCharDevice *dev);
-- 
2.5.5



More information about the Spice-devel mailing list