[Spice-devel,v6,17/18] sound: Make clear active and client_active are boolean

Submitted by Frediano Ziglio on Dec. 2, 2016, 10:54 a.m.

Details

Message ID af03d04231ae3a615fb931642b2b2333412f51d6.1480676032.git-series.fziglio@redhat.com
State Accepted
Headers show
Series "Remove DummyChannel* objects" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio Dec. 2, 2016, 10:54 a.m.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/sound.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/sound.c b/server/sound.c
index 04e08a2..91a0d49 100644
--- a/server/sound.c
+++ b/server/sound.c
@@ -93,8 +93,8 @@  GType snd_channel_client_get_type(void) G_GNUC_CONST;
 struct SndChannelClient {
     RedChannelClient parent;
 
-    int active;
-    int client_active;
+    gboolean active;
+    gboolean client_active;
 
     uint32_t command;
 
@@ -176,7 +176,7 @@  struct SndChannel {
     SndChannelClient *connection; /* Only one client is supported */
     SndChannel *next; /* For the global SndChannel list */
 
-    int active;
+    gboolean active;
     SpiceVolumeState volume;
     uint32_t frequency;
 };
@@ -857,7 +857,7 @@  static void snd_playback_start(SndChannel *channel)
 {
     SndChannelClient *client = channel->connection;
 
-    channel->active = 1;
+    channel->active = TRUE;
     if (!client)
         return;
     spice_assert(!client->active);
@@ -880,7 +880,7 @@  SPICE_GNUC_VISIBLE void spice_server_playback_stop(SpicePlaybackInstance *sin)
 {
     SndChannelClient *client = sin->st->channel.connection;
 
-    sin->st->channel.active = 0;
+    sin->st->channel.active = FALSE;
     if (!client)
         return;
     PlaybackChannelClient *playback_client = PLAYBACK_CHANNEL_CLIENT(client);
@@ -1150,7 +1150,7 @@  static void snd_record_start(SndChannel *channel)
 {
     SndChannelClient *client = channel->connection;
 
-    channel->active = 1;
+    channel->active = TRUE;
     if (!client) {
         return;
     }
@@ -1176,7 +1176,7 @@  SPICE_GNUC_VISIBLE void spice_server_record_stop(SpiceRecordInstance *sin)
 {
     SndChannelClient *client = sin->st->channel.connection;
 
-    sin->st->channel.active = 0;
+    sin->st->channel.active = TRUE;
     if (!client)
         return;
     spice_assert(client->active);

Comments

> 
> Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
> ---
>  server/sound.c | 14 +++++++-------
>  1 file changed, 7 insertions(+), 7 deletions(-)
> 
> diff --git a/server/sound.c b/server/sound.c
> index 04e08a2..91a0d49 100644
> --- a/server/sound.c
> +++ b/server/sound.c
> @@ -93,8 +93,8 @@ GType snd_channel_client_get_type(void) G_GNUC_CONST;
>  struct SndChannelClient {
>      RedChannelClient parent;
>  
> -    int active;
> -    int client_active;
> +    gboolean active;
> +    gboolean client_active;
>  
>      uint32_t command;
>  
> @@ -176,7 +176,7 @@ struct SndChannel {
>      SndChannelClient *connection; /* Only one client is supported */
>      SndChannel *next; /* For the global SndChannel list */
>  
> -    int active;
> +    gboolean active;
>      SpiceVolumeState volume;
>      uint32_t frequency;
>  };
> @@ -857,7 +857,7 @@ static void snd_playback_start(SndChannel *channel)
>  {
>      SndChannelClient *client = channel->connection;
>  
> -    channel->active = 1;
> +    channel->active = TRUE;
>      if (!client)
>          return;
>      spice_assert(!client->active);
> @@ -880,7 +880,7 @@ SPICE_GNUC_VISIBLE void
> spice_server_playback_stop(SpicePlaybackInstance *sin)
>  {
>      SndChannelClient *client = sin->st->channel.connection;
>  
> -    sin->st->channel.active = 0;
> +    sin->st->channel.active = FALSE;
>      if (!client)
>          return;
>      PlaybackChannelClient *playback_client =
>      PLAYBACK_CHANNEL_CLIENT(client);
> @@ -1150,7 +1150,7 @@ static void snd_record_start(SndChannel *channel)
>  {
>      SndChannelClient *client = channel->connection;
>  
> -    channel->active = 1;
> +    channel->active = TRUE;
>      if (!client) {
>          return;
>      }
> @@ -1176,7 +1176,7 @@ SPICE_GNUC_VISIBLE void
> spice_server_record_stop(SpiceRecordInstance *sin)
>  {
>      SndChannelClient *client = sin->st->channel.connection;
>  
> -    sin->st->channel.active = 0;
> +    sin->st->channel.active = TRUE;

This has to be FALSE!
Fixed in my branch.

>      if (!client)
>          return;
>      spice_assert(client->active);

Frediano