[Spice-devel] [PATCH spice-gtk 2/2] spice-widget: Use proper pointer type for channel_new/channel_destroy

Christophe Fergeau cfergeau at redhat.com
Tue Jul 17 10:21:02 UTC 2018


On Tue, Jul 17, 2018 at 07:57:54AM +0100, Frediano Ziglio wrote:
> No need to pass a generic pointer.
> 

This is also used as a callback:
    spice_g_signal_connect_object(d->session, "channel-new",
                                  G_CALLBACK(channel_new), display, 0);
and the 'expected' type for the last argument is a gpointer. Nothing
checks for it/should be impacted by this change though. I'd squash the
first patch into this one fwiw.

Acked-by: Christophe Fergeau <cfergeau at redhat.com>

Christophe


> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  src/spice-widget.c | 10 ++++------
>  1 file changed, 4 insertions(+), 6 deletions(-)
> 
> diff --git a/src/spice-widget.c b/src/spice-widget.c
> index c794350a..97893591 100644
> --- a/src/spice-widget.c
> +++ b/src/spice-widget.c
> @@ -111,8 +111,8 @@ static void update_mouse_grab(SpiceDisplay *display);
>  static void try_mouse_grab(SpiceDisplay *display);
>  static void try_mouse_ungrab(SpiceDisplay *display);
>  static void recalc_geometry(GtkWidget *widget);
> -static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data);
> -static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer data);
> +static void channel_new(SpiceSession *s, SpiceChannel *channel, SpiceDisplay *display);
> +static void channel_destroy(SpiceSession *s, SpiceChannel *channel, SpiceDisplay *display);
>  static void cursor_invalidate(SpiceDisplay *display);
>  static void update_area(SpiceDisplay *display, gint x, gint y, gint width, gint height);
>  static void release_keys(SpiceDisplay *display);
> @@ -2976,9 +2976,8 @@ static void gl_draw(SpiceDisplay *display,
>  }
>  #endif
>  
> -static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data)
> +static void channel_new(SpiceSession *s, SpiceChannel *channel, SpiceDisplay *display)
>  {
> -    SpiceDisplay *display = data;
>      SpiceDisplayPrivate *d = display->priv;
>      int id;
>  
> @@ -3069,9 +3068,8 @@ static void channel_new(SpiceSession *s, SpiceChannel *channel, gpointer data)
>      return;
>  }
>  
> -static void channel_destroy(SpiceSession *s, SpiceChannel *channel, gpointer data)
> +static void channel_destroy(SpiceSession *s, SpiceChannel *channel, SpiceDisplay *display)
>  {
> -    SpiceDisplay *display = data;
>      SpiceDisplayPrivate *d = display->priv;
>      int id;
>  
> -- 
> 2.17.1
> 
> _______________________________________________
> 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: 833 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20180717/1d361d7c/attachment-0001.sig>


More information about the Spice-devel mailing list