aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-01-30 18:03:49 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-01-31 14:52:49 +0100
commit20c23edb83b0bacbb28a0c7f5d3e41309ce4053e (patch)
tree18d54b33b88753498bd900ae1e1d2d5525f3d9e2
parent759ab6d94d2d34c5df2f665e7afbe0a66a1f7541 (diff)
altair,helpers: fix warnings with -Wsign-compare
CC altair/tests/test_modem_helpers_altair_lte-test-modem-helpers-altair-lte.o In file included from /usr/lib/glib-2.0/include/glibconfig.h:9, from /usr/include/glib-2.0/glib/gtypes.h:32, from /usr/include/glib-2.0/glib/galloca.h:32, from /usr/include/glib-2.0/glib.h:30, from altair/tests/test-modem-helpers-altair-lte.c:20: altair/tests/test-modem-helpers-altair-lte.c: In function ‘test_parse_cid’: altair/tests/test-modem-helpers-altair-lte.c:98:58: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare] 98 | g_assert (mm_altair_parse_cid ("%CGINFO:blah", NULL) == -1); | ^~ /usr/include/glib-2.0/glib/gmacros.h:937:25: note: in definition of macro ‘G_LIKELY’ 937 | #define G_LIKELY(expr) (expr) | ^~~~ altair/tests/test-modem-helpers-altair-lte.c:98:5: note: in expansion of macro ‘g_assert’ 98 | g_assert (mm_altair_parse_cid ("%CGINFO:blah", NULL) == -1); | ^~~~~~~~
-rw-r--r--plugins/altair/mm-modem-helpers-altair-lte.c5
-rw-r--r--plugins/altair/mm-modem-helpers-altair-lte.h2
2 files changed, 3 insertions, 4 deletions
diff --git a/plugins/altair/mm-modem-helpers-altair-lte.c b/plugins/altair/mm-modem-helpers-altair-lte.c
index 7df77ce2..d1b2aa5c 100644
--- a/plugins/altair/mm-modem-helpers-altair-lte.c
+++ b/plugins/altair/mm-modem-helpers-altair-lte.c
@@ -108,7 +108,7 @@ mm_altair_parse_ceer_response (const gchar *response,
/*****************************************************************************/
/* %CGINFO="cid",1 response parser */
-guint
+gint
mm_altair_parse_cid (const gchar *response, GError **error)
{
g_autoptr(GRegex) regex = NULL;
@@ -117,9 +117,8 @@ mm_altair_parse_cid (const gchar *response, GError **error)
regex = g_regex_new ("\\%CGINFO:\\s*(\\d+)", G_REGEX_RAW, 0, NULL);
g_assert (regex);
- if (!g_regex_match_full (regex, response, strlen (response), 0, 0, &match_info, error)) {
+ if (!g_regex_match_full (regex, response, strlen (response), 0, 0, &match_info, error))
return -1;
- }
if (!mm_get_uint_from_match_info (match_info, 1, &cid))
g_set_error (error,
diff --git a/plugins/altair/mm-modem-helpers-altair-lte.h b/plugins/altair/mm-modem-helpers-altair-lte.h
index 226e7884..ff7f64b0 100644
--- a/plugins/altair/mm-modem-helpers-altair-lte.h
+++ b/plugins/altair/mm-modem-helpers-altair-lte.h
@@ -30,7 +30,7 @@ gchar *mm_altair_parse_ceer_response (const gchar *response,
GError **error);
/* %CGINFO="cid",1 response parser */
-guint mm_altair_parse_cid (const gchar *response, GError **error);
+gint mm_altair_parse_cid (const gchar *response, GError **error);
/* %PCOINFO response parser */
MMPco *mm_altair_parse_vendor_pco_info (const gchar *pco_info, GError **error);