[Spice-devel] [PATCH v3 14/14] server/red_worker: cursor_channel_send_item: don't downcast

Alon Levy alevy at redhat.com
Fri Feb 11 04:43:57 PST 2011


---
 server/red_worker.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/server/red_worker.c b/server/red_worker.c
index 49dcad1..d75856e 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -8411,9 +8411,11 @@ static void display_channel_push(RedWorker *worker)
     }
 }
 
-static void cursor_channel_send_item(RedChannel *channel, PipeItem *pipe_item)
+static void cursor_channel_send_item(CursorChannel *cursor_channel, PipeItem *pipe_item)
 {
-    CursorChannel *cursor_channel = (CursorChannel *)red_ref_channel(channel);
+    RedChannel *channel = &cursor_channel->common.base;
+
+    red_ref_channel(channel);
     red_channel_reset_send_data(channel);
     switch (pipe_item->type) {
     case PIPE_ITEM_TYPE_CURSOR:
@@ -8460,7 +8462,7 @@ static void cursor_channel_push(RedWorker *worker)
     PipeItem *pipe_item;
 
     while ((pipe_item = red_pipe_get((RedChannel *)worker->cursor_channel))) {
-        cursor_channel_send_item((RedChannel *)worker->cursor_channel, pipe_item);
+        cursor_channel_send_item(worker->cursor_channel, pipe_item);
     }
 }
 
-- 
1.7.4



More information about the Spice-devel mailing list