aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-01-31 09:34:45 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-01-31 15:18:35 +0100
commit7873ef00e93f4bb390f873eddc16fa1afa071b8a (patch)
tree65fe07954750e3d7e46f9aa57c4a34782cdbe931
parent68f3eeeaa785e77289f6c7f276400d61bbb7fd22 (diff)
simtech: fix warnings with -Wsign-compare
simtech/mm-broadband-modem-simtech.c: In function ‘simtech_act_to_mm_act’: simtech/mm-broadband-modem-simtech.c:89:19: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare] 89 | return (nsmod < G_N_ELEMENTS (simtech_act_to_mm_act_map) ? simtech_act_to_mm_act_map[nsmod] : MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN); | ^
-rw-r--r--plugins/simtech/mm-broadband-modem-simtech.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/simtech/mm-broadband-modem-simtech.c b/plugins/simtech/mm-broadband-modem-simtech.c
index 246ce682..8a952dca 100644
--- a/plugins/simtech/mm-broadband-modem-simtech.c
+++ b/plugins/simtech/mm-broadband-modem-simtech.c
@@ -72,7 +72,7 @@ struct _MMBroadbandModemSimtechPrivate {
/* Setup/Cleanup unsolicited events (3GPP interface) */
static MMModemAccessTechnology
-simtech_act_to_mm_act (int nsmod)
+simtech_act_to_mm_act (guint nsmod)
{
static const MMModemAccessTechnology simtech_act_to_mm_act_map[] = {
[0] = MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN,
@@ -94,15 +94,15 @@ simtech_tech_changed (MMPortSerialAt *port,
GMatchInfo *match_info,
MMBroadbandModemSimtech *self)
{
- gchar *str;
-
- str = g_match_info_fetch (match_info, 1);
- if (str && str[0])
- mm_iface_modem_update_access_technologies (
- MM_IFACE_MODEM (self),
- simtech_act_to_mm_act (atoi (str)),
- MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK);
- g_free (str);
+ guint simtech_act = 0;
+
+ if (!mm_get_uint_from_match_info (match_info, 1, &simtech_act))
+ return;
+
+ mm_iface_modem_update_access_technologies (
+ MM_IFACE_MODEM (self),
+ simtech_act_to_mm_act (simtech_act),
+ MM_IFACE_MODEM_3GPP_ALL_ACCESS_TECHNOLOGIES_MASK);
}
static void