Re: [PATCH spice-server 6/6] main-dispatcher: Avoid type conversion in dispatcher_handle_read

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Acked-by: Christophe Fergeau <cfergeau@xxxxxxxxxx>

On Thu, Sep 07, 2017 at 12:40:26PM +0100, Frediano Ziglio wrote:
> Pass proper type to callback to avoid having to convert to
> the right type for each call.
> 
> Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
> ---
> This make dispatcher_handle_read identical to handle_dev_input.
> ---
>  server/main-dispatcher.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/server/main-dispatcher.c b/server/main-dispatcher.c
> index 019bf4d3f..71f8f65d9 100644
> --- a/server/main-dispatcher.c
> +++ b/server/main-dispatcher.c
> @@ -280,9 +280,9 @@ void main_dispatcher_client_disconnect(MainDispatcher *self, RedClient *client)
>  
>  static void dispatcher_handle_read(int fd, int event, void *opaque)
>  {
> -    MainDispatcher *self = opaque;
> +    Dispatcher *dispatcher = opaque;
>  
> -    dispatcher_handle_recv_read(DISPATCHER(self));
> +    dispatcher_handle_recv_read(dispatcher);
>  }
>  
>  /*
> @@ -311,7 +311,7 @@ void main_dispatcher_constructed(GObject *object)
>          self->priv->core->watch_add(self->priv->core,
>                                      dispatcher_get_recv_fd(DISPATCHER(self)),
>                                      SPICE_WATCH_EVENT_READ, dispatcher_handle_read,
> -                                    self);
> +                                    DISPATCHER(self));
>      dispatcher_register_handler(DISPATCHER(self), MAIN_DISPATCHER_CHANNEL_EVENT,
>                                  main_dispatcher_handle_channel_event,
>                                  sizeof(MainDispatcherChannelEventMessage), 0 /* no ack */);
> -- 
> 2.13.5
> 
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]