[Pkg-telepathy-commits] [libnice] 74/265: agent: Eliminate redundant arguments from component_emit_io_callback()

Simon McVittie smcv at debian.org
Wed May 14 12:04:54 UTC 2014


This is an automated email from the git hooks/post-receive script.

smcv pushed a commit to branch debian
in repository libnice.

commit 3be5b428877da9c126943364f55e22a4f47681ad
Author: Philip Withnall <philip.withnall at collabora.co.uk>
Date:   Mon Dec 16 11:37:59 2013 +0000

    agent: Eliminate redundant arguments from component_emit_io_callback()
---
 agent/agent.c     | 10 ++--------
 agent/component.c | 19 ++++++++++++-------
 agent/component.h |  4 ++--
 3 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/agent/agent.c b/agent/agent.c
index 49ff86d..e58f634 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -1049,10 +1049,7 @@ pseudo_tcp_socket_readable (PseudoTcpSocket *sock, gpointer user_data)
       len = 0;
 
     if (len > 0) {
-      gint sid = stream->id;
-      gint cid = component->id;
-
-      component_emit_io_callback (component, agent, sid, cid, buf, len);
+      component_emit_io_callback (component, buf, len);
       if (sock == NULL) {
         nice_debug ("PseudoTCP socket got destroyed in readable callback!");
         break;
@@ -2700,10 +2697,7 @@ nice_agent_g_source_cb (
         ctx->agent, ctx->socket);
     component_detach_socket_source (component, ctx->socket);
   } else if (len > 0 && component->io_callback) {
-    gint sid = stream->id;
-    gint cid = component->id;
-
-    component_emit_io_callback (component, agent, sid, cid, buf, len);
+    component_emit_io_callback (component, buf, len);
   }
 
   agent_unlock ();
diff --git a/agent/component.c b/agent/component.c
index f78c05e..0a58284 100644
--- a/agent/component.c
+++ b/agent/component.c
@@ -473,24 +473,29 @@ component_set_io_callback (Component *component, NiceAgentRecvFunc func,
 
 /* This must be called with the agent lock *held*. */
 void
-component_emit_io_callback (Component *component, NiceAgent *agent,
-    gint stream_id, gint component_id, const guint8 *buf, gsize buf_len)
+component_emit_io_callback (Component *component,
+    const guint8 *buf, gsize buf_len)
 {
+  NiceAgent *agent;
+  guint stream_id, component_id;
   NiceAgentRecvFunc io_callback;
   gpointer io_user_data;
 
   g_assert (component != NULL);
-  g_assert (NICE_IS_AGENT (agent));
-  g_assert (stream_id > 0);
-  g_assert (component_id > 0);
   g_assert (buf != NULL);
   g_assert (buf_len > 0);
 
-  g_assert (component->io_callback != NULL);
-
+  agent = component->agent;
+  stream_id = component->stream->id;
+  component_id = component->id;
   io_callback = component->io_callback;
   io_user_data = component->io_user_data;
 
+  g_assert (NICE_IS_AGENT (agent));
+  g_assert (stream_id > 0);
+  g_assert (component_id > 0);
+  g_assert (io_callback != NULL);
+
   agent_unlock ();
 
   io_callback (agent, stream_id, component_id,
diff --git a/agent/component.h b/agent/component.h
index d63b1f7..19b2536 100644
--- a/agent/component.h
+++ b/agent/component.h
@@ -174,8 +174,8 @@ void
 component_set_io_callback (Component *component, NiceAgentRecvFunc func,
     gpointer user_data, GMainContext *context);
 void
-component_emit_io_callback (Component *component, NiceAgent *agent,
-    gint stream_id, gint component_id, const guint8 *buf, gsize buf_len);
+component_emit_io_callback (Component *component,
+    const guint8 *buf, gsize buf_len);
 
 G_END_DECLS
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-telepathy/libnice.git



More information about the Pkg-telepathy-commits mailing list