[Spice-commits] 3 commits - server/red-channel-client.cpp server/red-channel-client.h
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Jul 20 09:17:36 UTC 2020
server/red-channel-client.cpp | 19 ++++++++++++++-----
server/red-channel-client.h | 6 +++---
2 files changed, 17 insertions(+), 8 deletions(-)
New commits:
commit 8dcbc99d3f36c838bea7a43a02cf7265a383b5c5
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Wed Jul 15 11:27:19 2020 +0100
red-channel-client: Change gboolean -> bool
Avoid possible type conversion
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
Acked-by: Julien Ropé <jrope at gmail.com>
diff --git a/server/red-channel-client.cpp b/server/red-channel-client.cpp
index ebccb7bc..2d6a780c 100644
--- a/server/red-channel-client.cpp
+++ b/server/red-channel-client.cpp
@@ -1652,13 +1652,13 @@ void RedChannelClient::pipe_remove_and_release(RedPipeItem *item)
/* client mutex should be locked before this call */
bool RedChannelClient::set_migration_seamless()
{
- gboolean ret = FALSE;
+ bool ret = false;
uint32_t flags;
flags = priv->channel->migration_flags();
if (flags & SPICE_MIGRATE_NEED_DATA_TRANSFER) {
priv->wait_migrate_data = TRUE;
- ret = TRUE;
+ ret = true;
}
red_channel_debug(priv->channel, "rcc %p wait data %d", this,
priv->wait_migrate_data);
commit 30d917ba5dc725b3f5275be9dcd0277d9e662a1b
Author: Frediano Ziglio <freddy77 at gmail.com>
Date: Wed Jul 15 11:26:25 2020 +0100
red-channel-client: Make RedChannelClient::pipe_item_is_linked const
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
Acked-by: Julien Ropé <jrope at gmail.com>
diff --git a/server/red-channel-client.cpp b/server/red-channel-client.cpp
index 76e38137..ebccb7bc 100644
--- a/server/red-channel-client.cpp
+++ b/server/red-channel-client.cpp
@@ -564,6 +564,15 @@ find_pipe_item(RedChannelClient::Pipe &pipe, const RedPipeItem *item)
});
}
+static RedChannelClient::Pipe::const_iterator
+find_pipe_item(const RedChannelClient::Pipe &pipe, const RedPipeItem *item)
+{
+ return std::find_if(pipe.begin(), pipe.end(),
+ [=](const RedPipeItemPtr& p) -> bool {
+ return p.get() == item;
+ });
+}
+
void RedChannelClientPrivate::pipe_remove(RedPipeItem *item)
{
auto i = find_pipe_item(pipe, item);
@@ -1419,7 +1428,7 @@ void RedChannelClient::pipe_add_after(RedPipeItemPtr&& item, RedPipeItem *pos)
pipe_add_after_pos(std::move(item), prev);
}
-int RedChannelClient::pipe_item_is_linked(RedPipeItem *item)
+bool RedChannelClient::pipe_item_is_linked(RedPipeItem *item) const
{
return find_pipe_item(priv->pipe, item) != priv->pipe.end();
}
diff --git a/server/red-channel-client.h b/server/red-channel-client.h
index 9d1e50a0..5c4df962 100644
--- a/server/red-channel-client.h
+++ b/server/red-channel-client.h
@@ -90,7 +90,7 @@ public:
void pipe_add_after(RedPipeItemPtr&& item, RedPipeItem *pos);
void pipe_add_after_pos(RedPipeItemPtr&& item,
RedChannelClient::Pipe::iterator pos);
- int pipe_item_is_linked(RedPipeItem *item);
+ bool pipe_item_is_linked(RedPipeItem *item) const;
void pipe_remove_and_release(RedPipeItem *item);
void pipe_add_tail(RedPipeItemPtr&& item);
/* for types that use this routine -> the pipe item should be freed */
commit db61c35e7ff3a8892c04e85633266400442c1068
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Thu May 23 02:52:21 2019 +0100
red-channel-client: Make some members const
This is now easier moving from GQueue to std::list.
Signed-off-by: Frediano Ziglio <freddy77 at gmail.com>
Acked-by: Julien Ropé <jrope at gmail.com>
diff --git a/server/red-channel-client.cpp b/server/red-channel-client.cpp
index 850047a5..76e38137 100644
--- a/server/red-channel-client.cpp
+++ b/server/red-channel-client.cpp
@@ -1452,12 +1452,12 @@ void RedChannelClient::pipe_add_empty_msg(int msg_type)
pipe_add(new_empty_msg(msg_type));
}
-gboolean RedChannelClient::pipe_is_empty()
+bool RedChannelClient::pipe_is_empty() const
{
return priv->pipe.empty();
}
-uint32_t RedChannelClient::get_pipe_size()
+uint32_t RedChannelClient::get_pipe_size() const
{
return priv->pipe.size();
}
diff --git a/server/red-channel-client.h b/server/red-channel-client.h
index 4f8c7b0d..9d1e50a0 100644
--- a/server/red-channel-client.h
+++ b/server/red-channel-client.h
@@ -97,8 +97,8 @@ public:
void pipe_add_type(int pipe_item_type);
static RedPipeItemPtr new_empty_msg(int msg_type);
void pipe_add_empty_msg(int msg_type);
- gboolean pipe_is_empty();
- uint32_t get_pipe_size();
+ bool pipe_is_empty() const;
+ uint32_t get_pipe_size() const;
Pipe& get_pipe();
bool is_mini_header() const;
More information about the Spice-commits
mailing list