[Pkg-telepathy-commits] [libnice] 137/265: agent: Fix compiler warnings

Simon McVittie smcv at debian.org
Wed May 14 12:05:01 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 11ff575f34a2bf47493541d013848508bcdbfc31
Author: Olivier Crête <olivier.crete at collabora.com>
Date:   Thu Feb 13 15:14:23 2014 -0500

    agent: Fix compiler warnings
---
 agent/agent.c        | 4 ++--
 agent/outputstream.c | 6 +++---
 configure.ac         | 1 -
 3 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/agent/agent.c b/agent/agent.c
index 4662113..999019d 100644
--- a/agent/agent.c
+++ b/agent/agent.c
@@ -2758,11 +2758,11 @@ static void
 nice_debug_input_message_composition (const NiceInputMessage *messages,
     guint n_messages)
 {
+  guint i;
+
   if (!nice_debug_is_enabled ())
     return;
 
-  guint i;
-
   for (i = 0; i < n_messages; i++) {
     const NiceInputMessage *message = &messages[i];
     guint j;
diff --git a/agent/outputstream.c b/agent/outputstream.c
index 2ba4b48..fc13535 100644
--- a/agent/outputstream.c
+++ b/agent/outputstream.c
@@ -347,7 +347,8 @@ nice_output_stream_write (GOutputStream *stream, const void *buffer, gsize count
     GCancellable *cancellable, GError **error)
 {
   NiceOutputStream *self = NICE_OUTPUT_STREAM (stream);
-  gssize len = -1;
+  const gchar* buf = buffer;
+  gssize len = 0;
   gint n_sent;
   NiceAgent *agent = NULL;  /* owned */
   gulong cancel_id = 0, writeable_id;
@@ -377,7 +378,6 @@ nice_output_stream_write (GOutputStream *stream, const void *buffer, gsize count
    * since nice_agent_recv() is blocking. Currently this uses a fairly dodgy
    * GCond solution; would be much better for nice_agent_send() to block
    * properly in the main loop. */
-  len = 0;
   write_data = g_slice_new0 (WriteData);
   g_atomic_int_set (&write_data->ref_count, 3);
 
@@ -410,7 +410,7 @@ nice_output_stream_write (GOutputStream *stream, const void *buffer, gsize count
     g_mutex_unlock (&write_data->mutex);
 
     n_sent = nice_agent_send (agent, self->priv->stream_id,
-        self->priv->component_id, count - len, buffer + len);
+        self->priv->component_id, count - len, buf + len);
 
     g_mutex_lock (&write_data->mutex);
 
diff --git a/configure.ac b/configure.ac
index 50c226b..d1ad2d5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -124,7 +124,6 @@ AS_IF([test "x$enable_compile_warnings" != "xno" -a \
     NICE_ADD_FLAG([-Wnested-externs])
     NICE_ADD_FLAG([-Wwrite-strings])
     NICE_ADD_FLAG([-Wpointer-arith])
-    NICE_ADD_FLAG([-Wbad-function-cast])
     NICE_ADD_FLAG([-Wmissing-declarations])
     NICE_ADD_FLAG([-Wmissing-prototypes])
     NICE_ADD_FLAG([-Wstrict-prototypes])

-- 
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