From 1f94d3f5f85d72a98c7e957c687a28bead54fcf5 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sat, 11 Jan 2020 13:46:34 +0100 Subject: modem-helpers: fix warnings with -Wsign-compare MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mm-modem-helpers.c: In function ‘parse_uint’: mm-modem-helpers.c:1953:36: error: comparison of integer expressions of different signedness: ‘gulong’ {aka ‘long unsigned int’} and ‘glong’ {aka ‘long int’} [-Werror=sign-compare] 1953 | if ((nmin == nmax) || (ret >= nmin && ret <= nmax)) | ^~ mm-modem-helpers.c:1953:51: error: comparison of integer expressions of different signedness: ‘gulong’ {aka ‘long unsigned int’} and ‘glong’ {aka ‘long int’} [-Werror=sign-compare] 1953 | if ((nmin == nmax) || (ret >= nmin && ret <= nmax)) | ^~ --- src/mm-modem-helpers.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 98adb87f..efd24649 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -1932,7 +1932,11 @@ mm_3gpp_parse_cgact_read_response (const gchar *reply, /*************************************************************************/ static gulong -parse_uint (char *str, int base, glong nmin, glong nmax, gboolean *valid) +parse_uint (gchar *str, + gint base, + gulong nmin, + gulong nmax, + gboolean *valid) { gulong ret = 0; gchar *endquote; @@ -4677,7 +4681,7 @@ mm_cdma_parse_eri (const gchar *reply, *out_ind = ind; while (iter->num != -1) { - if (iter->num == ind) { + if ((guint)iter->num == ind) { *out_roaming = iter->roam_ind; if (out_desc) *out_desc = iter->banner; -- cgit v1.2.3-70-g09d2