Commit Graph

7297 Commits

Author SHA1 Message Date
Aleksander Morgado
8798ea889d iface-modem-location: fix warnings with -Wimplicit-fallthrough
mm-iface-modem-location.c: In function ‘interface_disabling_step’:
  mm-iface-modem-location.c:1389:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
   1389 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-iface-modem-location.c:1391:5: note: here
   1391 |     case DISABLING_STEP_DISABLE_GATHERING:
        |     ^~~~
  ...
2020-01-30 11:59:14 +01:00
Aleksander Morgado
3ab3968e8f iface-modem-location: fix warnings with -Wswitch-default
mm-iface-modem-location.c: In function ‘interface_disabling_step’:
  mm-iface-modem-location.c:1386:5: error: switch missing default case [-Werror=switch-default]
   1386 |     switch (ctx->step) {
        |     ^~~~~~
  mm-iface-modem-location.c: In function ‘interface_enabling_step’:
  mm-iface-modem-location.c:1505:5: error: switch missing default case [-Werror=switch-default]
   1505 |     switch (ctx->step) {
        |     ^~~~~~
  mm-iface-modem-location.c: In function ‘interface_initialization_step’:
  mm-iface-modem-location.c:1709:5: error: switch missing default case [-Werror=switch-default]
   1709 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
c1ffe15b92 iface-modem-location: fix warnings with -Wswitch-enum
mm-iface-modem-location.c: In function ‘update_location_source_status’:
  mm-iface-modem-location.c:482:5: error: enumeration value ‘MM_MODEM_LOCATION_SOURCE_NONE’ not handled in switch [-Werror=switch-enum]
    482 |     switch (source) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
8744025545 iface-modem-simple: fix warnings with -Wimplicit-fallthrough
mm-iface-modem-simple.c: In function ‘connection_step’:
  mm-iface-modem-simple.c:539:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    539 |         ctx->step++;
        |         ~~~~~~~~~^~
  ...
2020-01-30 11:59:14 +01:00
Aleksander Morgado
a4dcf5dd68 iface-modem-simple: fix warnings with -Wswitch-default
mm-iface-modem-simple.c: In function ‘connection_step’:
  mm-iface-modem-simple.c:536:5: error: switch missing default case [-Werror=switch-default]
    536 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
3659660e87 iface-modem-cdma: fix warnings with -Wimplicit-fallthrough
mm-iface-modem-cdma.c: In function ‘registration_check_step’:
  mm-iface-modem-cdma.c:846:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    846 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-iface-modem-cdma.c:848:5: note: here
    848 |     case REGISTRATION_CHECK_STEP_SETUP_REGISTRATION_CHECKS:
        |     ^~~~
  ...
2020-01-30 11:59:14 +01:00
Aleksander Morgado
8dedd45e90 iface-modem-cdma: fix warnings with -Wswitch-default
mm-iface-modem-cdma.c: In function ‘handle_activate_auth_ready’:
  mm-iface-modem-cdma.c:198:5: error: switch missing default case [-Werror=switch-default]
    198 |     switch (modem_state) {
        |     ^~~~~~
  ...
2020-01-30 11:59:14 +01:00
Aleksander Morgado
41bfa1f75d iface-modem-3gpp-ussd: fix warnings with -Wimplicit-fallthrough
mm-iface-modem-3gpp-ussd.c: In function ‘interface_disabling_step’:
  mm-iface-modem-3gpp-ussd.c:572:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
    572 |         ctx->step++;
        |         ~~~~~~~~~^~
  ..
2020-01-30 11:59:14 +01:00
Aleksander Morgado
82d30fd052 iface-modem-3gpp-ussd: fix warnings with -Wswitch-default
mm-iface-modem-3gpp-ussd.c: In function ‘ensure_enabled’:
  mm-iface-modem-3gpp-ussd.c:59:5: error: switch missing default case [-Werror=switch-default]
     59 |     switch (modem_state) {
        |     ^~~~~~
  mm-iface-modem-3gpp-ussd.c: In function ‘interface_disabling_step’:
  mm-iface-modem-3gpp-ussd.c:565:5: error: switch missing default case [-Werror=switch-default]
    565 |     switch (ctx->step) {
        |     ^~~~~~
  mm-iface-modem-3gpp-ussd.c: In function ‘interface_enabling_step’:
  mm-iface-modem-3gpp-ussd.c:709:5: error: switch missing default case [-Werror=switch-default]
    709 |     switch (ctx->step) {
        |     ^~~~~~
  mm-iface-modem-3gpp-ussd.c: In function ‘interface_initialization_step’:
  mm-iface-modem-3gpp-ussd.c:831:5: error: switch missing default case [-Werror=switch-default]
    831 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
5aa5e51a0e iface-modem-3gpp: fix warnings with -Wimplicit-fallthrough
mm-iface-modem-3gpp.c: In function ‘interface_disabling_step’:
    mm-iface-modem-3gpp.c:1797:18: error: this statement may fall through [-Werror=implicit-fallthrough=]
     1797 |         ctx->step++;
          |         ~~~~~~~~~^~
    ...
2020-01-30 11:59:14 +01:00
Aleksander Morgado
f6e53c41e4 iface-modem-3gpp: fix warnings with -Wswitch-default
mm-iface-modem-3gpp.c: In function ‘handle_register_auth_ready’:
  mm-iface-modem-3gpp.c:550:5: error: switch missing default case [-Werror=switch-default]
    550 |     switch (modem_state) {
        |     ^~~~~~
  mm-iface-modem-3gpp.c: In function ‘handle_scan_auth_ready’:
  mm-iface-modem-3gpp.c:738:5: error: switch missing default case [-Werror=switch-default]
    738 |     switch (modem_state) {
        |     ^~~~~~
  mm-iface-modem-3gpp.c: In function ‘interface_disabling_step’:
  mm-iface-modem-3gpp.c:1788:5: error: switch missing default case [-Werror=switch-default]
   1788 |     switch (ctx->step) {
        |     ^~~~~~
  mm-iface-modem-3gpp.c: In function ‘interface_enabling_step’:
  mm-iface-modem-3gpp.c:2092:5: error: switch missing default case [-Werror=switch-default]
   2092 |     switch (ctx->step) {
        |     ^~~~~~
  mm-iface-modem-3gpp.c: In function ‘interface_initialization_step’:
  mm-iface-modem-3gpp.c:2394:5: error: switch missing default case [-Werror=switch-default]
   2394 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
394df97acf iface-modem: fix warnings with -Wimplicit-fallthrough
mm-iface-modem.c: In function ‘peridic_signal_check_step’:
  mm-iface-modem.c:1311:26: error: this statement may fall through [-Werror=implicit-fallthrough=]
   1311 |         ctx->running_step++;
        |         ~~~~~~~~~~~~~~~~~^~
  ...
2020-01-30 11:59:14 +01:00
Aleksander Morgado
eb04eadcce iface-modem: fix warnings with -Wswitch-default
mm-iface-modem.c: In function ‘bearer_status_changed’:
  mm-iface-modem.c:483:9: error: switch missing default case [-Werror=switch-default]
    483 |         switch (mm_base_bearer_get_status (bearer)) {
        |         ^~~~~~
  mm-iface-modem.c: In function ‘peridic_signal_check_step’:
  mm-iface-modem.c:1293:5: error: switch missing default case [-Werror=switch-default]
   1293 |     switch (ctx->running_step) {
        |     ^~~~~~
  mm-iface-modem.c: In function ‘interface_enabling_step’:
  mm-iface-modem.c:3965:5: error: switch missing default case [-Werror=switch-default]
   3965 |     switch (ctx->step) {
        |     ^~~~~~
  mm-iface-modem.c: In function ‘interface_initialization_step’:
  mm-iface-modem.c:4708:5: error: switch missing default case [-Werror=switch-default]
   4708 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
6a3e2d6a61 base-sms: fix warnings with -Wshadow
mm-base-sms.c: In function ‘mm_base_sms_new_from_properties’:
  mm-base-sms.c:1831:51: error: declaration of ‘properties’ shadows a global declaration [-Werror=shadow]
   1831 |                                  MMSmsProperties *properties,
        |                                  ~~~~~~~~~~~~~~~~~^~~~~~~~~~
  mm-base-sms.c:53:20: note: shadowed declaration is here
     53 | static GParamSpec *properties[PROP_LAST];
        |                    ^~~~~~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
1d0ead9aca base-sms: fix warnings with -Wshadow
mm-base-sms.c: In function ‘generate_3gpp_submit_pdus’:
  mm-base-sms.c:153:19: error: declaration of ‘i’ shadows a previous local [-Werror=shadow]
    153 |             guint i = 0;
        |                   ^
  mm-base-sms.c:102:11: note: shadowed declaration is here
    102 |     guint i;
        |           ^
2020-01-30 11:59:14 +01:00
Aleksander Morgado
316f2fdff8 base-modem: fix warnings with -Wswitch-enum
mm-base-modem.c: In function ‘mm_base_modem_organize_ports’:
  mm-base-modem.c:1088:9: error: enumeration value ‘MM_PORT_TYPE_UNKNOWN’ not handled in switch [-Werror=switch-enum]
   1088 |         switch (mm_port_get_port_type (candidate)) {
        |         ^~~~~~
  mm-base-modem.c:1088:9: error: enumeration value ‘MM_PORT_TYPE_IGNORED’ not handled in switch [-Werror=switch-enum]
2020-01-30 11:59:14 +01:00
Aleksander Morgado
c93a3cf589 bearer-list: fix warnings with -Wshadow
mm-bearer-list.c: In function ‘mm_bearer_list_find_by_properties’:
  	mm-bearer-list.c:151:56: error: declaration of ‘properties’ shadows a global declaration [-Werror=shadow]
  	  151 |                                    MMBearerProperties *properties)
  	      |                                    ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
  	mm-bearer-list.c:42:20: note: shadowed declaration is here
  	   42 | static GParamSpec *properties[PROP_LAST];
  	      |                    ^~~~~~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
71ee2e900d core,broadband-bearer: fix warnings with -Wimplicit-fallthrough
mm-broadband-bearer.c: In function ‘cid_selection_3gpp_context_step’:
  mm-broadband-bearer.c:871:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
    871 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-broadband-bearer.c:873:5: note: here
    873 |     case CID_SELECTION_3GPP_STEP_FORMAT:
        |     ^~~~
  mm-broadband-bearer.c: In function ‘interface_initialization_step’:
  mm-broadband-bearer.c:2127:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
   2127 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-broadband-bearer.c:2129:5: note: here
   2129 |     case INITIALIZATION_STEP_CDMA_RM_PROTOCOL:
        |     ^~~~
  mm-broadband-bearer.c:2148:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
   2148 |         ctx->step++;
        |         ~~~~~~~~~^~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
cdcc44922f core,broadband-bearer: fix warnings with -Wshadow
mm-broadband-bearer.c: In function ‘mm_broadband_bearer_new’:
  mm-broadband-bearer.c:2204:46: warning: declaration of ‘properties’ shadows a global declaration [-Wshadow]
   2204 |                          MMBearerProperties *properties,
        |                          ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
  mm-broadband-bearer.c:58:20: note: shadowed declaration is here
     58 | static GParamSpec *properties[PROP_LAST];
        |                    ^~~~~~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
7c4220bc68 core,broadband-bearer: fix warnings with -Wswitch-default
mm-broadband-bearer.c: In function ‘cid_selection_3gpp_context_step’:
  mm-broadband-bearer.c:868:5: warning: switch missing default case [-Wswitch-default]
    868 |     switch (ctx->step) {
        |     ^~~~~~
  mm-broadband-bearer.c: In function ‘disconnect’:
  mm-broadband-bearer.c:1842:5: warning: switch missing default case [-Wswitch-default]
   1842 |     switch (MM_BROADBAND_BEARER (self)->priv->connection_type) {
        |     ^~~~~~
  mm-broadband-bearer.c: In function ‘interface_initialization_step’:
  mm-broadband-bearer.c:2124:5: warning: switch missing default case [-Wswitch-default]
   2124 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
2a0e4e062f core,base-bearer: fix warnings with -Wswitch-default
mm-base-bearer.c: In function ‘modem_3gpp_registration_state_changed’:
  mm-base-bearer.c:463:5: warning: switch missing default case [-Wswitch-default]
    463 |     switch (state) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
ce5689112d core,base-sim: fix warnings with -Wimplicit-fallthrough
mm-base-sim.c:1590:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
   1590 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-base-sim.c:1592:5: note: here
   1592 |     case INITIALIZATION_STEP_SIM_IDENTIFIER:
        |     ^~~~
  mm-base-sim.c:1606:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
   1606 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-base-sim.c:1608:5: note: here
   1608 |     case INITIALIZATION_STEP_IMSI:
        |     ^~~~
  mm-base-sim.c:1622:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
   1622 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-base-sim.c:1624:5: note: here
   1624 |     case INITIALIZATION_STEP_OPERATOR_ID:
        |     ^~~~
  mm-base-sim.c:1638:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
   1638 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-base-sim.c:1640:5: note: here
   1640 |     case INITIALIZATION_STEP_OPERATOR_NAME:
        |     ^~~~
  mm-base-sim.c:1654:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
   1654 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-base-sim.c:1656:5: note: here
   1656 |     case INITIALIZATION_STEP_EMERGENCY_NUMBERS:
        |     ^~~~
  mm-base-sim.c:1670:18: warning: this statement may fall through [-Wimplicit-fallthrough=]
   1670 |         ctx->step++;
        |         ~~~~~~~~~^~
  mm-base-sim.c:1672:5: note: here
   1672 |     case INITIALIZATION_STEP_LAST:
        |     ^~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
850c6636bf core,base-sim: fix warnings with -Wswitch-default
mm-base-sim.c: In function ‘interface_initialization_step’:
  mm-base-sim.c:1587:5: warning: switch missing default case [-Wswitch-default]
   1587 |     switch (ctx->step) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
645f8e10ea core,plugin-manager: fix warnings with -Wswitch-default
mm-plugin-manager.c: In function ‘plugin_supports_port_ready’:
  mm-plugin-manager.c:480:5: warning: switch missing default case [-Wswitch-default]
    480 |     switch (support_result) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
b087549c7d core,log: fix warnings with -Wswitch-enum
mm-log.c: In function ‘glib_to_syslog_priority’:
  mm-log.c:99:5: warning: enumeration value ‘G_LOG_FLAG_RECURSION’ not handled in switch [-Wswitch-enum]
     99 |     switch (level) {
        |     ^~~~~~
  mm-log.c:99:5: warning: enumeration value ‘G_LOG_FLAG_FATAL’ not handled in switch [-Wswitch-enum]
  mm-log.c:99:5: warning: enumeration value ‘G_LOG_LEVEL_INFO’ not handled in switch [-Wswitch-enum]
  mm-log.c:99:5: warning: enumeration value ‘G_LOG_LEVEL_MASK’ not handled in switch [-Wswitch-enum]
2020-01-30 11:59:14 +01:00
Aleksander Morgado
b024381be5 core,log: fix warnings with -Wswitch-default
mm-log.c: In function ‘mm_to_syslog_priority’:
  mm-log.c:82:5: warning: switch missing default case [-Wswitch-default]
     82 |     switch (level) {
        |     ^~~~~~

  mm-log.c: In function ‘log_level_description’:
  mm-log.c:118:5: warning: switch missing default case [-Wswitch-default]
    118 |     switch (level) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
a1f2429790 libqcdm,reset: fix warnings with -Wdiscarded-qualifiers
reset.c: In function ‘main’:
  reset.c:238:17: warning: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    238 |         putenv ("QCDM_DEBUG=1");
        |                 ^~~~~~~~~~~~~~
  In file included from reset.c:22:
  /usr/include/stdlib.h:647:26: note: expected ‘char *’ but argument is of type ‘const char *’
    647 | extern int putenv (char *__string) __THROW __nonnull ((1));
        |                    ~~~~~~^~~~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
305d927ee0 libqcdm,reset: fix warnings with -Wsign-compare
reset.c: In function ‘print_buf’:
  reset.c:47:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
     47 |     for (i = 0; i < len; i++) {
        |                   ^
  reset.c: In function ‘qcdm_wait_reply’:
  reset.c:168:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
    168 |     } while (total < sizeof (readbuf));
        |                    ^
2020-01-30 11:59:14 +01:00
Aleksander Morgado
47a380a2ae libqcdm,ipv6pref: fix warnings with -Wdiscarded-qualifiers
ipv6pref.c: In function ‘main’:
  ipv6pref.c:288:11: warning: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    288 |   putenv ("QCDM_DEBUG=1");
        |           ^~~~~~~~~~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
07fe3bed65 libqcdm,ipv6pref: fix warnings with -Wsign-compare
ipv6pref.c: In function ‘print_buf’:
  ipv6pref.c:46:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
     46 |  for (i = 0; i < len; i++) {
        |                ^
  ipv6pref.c: In function ‘qcdm_wait_reply’:
  ipv6pref.c:167:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
    167 |  } while (total < sizeof (readbuf));
        |                 ^
2020-01-30 11:59:14 +01:00
Aleksander Morgado
c135c66684 libqcdm,modepref: fix warnings with -Wdiscarded-qualifiers
modepref.c: In function ‘main’:
  modepref.c:539:11: warning: passing argument 1 of ‘putenv’ discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
    539 |   putenv ("QCDM_DEBUG=1");
        |           ^~~~~~~~~~~~~~
  In file included from modepref.c:21:
  /usr/include/stdlib.h:647:26: note: expected ‘char *’ but argument is of type ‘const char *’
    647 | extern int putenv (char *__string) __THROW __nonnull ((1));
        |                    ~~~~~~^~~~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
17a00ce1fc libqcdm,modepref: fix warnings with -Wsign-compare
modepref.c: In function ‘print_buf’:
  modepref.c:46:16: warning: comparison of integer expressions of different signedness: ‘int’ and ‘size_t’ {aka ‘long unsigned int’} [-Wsign-compare]
     46 |  for (i = 0; i < len; i++) {
        |                ^
  modepref.c: In function ‘qcdm_wait_reply’:
  modepref.c:167:17: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
    167 |  } while (total < sizeof (readbuf));
        |                 ^
2020-01-30 11:59:14 +01:00
Aleksander Morgado
4fa669b894 test-qcdm-com: fix warnings with -Wdouble-promotion
test-qcdm-com.c: In function ‘test_com_pilot_sets’:
  test-qcdm-com.c:1085:59: warning: implicit conversion from ‘float’ to ‘double’ when passing argument to function [-Wdouble-promotion]
   1085 |         g_message ("      EC/IO     %d  (%.1f dB)", ecio, db);
        |                                                           ^~
  /usr/include/glib-2.0/glib/gmessages.h:333:32: note: in definition of macro ‘g_message’
    333 |                                __VA_ARGS__)
        |                                ^~~~~~~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
45c0015c08 test-qcdm-com: fix warnings with -Wsign-compare
test-qcdm-com.c: In function ‘print_buf’:
  test-qcdm-com.c:273:19: warning: comparison of integer expressions of different signedness: ‘int’ and ‘gsize’ {aka ‘long unsigned int’} [-Wsign-compare]
    273 |     for (i = 0; i < len; i++) {
        |                   ^
  test-qcdm-com.c: In function ‘wait_reply’:
  test-qcdm-com.c:367:20: warning: comparison of integer expressions of different signedness: ‘int’ and ‘long unsigned int’ [-Wsign-compare]
    367 |     } while (total < sizeof (readbuf));
        |                    ^
2020-01-30 11:59:14 +01:00
Aleksander Morgado
06567283b1 libqcdm,logs: fix warnings with -Wdouble-promotion
logs.c: In function ‘qcdm_log_item_evdo_pilot_sets_v2_get_pilot’:
  logs.c:179:94: warning: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Wdouble-promotion]
    179 |     *out_rssi_dbm = (int32_t) (-110.0 + ((float) MAX (le16toh (pilot->pilot_energy) - 50, 0) / 14.0));
        |
2020-01-30 11:59:14 +01:00
Aleksander Morgado
3c19b48f8c libqcdm,commands: fix warnings with -Wdouble-promotion
commands.c: In function ‘qcdm_cmd_pilot_sets_result_get_pilot’:
  commands.c:756:33: warning: implicit conversion from ‘float’ to ‘double’ to match other operand of binary expression [-Wdouble-promotion]
    756 |     *out_db = (float) set->ecio * -0.5;
        |                                 ^
2020-01-30 11:59:14 +01:00
Aleksander Morgado
9bc5d742dc libqcdm,commands: fix warnings with -Wswitch-default
commands.c: In function ‘nv_mode_pref_from_qcdm’:
  commands.c:109:5: warning: switch missing default case [-Wswitch-default]
    109 |     switch (qcdm) {
        |     ^~~~~~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
cf211c01e9 build-aux: fix warning in the built _get_string() methods with -Wsign-compare
mm-enums-types.c: In function ‘mm_modem_lock_get_string’:
  mm-enums-types.c:165:17: warning: comparison of integer expressions of different signedness: ‘MMModemLock’ {aka ‘enum <anonymous>’} and ‘gint’ {aka ‘const int’} [-Wsign-compare]
    165 |         if (val == mm_modem_lock_values[i].value)
        |                 ^~
2020-01-30 11:59:14 +01:00
Aleksander Morgado
1c078531a0 build: use AX_IS_RELEASE() and AX_COMPILER_FLAGS()
The autoconf macros AX_COMPILER_FLAGS_{CFLAGS|GIR|LDFLAGS} test
for compiler and linker support of various flags, and add the flags to
the generated output.

If the command-line option '--enable-compile-warnings' is specified to
'configure', a number of additional warning options is also added to the
output. This is the default.

This update requires the presence of the GNU autoconf-archive in the
system.
2020-01-30 11:59:14 +01:00
Aleksander Morgado
4bfd955e64 auth-provider: fix reference count in manager and modem objects
The auth provider is now a singleton (since 20ab6550), one single
object that lives throughout the whole program execution, and so we
don't need to keep our own full references around. This fix makes
sure we don't attempt to unref a full auth provider reference we
don't own.

Fixes https://gitlab.freedesktop.org/mobile-broadband/ModemManager/issues/179
2020-01-28 10:33:50 +01:00
Aleksander Morgado
2406a5519f charsets: fix handling of 0x00 bytes at the end of GSM encoded strings
When a GSM-7 encoded string is packed, the process of packing the
septets into bytes may end up with one last byte holding the last bit
of the last septet. When this situation happens, the last byte will
end up with the 7 remaining bits set to 0.

When this packed string is unpacked, the logic to unpack will unpack
those last 7 bits as an additional septet, with the value 0x00.

The 0x00 value encoded in GSM-7 is the '@' character, EXCEPT when this
character is found at the end of the string, in which case the value
should be considered as NUL and trigger the end of string already.

So, fix the conversion logic between GSM-7 and UTF-8, so that whenever
we find the 0x00 character at the end of the string, we ignore it
instead of adding a bogus '@' trailing character.

This commit fixes the "/MM/charsets/gsm7/default-chars" unit test
after having it updated to perform the full conversion cycle:
   UTF-8 -> packed GSM7 -> UTF-8
2020-01-24 09:57:54 +01:00
Aleksander Morgado
6c80577bec tests,charsets: full gsm7/pack/unpack/utf8 sequence in tests 2020-01-24 09:56:53 +01:00
Aleksander Morgado
20ab6550fb auth-provider: refactor and simplify
The auth provider setup is a bit over-engineered. Simplify it by
making a single MMAuthProvider object that may or may not use polkit,
depending on configure options. This object is also setup as a
singleton object using the helper MM_DEFINE_SINGLETON_GETTER().
2020-01-23 11:50:23 +00:00
Aleksander Morgado
a6a3db2184 base-modem: use g_steal_pointer() during dispose
g_steal_pointer() sets the original location to NULL already, so it's
very handy.
2020-01-22 18:21:25 +01:00
Aleksander Morgado
3490f997f9 base-modem: serial ports require 'timed-out' signal disconnection on cleanup
Fixes https://lists.freedesktop.org/archives/modemmanager-devel/2020-January/007686.html
2020-01-22 18:21:17 +01:00
Aleksander Morgado
9b56ce8ccc base-modem: new helper method to cleanup ports during modem dispose
The different types of ports available in the modem will require
different types of cleanup actions. E.g. QMI and MBIM ports need an
explicit device close, and some other port types may need other
cleanups.
2020-01-22 18:19:02 +01:00
Aleksander Morgado
377691afd4 port-qmi: asynchronous close operation always
To be in sync with the qmi_device_close_async() underlying method,
given that the synchronous one is deprecated.
2020-01-22 13:56:59 +01:00
Aleksander Morgado
bf76fcd526 port-qmi: use qmi_device_close_async() in the port open logic
The qmi_device_close() synchronous operation is deprecated.
2020-01-22 13:15:08 +01:00
Aleksander Morgado
de8b6dd019 port-mbim: use qmi_device_close_async()
The qmi_device_close() synchronous operation is deprecated.
2020-01-22 13:15:08 +01:00
Aleksander Morgado
31c94a883b broadband-modem-qmi: no longer need QMI port cleanup in finalize()
We're already doing it in dispose() since commit
00bb228472.
2020-01-22 13:11:24 +01:00