[Spice-commits] server/red-worker.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Thu May 26 15:45:04 UTC 2016


 server/red-worker.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 20373582ac3a188756932e3a5bc2926b4422c7a0
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Thu May 26 12:25:14 2016 +0100

    Avoid double conversion
    
    Avoid converting from RedChannelClient* to DisplayChannelClient* and
    DisplayChannelClient* to RedChannelClient* just to use RedChannelClient*
    ('display_channel->clients' is a list of RedChannelClients).
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Uri Lublin <uril at redhat.com>

diff --git a/server/red-worker.c b/server/red-worker.c
index 2684e19..e99c9a1 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]);


More information about the Spice-commits mailing list