[Spice-devel] [PATCH spice 6/9] red-channel: constify some callback structs

Frediano Ziglio fziglio at redhat.com
Thu Dec 10 10:44:30 PST 2015


> 
> From: Marc-André Lureau <mlureau at redhat.com>
> 
> Because we can.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau at gmail.com>
> ---
>  server/red-channel.c | 6 +++---
>  server/red-channel.h | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/server/red-channel.c b/server/red-channel.c
> index 2a64bc8..ce4c691 100644
> --- a/server/red-channel.c
> +++ b/server/red-channel.c
> @@ -1014,7 +1014,7 @@ RedChannel *red_channel_create(int size,
>                                 uint32_t type, uint32_t id,
>                                 int handle_acks,
>                                 channel_handle_message_proc handle_message,
> -                               ChannelCbs *channel_cbs,
> +                               const ChannelCbs *channel_cbs,
>                                 uint32_t migration_flags)
>  {
>      RedChannel *channel;
> @@ -1130,7 +1130,7 @@ RedChannel *red_channel_create_parser(int size,
>                                 int handle_acks,
>                                 spice_parse_channel_func_t parser,
>                                 channel_handle_parsed_proc handle_parsed,
> -                               ChannelCbs *channel_cbs,
> +                               const ChannelCbs *channel_cbs,
>                                 uint32_t migration_flags)
>  {
>      RedChannel *channel = red_channel_create(size, core, type, id,
> @@ -1159,7 +1159,7 @@ void red_channel_set_stat_node(RedChannel *channel,
> StatNodeRef stat)
>  #endif
>  }
>  
> -void red_channel_register_client_cbs(RedChannel *channel, ClientCbs
> *client_cbs)
> +void red_channel_register_client_cbs(RedChannel *channel, const ClientCbs
> *client_cbs)
>  {
>      spice_assert(client_cbs->connect || channel->type ==
>      SPICE_CHANNEL_MAIN);
>      channel->client_cbs.connect = client_cbs->connect;
> diff --git a/server/red-channel.h b/server/red-channel.h
> index 8369a94..609bce3 100644
> --- a/server/red-channel.h
> +++ b/server/red-channel.h
> @@ -363,7 +363,7 @@ RedChannel *red_channel_create(int size,
>                                 uint32_t type, uint32_t id,
>                                 int handle_acks,
>                                 channel_handle_message_proc handle_message,
> -                               ChannelCbs *channel_cbs,
> +                               const ChannelCbs *channel_cbs,
>                                 uint32_t migration_flags);
>  
>  /* alternative constructor, meant for marshaller based (inputs,main)
>  channels,
> @@ -374,11 +374,11 @@ RedChannel *red_channel_create_parser(int size,
>                                 int handle_acks,
>                                 spice_parse_channel_func_t parser,
>                                 channel_handle_parsed_proc handle_parsed,
> -                               ChannelCbs *channel_cbs,
> +                               const ChannelCbs *channel_cbs,
>                                 uint32_t migration_flags);
>  void red_channel_set_stat_node(RedChannel *channel, StatNodeRef stat);
>  
> -void red_channel_register_client_cbs(RedChannel *channel, ClientCbs
> *client_cbs);
> +void red_channel_register_client_cbs(RedChannel *channel, const ClientCbs
> *client_cbs);
>  // caps are freed when the channel is destroyed
>  void red_channel_set_common_cap(RedChannel *channel, uint32_t cap);
>  void red_channel_set_cap(RedChannel *channel, uint32_t cap);
> --
> 2.5.0
> 

Acked-by: Frediano Ziglio <fziglio at redhat.com>

Frediano


More information about the Spice-devel mailing list