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

Christophe Fergeau cfergeau at redhat.com
Tue Apr 5 15:41:10 UTC 2016


s/spice_char_device_state_create/red_char_device_new in the short log
Looks good otherwise,

Christophe

On Fri, Apr 01, 2016 at 03:51:43PM -0500, Jonathon Jongsma wrote:
> 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.4.3
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160405/210e46dc/attachment.sig>


More information about the Spice-devel mailing list