telepathy-rakia: Enable warnings about suspicious signed/ unsigned comparisons, and fix them

Simon McVittie smcv at kemper.freedesktop.org
Thu May 10 04:50:47 PDT 2012


Module: telepathy-rakia
Branch: master
Commit: 7883be2ec43dda0f7b4a30cf769779e366aaa905
URL:    http://cgit.freedesktop.org/telepathy/telepathy-rakia/commit/?id=7883be2ec43dda0f7b4a30cf769779e366aaa905

Author: Simon McVittie <simon.mcvittie at collabora.co.uk>
Date:   Wed May  9 19:12:57 2012 +0100

Enable warnings about suspicious signed/unsigned comparisons, and fix them

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=49725
Signed-off-by: Simon McVittie <simon.mcvittie at collabora.co.uk>
Reviewed-by: Mikhail Zabaluev <mikhail.zabaluev at nokia.com>

---

 configure.ac                 |    3 +--
 rakia/sip-session.c          |    4 ++--
 rakia/util.c                 |    2 +-
 src/sip-connection-helpers.c |    4 ++--
 4 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/configure.ac b/configure.ac
index afce653..39c6aaa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,12 +60,11 @@ TP_COMPILER_WARNINGS([ERROR_CFLAGS], [test "x$enable_fatal_warnings" = xyes],
    missing-prototypes \
    nested-externs \
    pointer-arith \
+   sign-compare \
    strict-prototypes \
    format-security \
    init-self],
-  dnl missing-prototypes, sign-compare and strict-prototypes are bugs really
   [missing-field-initializers \
-   sign-compare \
    unused-parameter])
 AC_SUBST([ERROR_CFLAGS])
 
diff --git a/rakia/sip-session.c b/rakia/sip-session.c
index 05e147f..94ee826 100644
--- a/rakia/sip-session.c
+++ b/rakia/sip-session.c
@@ -914,14 +914,14 @@ rakia_sip_session_add_media_internal (RakiaSipSession *self,
   /* note: we add an entry even for unsupported media types */
   if (slot >= 0)
     {
-      if (slot < priv->medias->len)
+      if ((guint) slot < priv->medias->len)
         {
           g_assert (g_ptr_array_index (priv->medias, slot) == NULL);
           g_ptr_array_index (priv->medias, slot) = media;
         }
       else
         {
-          g_assert (slot == priv->medias->len);
+          g_assert ((guint) slot == priv->medias->len);
           g_ptr_array_add (priv->medias, media);
         }
     }
diff --git a/rakia/util.c b/rakia/util.c
index 025d559..6818942 100644
--- a/rakia/util.c
+++ b/rakia/util.c
@@ -127,7 +127,7 @@ rakia_unquote_string (const gchar *src, gssize len)
 {
   gchar *res;
   gchar *p;
-  gsize i;
+  gssize i;
 
   g_return_val_if_fail (src != NULL, NULL);
 
diff --git a/src/sip-connection-helpers.c b/src/sip-connection-helpers.c
index 6152f5d..e1294eb 100644
--- a/src/sip-connection-helpers.c
+++ b/src/sip-connection-helpers.c
@@ -551,8 +551,8 @@ priv_stun_discover_cb (sres_context_t *ctx,
   RakiaConnection *conn = RAKIA_CONNECTION (ctx);
   RakiaConnectionPrivate *priv = RAKIA_CONNECTION_GET_PRIVATE (conn);
   sres_srv_record_t *sel = NULL;
-  int n_sel_items = 0;
-  int i;
+  guint n_sel_items = 0;
+  guint i;
 
   if (answers == NULL)
     return;



More information about the telepathy-commits mailing list