[Spice-devel] [PATCH spice-server v2 07/12] Make some function static

Jonathon Jongsma jjongsma at redhat.com
Thu Mar 28 19:30:01 UTC 2019


Personally, I would squash this patch with the previous one

Acked-by: Jonathon Jongsma <jjongsma at redhat.com>


On Tue, 2019-03-26 at 19:10 +0000, Frediano Ziglio wrote:
> Now that stuff are a bit more on their correct place some
> function can be static.
> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/cursor-channel.c  | 11 ++++++++---
>  server/cursor-channel.h  | 10 ----------
>  server/display-channel.c | 12 +++++++++---
>  server/display-channel.h |  5 -----
>  4 files changed, 17 insertions(+), 21 deletions(-)
> 
> diff --git a/server/cursor-channel.c b/server/cursor-channel.c
> index d1294322..c88e5cd1 100644
> --- a/server/cursor-channel.c
> +++ b/server/cursor-channel.c
> @@ -335,9 +335,14 @@ void cursor_channel_set_mouse_mode(CursorChannel
> *cursor, uint32_t mode)
>      cursor->mouse_mode = mode;
>  }
>  
> -void cursor_channel_connect(CursorChannel *cursor, RedClient
> *client, RedStream *stream,
> -                            int migrate,
> -                            RedChannelCapabilities *caps)
> +/**
> + * Connect a new client to CursorChannel.
> + * This is the equivalent of RedChannel client connect callback.
> + * See comment on cursor_channel_new.
> + */
> +static void
> +cursor_channel_connect(CursorChannel *cursor, RedClient *client,
> RedStream *stream,
> +                       int migrate, RedChannelCapabilities *caps)
>  {
>      CursorChannelClient *ccc;
>  
> diff --git a/server/cursor-channel.h b/server/cursor-channel.h
> index 767325ea..ce1b92cc 100644
> --- a/server/cursor-channel.h
> +++ b/server/cursor-channel.h
> @@ -66,16 +66,6 @@
> void                 cursor_channel_do_init     (CursorChannel
> *cursor);
>  void                 cursor_channel_process_cmd (CursorChannel
> *cursor, RedCursorCmd *cursor_cmd);
>  void                 cursor_channel_set_mouse_mode(CursorChannel
> *cursor, uint32_t mode);
>  
> -/**
> - * Connect a new client to CursorChannel.
> - * This is the equivalent of RedChannel client connect callback.
> - * See comment on cursor_channel_new.
> - */
> -void                 cursor_channel_connect     (CursorChannel
> *cursor, RedClient *client,
> -                                                 RedStream *stream,
> -                                                 int migrate,
> -                                                 RedChannelCapabilit
> ies *caps);
> -
>  /**
>   * Migrate a client channel from a CursorChannel.
>   * This is the equivalent of RedChannel client migrate callback.
> diff --git a/server/display-channel.c b/server/display-channel.c
> index b8f85682..c2129c71 100644
> --- a/server/display-channel.c
> +++ b/server/display-channel.c
> @@ -26,6 +26,12 @@
>  
>  G_DEFINE_TYPE(DisplayChannel, display_channel,
> TYPE_COMMON_GRAPHICS_CHANNEL)
>  
> +static void display_channel_connect(RedChannel *channel, RedClient
> *client,
> +                                    RedStream *stream, int
> migration,
> +                                    RedChannelCapabilities *caps);
> +static void display_channel_disconnect(RedChannelClient *rcc);
> +static void display_channel_migrate(RedChannelClient *rcc);
> +
>  enum {
>      PROP0,
>      PROP_N_SURFACES,
> @@ -2595,7 +2601,7 @@ void
> display_channel_update_qxl_running(DisplayChannel *display, bool
> running)
>      }
>  }
>  
> -void
> +static void
>  display_channel_connect(RedChannel *channel, RedClient *client,
>                          RedStream *stream, int migration,
>                          RedChannelCapabilities *caps)
> @@ -2618,7 +2624,7 @@ display_channel_connect(RedChannel *channel,
> RedClient *client,
>      dcc_start(dcc);
>  }
>  
> -void display_channel_disconnect(RedChannelClient *rcc)
> +static void display_channel_disconnect(RedChannelClient *rcc)
>  {
>      DisplayChannel *display =
> DISPLAY_CHANNEL(red_channel_client_get_channel(rcc));
>  
> @@ -2645,7 +2651,7 @@ static void red_migrate_display(DisplayChannel
> *display, RedChannelClient *rcc)
>      }
>  }
>  
> -void display_channel_migrate(RedChannelClient *rcc)
> +static void display_channel_migrate(RedChannelClient *rcc)
>  {
>      DisplayChannel *display =
> DISPLAY_CHANNEL(red_channel_client_get_channel(rcc));
>      red_migrate_display(display, rcc);
> diff --git a/server/display-channel.h b/server/display-channel.h
> index 7dfedd75..8dfdf523 100644
> --- a/server/display-channel.h
> +++ b/server/display-channel.h
> @@ -159,11 +159,6 @@ void
> display_channel_reset_image_cache(DisplayChannel *self);
>  void display_channel_debug_oom(DisplayChannel *display, const char
> *msg);
>  
>  void display_channel_update_qxl_running(DisplayChannel *display,
> bool running);
> -void display_channel_connect(RedChannel *channel, RedClient *client,
> -                             RedStream *stream, int migration,
> -                             RedChannelCapabilities *caps);
> -void display_channel_disconnect(RedChannelClient *rcc);
> -void display_channel_migrate(RedChannelClient *rcc);
>  
>  G_END_DECLS
>  



More information about the Spice-devel mailing list