summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <simon.mcvittie@collabora.co.uk>2012-05-09 19:12:57 +0100
committerSimon McVittie <simon.mcvittie@collabora.co.uk>2012-05-10 12:50:29 +0100
commit7883be2ec43dda0f7b4a30cf769779e366aaa905 (patch)
tree3e45454700b8c1f3c9879640cea61de859d94384
parent61fbe65e4892f020dc743155fcca04c8dfc39221 (diff)
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@collabora.co.uk> Reviewed-by: Mikhail Zabaluev <mikhail.zabaluev@nokia.com>
-rw-r--r--configure.ac3
-rw-r--r--rakia/sip-session.c4
-rw-r--r--rakia/util.c2
-rw-r--r--src/sip-connection-helpers.c4
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;