[Spice-commits] server/main-channel-client.cpp server/main-channel-client.h

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 8 08:23:08 UTC 2020


 server/main-channel-client.cpp |   10 +++++-----
 server/main-channel-client.h   |   10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit 3c74601652a732af14412d5983792d83f8031a85
Author: Frediano Ziglio <freddy77 at gmail.com>
Date:   Fri Jun 5 07:33:28 2020 +0100

    main-channel-client: Make some members const
    
    Also use a more explicit return type.
    
    Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>

diff --git a/server/main-channel-client.cpp b/server/main-channel-client.cpp
index f5b5fbb9..6c0a8200 100644
--- a/server/main-channel-client.cpp
+++ b/server/main-channel-client.cpp
@@ -541,23 +541,23 @@ MainChannelClient *main_channel_client_create(MainChannel *main_chan, RedClient
     return mcc.get();
 }
 
-int MainChannelClient::is_network_info_initialized()
+bool MainChannelClient::is_network_info_initialized() const
 {
     return priv->net_test_stage == NET_TEST_STAGE_COMPLETE;
 }
 
-int MainChannelClient::is_low_bandwidth()
+bool MainChannelClient::is_low_bandwidth() const
 {
     // TODO: configurable?
     return priv->bitrate_per_sec < 10 * 1024 * 1024;
 }
 
-uint64_t MainChannelClient::get_bitrate_per_sec()
+uint64_t MainChannelClient::get_bitrate_per_sec() const
 {
     return priv->bitrate_per_sec;
 }
 
-uint64_t MainChannelClient::get_roundtrip_ms()
+uint64_t MainChannelClient::get_roundtrip_ms() const
 {
     return priv->latency / 1000;
 }
@@ -600,7 +600,7 @@ void MainChannelClient::connect_seamless()
     priv->mig_connect_ok = FALSE;
 }
 
-uint32_t MainChannelClient::get_connection_id()
+uint32_t MainChannelClient::get_connection_id() const
 {
     return priv->connection_id;
 }
diff --git a/server/main-channel-client.h b/server/main-channel-client.h
index 4f040166..59324669 100644
--- a/server/main-channel-client.h
+++ b/server/main-channel-client.h
@@ -58,15 +58,15 @@ public:
      * return TRUE if network test had been completed successfully.
      * If FALSE, bitrate_per_sec is set to MAX_UINT64 and the roundtrip is set to 0
      */
-    int is_network_info_initialized();
-    int is_low_bandwidth();
-    uint64_t get_bitrate_per_sec();
-    uint64_t get_roundtrip_ms();
+    bool is_network_info_initialized() const;
+    bool is_low_bandwidth() const;
+    uint64_t get_bitrate_per_sec() const;
+    uint64_t get_roundtrip_ms() const;
 
     void push_name(const char *name);
     void push_uuid(const uint8_t uuid[16]);
 
-    uint32_t get_connection_id();
+    uint32_t get_connection_id() const;
 
     MainChannelClient(MainChannel *channel,
                       RedClient *client,


More information about the Spice-commits mailing list