[Spice-devel,spice-server,15/22] reds: use bool for RedCharDeviceVDIPortPrivate::client_agent_started

Submitted by Frediano Ziglio on June 16, 2017, 9:13 a.m.

Details

Message ID 20170616091334.31475-16-fziglio@redhat.com
State New
Headers show
Series "reds: Use bool for boolean types" ( rev: 6 5 4 3 2 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio June 16, 2017, 9:13 a.m.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 server/reds.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/server/reds.c b/server/reds.c
index 6cb1fb8..09968d3 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -229,7 +229,7 @@  enum {
 struct RedCharDeviceVDIPortPrivate {
     gboolean agent_attached;
     uint32_t plug_generation;
-    int client_agent_started;
+    bool client_agent_started;
 
     /* write to agent */
     RedCharDeviceWriteBuffer *recv_from_client_buf;
@@ -462,7 +462,7 @@  static void reds_reset_vdp(RedsState *reds)
      * to be sent from the client. This TODO will require server, protocol, and client changes */
     dev->priv->write_filter.result = AGENT_MSG_FILTER_DISCARD;
     dev->priv->write_filter.discard_all = TRUE;
-    dev->priv->client_agent_started = FALSE;
+    dev->priv->client_agent_started = false;
 
     /*  The client's tokens are set once when the main channel is initialized
      *  and once upon agent's connection with SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS.
@@ -1005,7 +1005,7 @@  void reds_on_main_agent_start(RedsState *reds, MainChannelClient *mcc, uint32_t
     spice_assert(reds->vdagent->st && reds->vdagent->st == dev_state);
     rcc = RED_CHANNEL_CLIENT(mcc);
     client = red_channel_client_get_client(rcc);
-    reds->agent_dev->priv->client_agent_started = TRUE;
+    reds->agent_dev->priv->client_agent_started = true;
     /*
      * Note that in older releases, send_tokens were set to ~0 on both client
      * and server. The server ignored the client given tokens.
@@ -1372,7 +1372,7 @@  static int reds_agent_state_restore(RedsState *reds, SpiceMigrateDataMain *mig_d
 
     agent_dev->priv->read_filter.discard_all = FALSE;
     agent_dev->priv->write_filter.discard_all = !mig_data->client_agent_started;
-    agent_dev->priv->client_agent_started = mig_data->client_agent_started;
+    agent_dev->priv->client_agent_started = !!mig_data->client_agent_started;
 
     agent_dev->priv->write_filter.msg_data_to_read = mig_data->client2agent.msg_remaining;
     agent_dev->priv->write_filter.result = mig_data->client2agent.msg_filter_result;