[Spice-devel] [RFC v4 01/62] server/red_channel: renames to use _proc postfix consistently

Marc-André Lureau marcandre.lureau at gmail.com
Mon May 2 16:53:40 PDT 2011


It looks like it is later reverted in the patch:

server/red_worker: split display and cursor channels

The current code style tends to reserve _proc for function type name
only. Should we try to keep it that way?

On Tue, Apr 26, 2011 at 12:54 PM, Alon Levy <alevy at redhat.com> wrote:
> s/channel_handle_migrate_flush_mark/channel_handle_migrate_flush_mark_proc/
> s/channel_handle_migrate_data_get_serial/channel_handle_migrate_data_get_serial_proc/
> s/channel_handle_migrate_data/channel_handle_migrate_data_proc/
> ---
>  server/main_channel.c      |    8 ++++----
>  server/red_channel.c       |   16 ++++++++--------
>  server/red_channel.h       |   24 ++++++++++++------------
>  server/red_tunnel_worker.c |    4 ++--
>  server/red_worker.c        |   10 +++++-----
>  5 files changed, 31 insertions(+), 31 deletions(-)
>
> diff --git a/server/main_channel.c b/server/main_channel.c
> index 1f407e2..70255d7 100644
> --- a/server/main_channel.c
> +++ b/server/main_channel.c
> @@ -418,7 +418,7 @@ static void main_channel_marshall_migrate_data_item(SpiceMarshaller *m, int seri
>     data->ping_id = ping_id;
>  }
>
> -static uint64_t main_channel_handle_migrate_data_get_serial(RedChannel *base,
> +static uint64_t main_channel_handle_migrate_data_get_serial_proc(RedChannel *base,
>     uint32_t size, void *message)
>  {
>     MainMigrateData *data = message;
> @@ -786,7 +786,7 @@ static void main_channel_hold_pipe_item(RedChannel *channel, PipeItem *item)
>  {
>  }
>
> -static int main_channel_handle_migrate_flush_mark(RedChannel *base)
> +static int main_channel_handle_migrate_flush_mark_proc(RedChannel *base)
>  {
>     main_channel_push_migrate_data_item(SPICE_CONTAINEROF(base, MainChannel, base));
>     return TRUE;
> @@ -812,9 +812,9 @@ static void main_channel_link(Channel *channel, RedsStream *stream, int migratio
>         ,main_channel_release_pipe_item
>         ,main_channel_on_error
>         ,main_channel_on_error
> -        ,main_channel_handle_migrate_flush_mark
> +        ,main_channel_handle_migrate_flush_mark_proc
>         ,main_channel_handle_migrate_data
> -        ,main_channel_handle_migrate_data_get_serial);
> +        ,main_channel_handle_migrate_data_get_serial_proc);
>     ASSERT(main_chan);
>     channel->data = main_chan;
>  }
> diff --git a/server/red_channel.c b/server/red_channel.c
> index fe4c614..b9e0324 100644
> --- a/server/red_channel.c
> +++ b/server/red_channel.c
> @@ -326,9 +326,9 @@ RedChannel *red_channel_create(int size, RedsStream *stream,
>                                channel_hold_pipe_item_proc hold_item,
>                                channel_send_pipe_item_proc send_item,
>                                channel_release_pipe_item_proc release_item,
> -                               channel_handle_migrate_flush_mark handle_migrate_flush_mark,
> -                               channel_handle_migrate_data handle_migrate_data,
> -                               channel_handle_migrate_data_get_serial handle_migrate_data_get_serial)
> +                               channel_handle_migrate_flush_mark_proc handle_migrate_flush_mark,
> +                               channel_handle_migrate_data_proc handle_migrate_data,
> +                               channel_handle_migrate_data_get_serial_proc handle_migrate_data_get_serial)
>  {
>     RedChannel *channel;
>
> @@ -420,9 +420,9 @@ RedChannel *red_channel_create_parser(int size, RedsStream *stream,
>                                channel_release_pipe_item_proc release_item,
>                                channel_on_incoming_error_proc incoming_error,
>                                channel_on_outgoing_error_proc outgoing_error,
> -                               channel_handle_migrate_flush_mark handle_migrate_flush_mark,
> -                               channel_handle_migrate_data handle_migrate_data,
> -                               channel_handle_migrate_data_get_serial handle_migrate_data_get_serial)
> +                               channel_handle_migrate_flush_mark_proc handle_migrate_flush_mark,
> +                               channel_handle_migrate_data_proc handle_migrate_data,
> +                               channel_handle_migrate_data_get_serial_proc handle_migrate_data_get_serial)
>  {
>     RedChannel *channel = red_channel_create(size, stream,
>         core, migrate, handle_acks, config_socket, do_nothing_disconnect,
> @@ -472,7 +472,7 @@ void red_channel_init_outgoing_messages_window(RedChannel *channel)
>     red_channel_push(channel);
>  }
>
> -void red_channel_handle_migrate_flush_mark(RedChannel *channel)
> +void red_channel_handle_migrate_flush_mark_proc(RedChannel *channel)
>  {
>     if (channel->handle_migrate_flush_mark) {
>         channel->handle_migrate_flush_mark(channel);
> @@ -510,7 +510,7 @@ int red_channel_handle_message(RedChannel *channel, uint32_t size,
>     case SPICE_MSGC_DISCONNECTING:
>         break;
>     case SPICE_MSGC_MIGRATE_FLUSH_MARK:
> -        red_channel_handle_migrate_flush_mark(channel);
> +        red_channel_handle_migrate_flush_mark_proc(channel);
>         break;
>     case SPICE_MSGC_MIGRATE_DATA:
>         red_channel_handle_migrate_data(channel, size, message);
> diff --git a/server/red_channel.h b/server/red_channel.h
> index 97da5a8..d05722c 100644
> --- a/server/red_channel.h
> +++ b/server/red_channel.h
> @@ -131,10 +131,10 @@ typedef void (*channel_release_pipe_item_proc)(RedChannel *channel,
>  typedef void (*channel_on_incoming_error_proc)(RedChannel *channel);
>  typedef void (*channel_on_outgoing_error_proc)(RedChannel *channel);
>
> -typedef int (*channel_handle_migrate_flush_mark)(RedChannel *channel);
> -typedef uint64_t (*channel_handle_migrate_data)(RedChannel *channel,
> +typedef int (*channel_handle_migrate_flush_mark_proc)(RedChannel *channel);
> +typedef uint64_t (*channel_handle_migrate_data_proc)(RedChannel *channel,
>                                                 uint32_t size, void *message);
> -typedef uint64_t (*channel_handle_migrate_data_get_serial)(RedChannel *channel,
> +typedef uint64_t (*channel_handle_migrate_data_get_serial_proc)(RedChannel *channel,
>                                             uint32_t size, void *message);
>
>  struct RedChannel {
> @@ -180,9 +180,9 @@ struct RedChannel {
>     channel_on_outgoing_error_proc on_outgoing_error;
>     int shut; /* signal channel is to be closed */
>
> -    channel_handle_migrate_flush_mark handle_migrate_flush_mark;
> -    channel_handle_migrate_data handle_migrate_data;
> -    channel_handle_migrate_data_get_serial handle_migrate_data_get_serial;
> +    channel_handle_migrate_flush_mark_proc handle_migrate_flush_mark;
> +    channel_handle_migrate_data_proc handle_migrate_data;
> +    channel_handle_migrate_data_get_serial_proc handle_migrate_data_get_serial;
>  #ifdef RED_STATISTICS
>     uint64_t *out_bytes_counter;
>  #endif
> @@ -201,9 +201,9 @@ RedChannel *red_channel_create(int size, RedsStream *stream,
>                                channel_hold_pipe_item_proc hold_item,
>                                channel_send_pipe_item_proc send_item,
>                                channel_release_pipe_item_proc release_item,
> -                               channel_handle_migrate_flush_mark handle_migrate_flush_mark,
> -                               channel_handle_migrate_data handle_migrate_data,
> -                               channel_handle_migrate_data_get_serial handle_migrate_data_get_serial);
> +                               channel_handle_migrate_flush_mark_proc handle_migrate_flush_mark,
> +                               channel_handle_migrate_data_proc handle_migrate_data,
> +                               channel_handle_migrate_data_get_serial_proc handle_migrate_data_get_serial);
>
>  /* alternative constructor, meant for marshaller based (inputs,main) channels,
>  * will become default eventually */
> @@ -220,9 +220,9 @@ RedChannel *red_channel_create_parser(int size, RedsStream *stream,
>                                channel_release_pipe_item_proc release_item,
>                                channel_on_incoming_error_proc incoming_error,
>                                channel_on_outgoing_error_proc outgoing_error,
> -                               channel_handle_migrate_flush_mark handle_migrate_flush_mark,
> -                               channel_handle_migrate_data handle_migrate_data,
> -                               channel_handle_migrate_data_get_serial handle_migrate_data_get_serial);
> +                               channel_handle_migrate_flush_mark_proc handle_migrate_flush_mark,
> +                               channel_handle_migrate_data_proc handle_migrate_data,
> +                               channel_handle_migrate_data_get_serial_proc handle_migrate_data_get_serial);
>
>  int red_channel_is_connected(RedChannel *channel);
>
> diff --git a/server/red_tunnel_worker.c b/server/red_tunnel_worker.c
> index b27fdee..5df801c 100644
> --- a/server/red_tunnel_worker.c
> +++ b/server/red_tunnel_worker.c
> @@ -2156,7 +2156,7 @@ static inline void tunnel_channel_activate_migrated_sockets(TunnelChannel *chann
>     }
>  }
>
> -static uint64_t tunnel_channel_handle_migrate_data_get_serial(RedChannel *base,
> +static uint64_t tunnel_channel_handle_migrate_data_get_serial_proc(RedChannel *base,
>                                               uint32_t size, void *msg)
>  {
>     TunnelMigrateData *migrate_data = msg;
> @@ -3424,7 +3424,7 @@ static void handle_tunnel_channel_link(Channel *channel, RedsStream *stream, int
>                                             tunnel_channel_release_pipe_item,
>                                             tunnel_channel_handle_migrate_mark,
>                                             tunnel_channel_handle_migrate_data,
> -                                            tunnel_channel_handle_migrate_data_get_serial);
> +                                            tunnel_channel_handle_migrate_data_get_serial_proc);
>
>     if (!tunnel_channel) {
>         return;
> diff --git a/server/red_worker.c b/server/red_worker.c
> index 83f1798..3163ea6 100644
> --- a/server/red_worker.c
> +++ b/server/red_worker.c
> @@ -8892,7 +8892,7 @@ static int display_channel_handle_migrate_mark(RedChannel *base)
>     return TRUE;
>  }
>
> -static uint64_t display_channel_handle_migrate_data_get_serial(
> +static uint64_t display_channel_handle_migrate_data_get_serial_proc(
>                 RedChannel *base, uint32_t size, void *message)
>  {
>     DisplayChannelMigrateData *migrate_data = message;
> @@ -9032,9 +9032,9 @@ static RedChannel *__new_channel(RedWorker *worker, int size, uint32_t channel_i
>                                  channel_hold_pipe_item_proc hold_item,
>                                  channel_release_pipe_item_proc release_item,
>                                  channel_handle_parsed_proc handle_parsed,
> -                                 channel_handle_migrate_flush_mark handle_migrate_flush_mark,
> -                                 channel_handle_migrate_data handle_migrate_data,
> -                                 channel_handle_migrate_data_get_serial handle_migrate_data_get_serial)
> +                                 channel_handle_migrate_flush_mark_proc handle_migrate_flush_mark,
> +                                 channel_handle_migrate_data_proc handle_migrate_data,
> +                                 channel_handle_migrate_data_get_serial_proc handle_migrate_data_get_serial)
>  {
>     struct epoll_event event;
>     RedChannel *channel;
> @@ -9162,7 +9162,7 @@ static void handle_new_display_channel(RedWorker *worker, RedsStream *stream, in
>                                                             display_channel_handle_message,
>                                                             display_channel_handle_migrate_mark,
>                                                             display_channel_handle_migrate_data,
> -                                                            display_channel_handle_migrate_data_get_serial
> +                                                            display_channel_handle_migrate_data_get_serial_proc
>                                                             ))) {
>         return;
>     }
> --
> 1.7.4.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>



-- 
Marc-André Lureau


More information about the Spice-devel mailing list