Re: [PATCH] Avoid double conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 05/26/2016 02:25 PM, Frediano Ziglio wrote:
Avoid converting from RedChannelClient* to DisplayChannelClient* and
DisplayChannelClient* to RedChannelClient* just to use RedChannelClient*.

Ack.

Consider adding to the commit log that 'channel->clients' is a list
of RedChannelClients.

Uri.


Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 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]);


_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]