[Spice-devel] [PATCH v2 37/40] server/red_channel: no opaque in red_channel_peer_on_*_error

Alon Levy alevy at redhat.com
Wed Mar 2 00:32:00 PST 2011


---
 server/red_channel.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/server/red_channel.c b/server/red_channel.c
index 18c7f35..0a36698 100644
--- a/server/red_channel.c
+++ b/server/red_channel.c
@@ -203,17 +203,13 @@ void red_channel_default_peer_on_error(RedChannel *channel)
     channel->disconnect(channel);
 }
 
-static void red_channel_peer_on_incoming_error(void *opaque)
+static void red_channel_peer_on_incoming_error(RedChannel *channel)
 {
-    RedChannel *channel = (RedChannel *)opaque;
-
     channel->on_incoming_error(channel);
 }
 
-static void red_channel_peer_on_outgoing_error(void *opaque)
+static void red_channel_peer_on_outgoing_error(RedChannel *channel)
 {
-    RedChannel *channel = (RedChannel *)opaque;
-
     channel->on_outgoing_error(channel);
 }
 
@@ -430,8 +426,8 @@ RedChannel *red_channel_create_parser(int size, RedsStream *stream,
     channel->incoming.parser = parser;
     channel->on_incoming_error = incoming_error;
     channel->on_outgoing_error = outgoing_error;
-    channel->incoming.on_error = red_channel_peer_on_incoming_error;
-    channel->outgoing.on_error = red_channel_peer_on_outgoing_error;
+    channel->incoming.on_error = (on_incoming_error_proc)red_channel_peer_on_incoming_error;
+    channel->outgoing.on_error = (on_outgoing_error_proc)red_channel_peer_on_outgoing_error;
     return channel;
 }
 
-- 
1.7.4.1



More information about the Spice-devel mailing list