Commit Graph

1924 Commits

Author SHA1 Message Date
Aleksander Morgado
4a609e564a ublox: fix disabling of unsolicited events
The incorrect ready() method was being used while disabling, which
ended up making the parent disable not being run at all.

  ublox/mm-broadband-modem-ublox.c:1178:1: error: ‘voice_disable_unsolicited_events_ready’ defined but not used [-Werror=unused-function]
   1178 | voice_disable_unsolicited_events_ready (MMBroadbandModemUblox *self,
        | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
72a124a121 ublox: fix warnings with -Wimplicit-fallthrough
ublox/mm-broadband-modem-ublox.c:458:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    458 |         ctx->step++;
        |         ~~~~~~~~~^~
  ublox/mm-broadband-modem-ublox.c:461:5: note: here
    461 |     case SET_CURRENT_MODES_BANDS_STEP_ACQUIRE:
        |     ^~~~
  ublox/mm-broadband-modem-ublox.c:468:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    468 |         ctx->step++;
        |         ~~~~~~~~~^~
  ublox/mm-broadband-modem-ublox.c:471:5: note: here
    471 |     case SET_CURRENT_MODES_BANDS_STEP_CURRENT_POWER:
        |     ^~~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
3197a52c58 ublox: fix warnings with -Wswitch-enum
ublox/mm-broadband-modem-ublox.c:1246:5: error: enumeration value ‘MM_CALL_STATE_UNKNOWN’ not handled in switch [-Werror=switch-enum]
   1246 |     switch (call_info.state) {
        |     ^~~~~~
  ublox/mm-broadband-modem-ublox.c:1246:5: error: enumeration value ‘MM_CALL_STATE_ACTIVE’ not handled in switch [-Werror=switch-enum]
  ublox/mm-broadband-modem-ublox.c:1246:5: error: enumeration value ‘MM_CALL_STATE_HELD’ not handled in switch [-Werror=switch-enum]
  ublox/mm-broadband-modem-ublox.c:1246:5: error: enumeration value ‘MM_CALL_STATE_TERMINATED’ not handled in switch [-Werror=switch-enum]
2020-01-31 15:18:35 +01:00
Aleksander Morgado
d6ec29c49e ublox: fix warnings with -Wswitch-default
ublox/mm-broadband-modem-ublox.c: In function ‘preload_support_config’:
  ublox/mm-broadband-modem-ublox.c💯5: error: switch missing default case [-Werror=switch-default]
    100 |     switch (self->priv->support_config.method) {
        |     ^~~~~~
  ublox/mm-broadband-modem-ublox.c:112:5: error: switch missing default case [-Werror=switch-default]
    112 |     switch (self->priv->support_config.uact) {
        |     ^~~~~~
  ublox/mm-broadband-modem-ublox.c:123:5: error: switch missing default case [-Werror=switch-default]
    123 |     switch (self->priv->support_config.ubandsel) {
        |     ^~~~~~
  ublox/mm-broadband-modem-ublox.c: In function ‘set_current_modes_bands_step’:
  ublox/mm-broadband-modem-ublox.c:452:5: error: switch missing default case [-Werror=switch-default]
    452 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
f66f7458b7 simtech: fix warnings with -Wimplicit-fallthrough
simtech/mm-broadband-modem-simtech.c: In function ‘enable_unsolicited_events_context_step’:
  simtech/mm-broadband-modem-simtech.c:442:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    442 |         ctx->step++;
        |         ~~~~~~~~~^~
  simtech/mm-broadband-modem-simtech.c:444:5: note: here
    444 |     case ENABLE_UNSOLICITED_EVENTS_STEP_LAST:
        |     ^~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
f6a103ef13 simtech: fix warnings with -Wswitch-default
simtech/mm-broadband-modem-simtech.c: In function ‘enable_unsolicited_events_context_step’:
  simtech/mm-broadband-modem-simtech.c:378:5: error: switch missing default case [-Werror=switch-default]
    378 |     switch (ctx->step) {
        |     ^~~~~~
  simtech/mm-broadband-modem-simtech.c: In function ‘disable_unsolicited_events_context_step’:
  simtech/mm-broadband-modem-simtech.c:563:5: error: switch missing default case [-Werror=switch-default]
    563 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
7873ef00e9 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);
        |                   ^
2020-01-31 15:18:35 +01:00
Aleksander Morgado
68f3eeeaa7 option,hso: fix warnings with -Wsign-compare
option/mm-broadband-bearer-hso.c: In function ‘ip_config_ready’:
  option/mm-broadband-bearer-hso.c:128:21: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} [-Werror=sign-compare]
    128 |                 num != ctx->cid) {
        |                     ^~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
fc581c50bd pantech: fix warnings with -Wdiscarded-qualifiers
pantech/mm-plugin-pantech.c:69:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
      69 |     { "ATE0", 3, port_probe_response_processor_is_pantech_at },
         |       ^~~~~~
   pantech/mm-plugin-pantech.c:70:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
      70 |     { "ATE0", 3, port_probe_response_processor_is_pantech_at },
         |       ^~~~~~
   pantech/mm-plugin-pantech.c:71:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
      71 |     { "ATE0", 3, port_probe_response_processor_is_pantech_at },
         |       ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
f661179310 novatel-lte: fix warnings with -Wdiscarded-qualifiers
novatel/mm-broadband-modem-novatel-lte.c:249:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    249 |     { "+CNUM",  3, TRUE, response_processor_cnum_ignore_at_errors },
        |       ^~~~~~~
  novatel/mm-broadband-modem-novatel-lte.c:250:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    250 |     { "$NWMDN", 3, TRUE, response_processor_nwmdn_ignore_at_errors },
        |       ^~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
f3acdcaa1b mtk: fix warnings with -Wdiscarded-qualifiers
mtk/mm-broadband-modem-mtk.c:727:6: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    727 |     {"+ECSQ=2", 5, FALSE, NULL},
        |      ^~~~~~~~~
  mtk/mm-broadband-modem-mtk.c:733:6: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    733 |     {"+ECSQ=0", 5, FALSE, NULL},
        |      ^~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
1f2018d524 nokia: fix warnings with -Wdiscarded-qualifiers
nokia/mm-plugin-nokia.c:37:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     37 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia.c:38:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     38 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia.c:39:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     39 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia-icera.c:36:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     36 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia-icera.c:37:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     37 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
  nokia/mm-plugin-nokia-icera.c:38:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     38 |     { "ATE1 E0", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
b5c08a47be mbm: fix warnings with -Wdiscarded-qualifiers
mbm/mm-broadband-modem-mbm.c:409:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    409 |     { "&F", 3, FALSE, NULL },
        |       ^~~~
  mbm/mm-broadband-modem-mbm.c:411:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    411 |     { "*ENAP=0", 3, FALSE, NULL },
        |       ^~~~~~~~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
40497a3904 iridium: fix warnings with -Wdiscarded-qualifiers
iridium/mm-plugin-iridium.c: In function ‘mm_plugin_create’:
  iridium/mm-plugin-iridium.c:64:52: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     64 |     static const mm_str_pair product_strings[] = {{"motorola", "satellite" },
        |                                                    ^~~~~~~~~~
  iridium/mm-plugin-iridium.c:64:64: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     64 |     static const mm_str_pair product_strings[] = {{"motorola", "satellite" },
        |                                                                ^~~~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
db8c1b9c12 huawei: fix warnings with -Wimplicit-fallthrough
huawei/mm-broadband-bearer-huawei.c: In function ‘connect_3gpp_context_step’:
  huawei/mm-broadband-bearer-huawei.c:378:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    378 |         ctx->step++;
        |         ~~~~~~~~~^~
  huawei/mm-broadband-bearer-huawei.c:382:5: note: here
    382 |     case CONNECT_3GPP_CONTEXT_STEP_NDISDUP: {
        |     ^~~~
  huawei/mm-broadband-bearer-huawei.c: In function ‘disconnect_3gpp_context_step’:
  huawei/mm-broadband-bearer-huawei.c:708:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    708 |         ctx->step++;
        |         ~~~~~~~~~^~
  huawei/mm-broadband-bearer-huawei.c:711:5: note: here
    711 |     case DISCONNECT_3GPP_CONTEXT_STEP_NDISDUP:
        |     ^~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
de360bd620 huawei: fix warnings with -Wswitch-default 2020-01-31 15:18:35 +01:00
Aleksander Morgado
50e6ead7e2 huawei: fix warnings with -Wdiscarded-qualifiers
huawei/mm-broadband-modem-huawei.c: At top level:
  huawei/mm-broadband-modem-huawei.c:2011:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   2011 |     { "^PORTSEL=0", 5, FALSE, NULL },
        |       ^~~~~~~~~~~~
  huawei/mm-broadband-modem-huawei.c:2012:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   2012 |     { "^CURC=1",    3, FALSE, NULL },
        |       ^~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
23f17ce766 huawei: fix warnings with -Wswitch-enum
huawei/mm-broadband-modem-huawei.c: In function ‘huawei_hcsq_changed’:
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_UNKNOWN’ not handled in switch [-Werror=switch-enum]
   1816 |     switch (act) {
        |     ^~~~~~
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_POTS’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_GSM_COMPACT’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_GPRS’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_EDGE’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_HSDPA’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_HSUPA’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_HSPA’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_HSPA_PLUS’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_1XRTT’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_EVDO0’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_EVDOA’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_EVDOB’ not handled in switch [-Werror=switch-enum]
  huawei/mm-broadband-modem-huawei.c:1816:5: error: enumeration value ‘MM_MODEM_ACCESS_TECHNOLOGY_ANY’ not handled in switch [-Werror=switch-enum]
2020-01-31 15:18:35 +01:00
Aleksander Morgado
2753afb73c huawei: fix warnings with -Wsign-compare
huawei/mm-plugin-huawei.c: In function ‘try_next_usbif’:
  huawei/mm-plugin-huawei.c:234:30: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘gint’ {aka ‘int’} [-Werror=sign-compare]
    234 |                        usbif < closest) {
        |                              ^
  huawei/mm-plugin-huawei.c: In function ‘propagate_port_mode_results’:
  huawei/mm-plugin-huawei.c:439:27: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
    439 |             if (usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_PCUI_PORT))) {
        |                           ^~
  huawei/mm-plugin-huawei.c:442:34: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
    442 |             } else if (usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_MODEM_PORT)))
        |                                  ^~
  huawei/mm-plugin-huawei.c:445:32: error: comparison of integer expressions of different signedness: ‘guint’ {aka ‘unsigned int’} and ‘int’ [-Werror=sign-compare]
    445 |                      usbif + 1 == GPOINTER_TO_INT (g_object_get_data (G_OBJECT (device), TAG_HUAWEI_NDIS_PORT)))
        |                                ^~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
497398158f cinterion: fix warnings with -Wimplicit-fallthrough
cinterion/mm-broadband-bearer-cinterion.c: In function ‘dial_3gpp_context_step’:
  cinterion/mm-broadband-bearer-cinterion.c:393:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    393 |         ctx->step++;
        |         ~~~~~~~~~^~
  cinterion/mm-broadband-bearer-cinterion.c:396:5: note: here
    396 |     case DIAL_3GPP_CONTEXT_STEP_AUTH: {
        |     ^~~~
  cinterion/mm-broadband-bearer-cinterion.c:419:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    419 |         ctx->step++;
        |         ~~~~~~~~~^~
  cinterion/mm-broadband-bearer-cinterion.c:422:5: note: here
    422 |     case DIAL_3GPP_CONTEXT_STEP_START_SWWAN: {
        |     ^~~~
  cinterion/mm-broadband-bearer-cinterion.c: In function ‘disconnect_3gpp_context_step’:
  cinterion/mm-broadband-bearer-cinterion.c:613:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    613 |         ctx->step++;
        |         ~~~~~~~~~^~
  cinterion/mm-broadband-bearer-cinterion.c:615:5: note: here
    615 |     case DISCONNECT_3GPP_CONTEXT_STEP_STOP_SWWAN: {
        |     ^~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
eff4ca989d cinterion: fix warnings with -Wswitch-default
cinterion/mm-broadband-bearer-cinterion.c: In function ‘dial_3gpp_context_step’:
  cinterion/mm-broadband-bearer-cinterion.c:370:5: error: switch missing default case [-Werror=switch-default]
    370 |     switch (ctx->step) {
        |     ^~~~~~
  cinterion/mm-broadband-bearer-cinterion.c: In function ‘disconnect_3gpp_context_step’:
  cinterion/mm-broadband-bearer-cinterion.c:610:5: error: switch missing default case [-Werror=switch-default]
    610 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
546715490d cinterion: fix warnings with -Wswitch-enum
cinterion/mm-broadband-modem-cinterion.c: In function ‘common_create_bearer’:
  cinterion/mm-broadband-modem-cinterion.c:1699:5: error: enumeration value ‘FEATURE_SUPPORT_UNKNOWN’ not handled in switch [-Werror=switch-enum]
   1699 |     switch (self->priv->swwan_support) {
        |     ^~~~~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
63d21151e2 cinterion: fix warnings with -Wimplicit-fallthrough
cinterion/mm-shared-cinterion.c: In function ‘disable_location_gathering_context_gps_step’:
  cinterion/mm-shared-cinterion.c:414:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
    414 |         ctx->gps_step++;
        |         ~~~~~~~~~~~~~^~
  cinterion/mm-shared-cinterion.c:417:5: note: here
    417 |     case DISABLE_LOCATION_GATHERING_GPS_STEP_SGPSS:
        |     ^~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
198529495a cinterion: fix warnings with -Wswitch-default
cinterion/mm-shared-cinterion.c: In function ‘disable_location_gathering_context_gps_step’:
  cinterion/mm-shared-cinterion.c:412:5: error: switch missing default case [-Werror=switch-default]
    412 |     switch (ctx->gps_step) {
        |     ^~~~~~
  cinterion/mm-shared-cinterion.c: In function ‘enable_location_gathering_context_gps_step’:
  cinterion/mm-shared-cinterion.c:665:5: error: switch missing default case [-Werror=switch-default]
    665 |     switch (ctx->gps_step) {
        |     ^~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
bbeabb495e helpers: new macro to CLAMP high threshold only
Useful when clamping a unsigned integer with low threshold set to 0,
which would give us compiler warnings with -Wtype-limits when using
CLAMP(), e.g.:

  via/mm-broadband-modem-via.c: In function ‘handle_evdo_quality_change’:
  /usr/include/glib-2.0/glib/gmacros.h:811:63: error: comparison of unsigned expression < 0 is always false [-Werror=type-limits]
    811 | #define CLAMP(x, low, high)  (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x)))
        |                                                               ^
  via/mm-broadband-modem-via.c:284:19: note: in expansion of macro ‘CLAMP’
    284 |         quality = CLAMP (quality, 0, 100);
        |                   ^~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
b856f3625d zte: fix warnings with -Wdiscarded-qualifiers
zte/mm-plugin-zte.c:54:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     54 |     { "ATE0+CPMS?", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~~~~
  zte/mm-plugin-zte.c:55:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     55 |     { "ATE0+CPMS?", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~~~~
  zte/mm-plugin-zte.c:56:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     56 |     { "ATE0+CPMS?", 3, mm_port_probe_response_processor_is_at },
        |       ^~~~~~~~~~~~
2020-01-31 15:18:35 +01:00
Aleksander Morgado
c1aac8ed26 altair: fix warnings with -Wdiscarded-qualifiers
altair/mm-plugin-altair-lte.c:44:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     44 |     { "AT",  7, mm_port_probe_response_processor_is_at },
        |       ^~~~
  altair/mm-plugin-altair-lte.c:45:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     45 |     { "AT",  7, mm_port_probe_response_processor_is_at },
        |       ^~~~
  altair/mm-plugin-altair-lte.c:46:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     46 |     { "AT",  7, mm_port_probe_response_processor_is_at },
        |       ^~~~
  altair/mm-broadband-modem-altair-lte.c:886:5: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    886 |   { "%STATCM=1", 10, FALSE, response_processor_no_result_stop_on_error },
        |     ^~~~~~~~~~~
  altair/mm-broadband-modem-altair-lte.c:887:5: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    887 |   { "%NOTIFYEV=\"SIMREFRESH\",1", 10, FALSE, NULL },
        |     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  altair/mm-broadband-modem-altair-lte.c:888:5: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    888 |   { "%PCOINFO=1", 10, FALSE, NULL },
        |     ^~~~~~~~~~~~
  ...
2020-01-31 15:18:35 +01:00
Aleksander Morgado
35649aa110 telit,tests: different errors for invalid vs unmatched band combinations 2020-01-31 15:18:35 +01:00
Aleksander Morgado
5ba6a684af telit: fix warnings with -Wimplicit-fallthrough
telit/mm-broadband-modem-telit.c: In function ‘qss_setup_step’:
  telit/mm-broadband-modem-telit.c:619:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
    619 |             ctx->step++;
        |             ~~~~~~~~~^~
  telit/mm-broadband-modem-telit.c:620:9: note: here
    620 |         case QSS_SETUP_STEP_QUERY:
        |         ^~~~
  telit/mm-broadband-modem-telit.c:653:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
    653 |             ctx->step++;
        |             ~~~~~~~~~^~
  telit/mm-broadband-modem-telit.c:654:9: note: here
    654 |         case QSS_SETUP_STEP_LAST:
        |         ^~~~
  telit/mm-broadband-modem-telit.c: In function ‘load_unlock_retries_step’:
  telit/mm-broadband-modem-telit.c:906:22: error: this statement may fall through [-Werror=implicit-fallthrough=]
    906 |             ctx->step++;
        |             ~~~~~~~~~^~
  telit/mm-broadband-modem-telit.c:907:9: note: here
    907 |         case LOAD_UNLOCK_RETRIES_STEP_LOCK:
        |         ^~~~
2020-01-31 14:52:50 +01:00
Aleksander Morgado
7e19ed0a79 telit: fix warnings with -Wdiscarded-qualifiers
telit/mm-broadband-modem-telit.c: At top level:
  telit/mm-broadband-modem-telit.c:1184:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1184 |     { "#PSNT?",    3, FALSE, response_processor_psnt_ignore_at_errors },
        |       ^~~~~~~~
  telit/mm-broadband-modem-telit.c:1185:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1185 |     { "+SERVICE?", 3, FALSE, response_processor_service_ignore_at_errors },
        |       ^~~~~~~~~~~
2020-01-31 14:52:50 +01:00
Aleksander Morgado
26e565f6a3 telit: fix warnings with -Wswitch-default
telit/mm-broadband-modem-telit.c: In function ‘qss_setup_step’:
  telit/mm-broadband-modem-telit.c:616:5: error: switch missing default case [-Werror=switch-default]
    616 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-31 14:52:50 +01:00
Aleksander Morgado
cfd5cad882 telit: fix warnings with -Wsign-compare
telit/mm-broadband-modem-telit.c: In function ‘gps_enabled_ready’:
  telit/mm-broadband-modem-telit.c:191:30: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ [-Werror=sign-compare]
    191 |     if (ctx->gps_enable_step < G_N_ELEMENTS (gps_enable)) {
        |                              ^
  telit/mm-broadband-modem-telit.c: In function ‘parent_enable_location_gathering_ready’:
  telit/mm-broadband-modem-telit.c:254:43: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘long unsigned int’ [-Werror=sign-compare]
    254 |     if (start_gps && ctx->gps_enable_step < G_N_ELEMENTS (gps_enable)) {
        |                                           ^
2020-01-31 14:52:50 +01:00
Aleksander Morgado
10c9ac18f7 telit: use integers to compare interface numbers 2020-01-31 14:52:50 +01:00
Aleksander Morgado
b4a08e9eb9 xmm: fix warnings with -Wswitch-enum
xmm/mm-shared-xmm.c: In function ‘gps_engine_start’:
  xmm/mm-shared-xmm.c:1068:5: error: enumeration value ‘GPS_ENGINE_STATE_OFF’ not handled in switch [-Werror=switch-enum]
   1068 |     switch (state) {
        |     ^~~~~~
2020-01-31 14:52:50 +01:00
Aleksander Morgado
f560cae145 novatel: fix warnings with -Wswitch-default
novatel/mm-broadband-modem-novatel.c: In function ‘cdma_activation_step’:
  novatel/mm-broadband-modem-novatel.c:1045:5: error: switch missing default case [-Werror=switch-default]
   1045 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-31 14:52:50 +01:00
Aleksander Morgado
92cc41e060 option: fix warnings with -Wimplicit-fallthrough
option/mm-broadband-modem-option.c: In function ‘load_access_technologies_step’:
  option/mm-broadband-modem-option.c:565:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    565 |         ctx->step++;
        |         ~~~~~~~~~^~
  option/mm-broadband-modem-option.c:567:5: note: here
    567 |     case ACCESS_TECHNOLOGIES_STEP_OSSYS:
        |     ^~~~
  option/mm-broadband-modem-option.c:587:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    587 |         ctx->step++;
        |         ~~~~~~~~~^~
  option/mm-broadband-modem-option.c:589:5: note: here
    589 |     case ACCESS_TECHNOLOGIES_STEP_OWCTI:
        |     ^~~~
  option/mm-broadband-modem-option.c:600:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    600 |         ctx->step++;
        |         ~~~~~~~~~^~
  option/mm-broadband-modem-option.c:602:5: note: here
    602 |     case ACCESS_TECHNOLOGIES_STEP_LAST:
        |     ^~~~
2020-01-31 14:52:50 +01:00
Aleksander Morgado
cff9d4a797 option: fix warnings with -Wdiscarded-qualifiers
option/mm-broadband-modem-option.c:978:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    978 |     { "_OSSYS=1",  3, FALSE, NULL },
        |       ^~~~~~~~~~
  option/mm-broadband-modem-option.c:979:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    979 |     { "_OCTI=1",   3, FALSE, NULL },
        |       ^~~~~~~~~
  option/mm-broadband-modem-option.c:980:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    980 |     { "_OUWCTI=1", 3, FALSE, NULL },
        |       ^~~~~~~~~~~
  option/mm-broadband-modem-option.c:981:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    981 |     { "_OSQI=1",   3, FALSE, NULL },
        |       ^~~~~~~~~
  option/mm-broadband-modem-option.c:1033:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1033 |     { "_OSSYS=0",  3, FALSE, NULL },
        |       ^~~~~~~~~~
  option/mm-broadband-modem-option.c:1034:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1034 |     { "_OCTI=0",   3, FALSE, NULL },
        |       ^~~~~~~~~
  option/mm-broadband-modem-option.c:1035:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1035 |     { "_OUWCTI=0", 3, FALSE, NULL },
        |       ^~~~~~~~~~~
  option/mm-broadband-modem-option.c:1036:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1036 |     { "_OSQI=0",   3, FALSE, NULL },
        |       ^~~~~~~~~
2020-01-31 14:52:50 +01:00
Aleksander Morgado
2fd6d401f5 option: fix warnings with -Wswitch-default 2020-01-31 14:52:49 +01:00
Aleksander Morgado
b8a8b772b4 sierra: remove unused cdma_manual_activation_context_free() 2020-01-31 14:52:49 +01:00
Aleksander Morgado
54a6e9fc85 sierra: fix warnings with -Wdiscarded-qualifiers
sierra/mm-broadband-modem-sierra.c:1815:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1815 |     { "!TIME?", 3, FALSE, parse_time_reply },    /* 3GPP */
        |       ^~~~~~~~
  sierra/mm-broadband-modem-sierra.c:1816:7: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1816 |     { "!SYSTIME?", 3, FALSE, parse_time_reply }, /* CDMA */
        |       ^~~~~~~~~~~
2020-01-31 14:52:49 +01:00
Aleksander Morgado
4a74ae07bc sierra: fix warnings with -Wimplicit-fallthrough
sierra/mm-broadband-bearer-sierra.c: In function ‘dial_3gpp_context_step’:
  sierra/mm-broadband-bearer-sierra.c:304:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    304 |         ctx->step++;
        |         ~~~~~~~~~^~
  sierra/mm-broadband-bearer-sierra.c:306:5: note: here
    306 |     case DIAL_3GPP_STEP_PS_ATTACH:
        |     ^~~~
  sierra/mm-broadband-bearer-sierra.c:398:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    398 |         ctx->step++;
        |         ~~~~~~~~~^~
2020-01-31 14:52:49 +01:00
Aleksander Morgado
8e216b30a6 sierra: fix warnings with -Wswitch-enum
sierra/mm-broadband-modem-sierra.c: In function ‘modem_time_load_network_time’:
  sierra/mm-broadband-modem-sierra.c:1733:5: error: enumeration value ‘TIME_METHOD_UNKNOWN’ not handled in switch [-Werror=switch-enum]
   1733 |     switch (MM_BROADBAND_MODEM_SIERRA (self)->priv->time_method) {
        |     ^~~~~~
2020-01-31 14:52:49 +01:00
Aleksander Morgado
e71819fcfe sierra: fix warnings with -Wswitch-default 2020-01-31 14:52:49 +01:00
Aleksander Morgado
8d2fbc8429 icera: fix warnings with -Wsign-compare
icera/mm-broadband-modem-icera.c: In function ‘icera_band_to_mm’:
  icera/mm-broadband-modem-icera.c:1105:20: error: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Werror=sign-compare]
   1105 |     for (i = 0 ; i < G_N_ELEMENTS (modem_bands); i++) {
        |                    ^
2020-01-31 14:52:49 +01:00
Aleksander Morgado
7af58f3450 icera: fix warnings with -Wdiscarded-qualifiers
CC       icera/libmm_shared_icera_la-mm-broadband-modem-icera.lo
  icera/mm-broadband-modem-icera.c:1082:30: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1082 |     { MM_MODEM_BAND_UTRAN_1, "FDD_BAND_I",    FALSE },
        |                              ^~~~~~~~~~~~
  icera/mm-broadband-modem-icera.c:1083:30: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1083 |     { MM_MODEM_BAND_UTRAN_2, "FDD_BAND_II",   FALSE },
        |                              ^~~~~~~~~~~~~
  icera/mm-broadband-modem-icera.c:1084:30: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1084 |     { MM_MODEM_BAND_UTRAN_3, "FDD_BAND_III",  FALSE },
        |                              ^~~~~~~~~~~~~~
  icera/mm-broadband-modem-icera.c:1085:30: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1085 |     { MM_MODEM_BAND_UTRAN_4, "FDD_BAND_IV",   FALSE },
        |                              ^~~~~~~~~~~~~
  icera/mm-broadband-modem-icera.c:1086:30: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1086 |     { MM_MODEM_BAND_UTRAN_5, "FDD_BAND_V",    FALSE },
        |                              ^~~~~~~~~~~~
2020-01-31 14:52:49 +01:00
Aleksander Morgado
281f656000 icera: fix warnings with -Wshadow
icera/mm-broadband-modem-icera.c: In function ‘modem_create_bearer’:
  icera/mm-broadband-modem-icera.c:873:42: error: declaration of ‘properties’ shadows a global declaration [-Werror=shadow]
    873 |                      MMBearerProperties *properties,
        |                      ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
  icera/mm-broadband-modem-icera.c:57:20: note: shadowed declaration is here
     57 | static GParamSpec *properties[PROP_LAST];
        |                    ^~~~~~~~~~
2020-01-31 14:52:49 +01:00
Aleksander Morgado
1e39e2a7dd simtech,helpers: fix warnings with -Wdiscarded-qualifiers
simtech/tests/test-modem-helpers-simtech.c: In function ‘test_clcc_urc_single’:
  simtech/tests/test-modem-helpers-simtech.c:98:64: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
     98 |         { 1, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE, "123456789" }
        |                                                                ^~~~~~~~~~~
  simtech/tests/test-modem-helpers-simtech.c: In function ‘test_clcc_urc_multiple’:
  simtech/tests/test-modem-helpers-simtech.c:113:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    113 |         { 2, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE,  "123456789" },
        |                                                                 ^~~~~~~~~~~
  simtech/tests/test-modem-helpers-simtech.c:114:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    114 |         { 3, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE,  "987654321" },
        |                                                                 ^~~~~~~~~~~
  simtech/tests/test-modem-helpers-simtech.c: In function ‘test_clcc_urc_complex’:
  simtech/tests/test-modem-helpers-simtech.c:130:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    130 |         { 1, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_ACTIVE,  "123456789" },
        |                                                                 ^~~~~~~~~~~
  simtech/tests/test-modem-helpers-simtech.c:131:65: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
    131 |         { 2, MM_CALL_DIRECTION_INCOMING, MM_CALL_STATE_WAITING, "987654321" },
        |                                                                 ^~~~~~~~~~~
2020-01-31 14:52:49 +01:00
Aleksander Morgado
71afc23261 huawei,helpers: fix warnings with -Wimplicit-fallthrough
huawei/mm-modem-helpers-huawei.c: In function ‘parse_mode_combination_string’:
  huawei/mm-modem-helpers-huawei.c:991:20: error: this statement may fall through [-Werror=implicit-fallthrough=]
    991 |         *preferred = MM_MODEM_MODE_NONE;
        |         ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
  huawei/mm-modem-helpers-huawei.c:993:5: note: here
    993 |     default:
        |     ^~~~~~~
2020-01-31 14:52:49 +01:00
Aleksander Morgado
dcce64a116 huawei: fix warnings with -Wsign-compare
huawei/mm-modem-helpers-huawei.c: In function ‘mm_huawei_parse_prefmode_response’:
  huawei/mm-modem-helpers-huawei.c:550:18: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘const unsigned int’} [-Werror=sign-compare]
    550 |         if (mode == combination->prefmode)
        |                  ^~
2020-01-31 14:52:49 +01:00
Aleksander Morgado
d6c3d8929e huawei,tests: fix warnings with -Wdiscarded-qualifiers
CC       huawei/tests/test_modem_helpers_huawei-test-modem-helpers-huawei.o
  huawei/tests/test-modem-helpers-huawei.c:1176:41: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1176 |     { "^TIME: 14/08/05 04:00:21", TRUE, "2014-08-05T04:00:21" },
        |                                         ^~~~~~~~~~~~~~~~~~~~~
  huawei/tests/test-modem-helpers-huawei.c:1177:43: error: initialization discards ‘const’ qualifier from pointer target type [-Werror=discarded-qualifiers]
   1177 |     { "^TIME: 2014/08/05 04:00:21", TRUE, "2014-08-05T04:00:21" },
        |                                           ^~~~~~~~~~~~~~~~~~~~~
2020-01-31 14:52:49 +01:00