[spice-gtk,v1,3/3] main: code style on main_migrate_connect()

Submitted by Victor Toso on Sept. 4, 2019, 12:20 p.m.

Details

Message ID 20190904122041.23408-3-victortoso@redhat.com
State New
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Victor Toso Sept. 4, 2019, 12:20 p.m.
From: Victor Toso <me@victortoso.com>

1) Make one argument per line, instead of 1, 2, 1
2) Use session variable that already exists
3) Don't cast again to SpiceChannel

Signed-off-by: Victor Toso <victortoso@redhat.com>
---
 src/channel-main.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/channel-main.c b/src/channel-main.c
index 3d1b1b5..334be7d 100644
--- a/src/channel-main.c
+++ b/src/channel-main.c
@@ -2337,7 +2337,8 @@  static gboolean migrate_connect(gpointer data)
 
 /* coroutine context */
 static void main_migrate_connect(SpiceChannel *channel,
-                                 SpiceMigrationDstInfo *dst_info, bool do_seamless,
+                                 SpiceMigrationDstInfo *dst_info,
+                                 bool do_seamless,
                                  uint32_t src_mig_version)
 {
     SpiceMainChannelPrivate *main_priv = SPICE_MAIN_CHANNEL(channel)->priv;
@@ -2379,13 +2380,12 @@  static void main_migrate_connect(SpiceChannel *channel,
             SPICE_DEBUG("migration (semi-seamless): connections all ok");
             reply_type = SPICE_MSGC_MAIN_MIGRATE_CONNECTED;
         }
-        spice_session_start_migrating(spice_channel_get_session(channel),
-                                      mig.do_seamless);
+        spice_session_start_migrating(session, mig.do_seamless);
     }
 
 end:
     CHANNEL_DEBUG(channel, "migrate connect reply %d", reply_type);
-    out = spice_msg_out_new(SPICE_CHANNEL(channel), reply_type);
+    out = spice_msg_out_new(channel, reply_type);
     spice_msg_out_send(out);
 }
 

Comments

> 
> From: Victor Toso <me@victortoso.com>
> 
> 1) Make one argument per line, instead of 1, 2, 1
> 2) Use session variable that already exists
> 3) Don't cast again to SpiceChannel
> 
> Signed-off-by: Victor Toso <victortoso@redhat.com>

Acked.

> ---
>  src/channel-main.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/channel-main.c b/src/channel-main.c
> index 3d1b1b5..334be7d 100644
> --- a/src/channel-main.c
> +++ b/src/channel-main.c
> @@ -2337,7 +2337,8 @@ static gboolean migrate_connect(gpointer data)
>  
>  /* coroutine context */
>  static void main_migrate_connect(SpiceChannel *channel,
> -                                 SpiceMigrationDstInfo *dst_info, bool
> do_seamless,
> +                                 SpiceMigrationDstInfo *dst_info,
> +                                 bool do_seamless,
>                                   uint32_t src_mig_version)
>  {
>      SpiceMainChannelPrivate *main_priv = SPICE_MAIN_CHANNEL(channel)->priv;
> @@ -2379,13 +2380,12 @@ static void main_migrate_connect(SpiceChannel
> *channel,
>              SPICE_DEBUG("migration (semi-seamless): connections all ok");
>              reply_type = SPICE_MSGC_MAIN_MIGRATE_CONNECTED;
>          }
> -        spice_session_start_migrating(spice_channel_get_session(channel),
> -                                      mig.do_seamless);
> +        spice_session_start_migrating(session, mig.do_seamless);
>      }
>  
>  end:
>      CHANNEL_DEBUG(channel, "migrate connect reply %d", reply_type);
> -    out = spice_msg_out_new(SPICE_CHANNEL(channel), reply_type);
> +    out = spice_msg_out_new(channel, reply_type);
>      spice_msg_out_send(out);
>  }
>  

Frediano