[Spice-devel] [PATCH] Avoid double conversion
Frediano Ziglio
fziglio at redhat.com
Thu May 26 11:25:37 UTC 2016
Avoid converting from RedChannelClient* to DisplayChannelClient* and
DisplayChannelClient* to RedChannelClient* just to use RedChannelClient*.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
---
server/red-worker.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/server/red-worker.c b/server/red-worker.c
index 3603025..aee6f28 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -498,7 +498,6 @@ CommonGraphicsChannel *red_worker_new_channel(RedWorker *worker, int size,
static void guest_set_client_capabilities(RedWorker *worker)
{
int i;
- DisplayChannelClient *dcc;
RedChannelClient *rcc;
GList *link, *next;
uint8_t caps[SPICE_CAPABILITIES_SIZE] = { 0 };
@@ -533,8 +532,7 @@ static void guest_set_client_capabilities(RedWorker *worker)
for (i = 0 ; i < sizeof(caps_available) / sizeof(caps_available[0]); ++i) {
SET_CAP(caps, caps_available[i]);
}
- FOREACH_CLIENT(worker->display_channel, link, next, dcc) {
- rcc = (RedChannelClient *)dcc;
+ FOREACH_CLIENT(worker->display_channel, link, next, rcc) {
for (i = 0 ; i < sizeof(caps_available) / sizeof(caps_available[0]); ++i) {
if (!red_channel_client_test_remote_cap(rcc, caps_available[i]))
CLEAR_CAP(caps, caps_available[i]);
--
2.7.4
More information about the Spice-devel
mailing list