aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2020-01-31 10:08:08 +0100
committerAleksander Morgado <aleksander@aleksander.es>2020-01-31 15:18:35 +0100
commit1216e887168c580b5cd868dfa3f798ab90a43001 (patch)
treec3665c60da2370042dd369691aedf00ae3387c90
parentc32fdcefefb4d953bd4d7694cfc6b65d4beb9924 (diff)
cli: fix warnings with -Wswitch-default
mmcli-output.c: In function ‘output_item_free’: mmcli-output.c:321:5: error: switch missing default case [-Werror=switch-default] 321 | switch (item->type) { | ^~~~~~ mmcli-output.c: In function ‘mmcli_output_dump’: mmcli-output.c:1208:5: error: switch missing default case [-Werror=switch-default] 1208 | switch (selected_type) { | ^~~~~~ mmcli-output.c: In function ‘mmcli_output_list_dump’: mmcli-output.c:1231:5: error: switch missing default case [-Werror=switch-default] 1231 | switch (selected_type) { | ^~~~~~
-rw-r--r--cli/mmcli-common.c5
-rw-r--r--cli/mmcli-output.c6
2 files changed, 8 insertions, 3 deletions
diff --git a/cli/mmcli-common.c b/cli/mmcli-common.c
index 1c63d849..10a1fb75 100644
--- a/cli/mmcli-common.c
+++ b/cli/mmcli-common.c
@@ -1551,10 +1551,9 @@ mmcli_get_state_reason_string (MMModemStateChangeReason reason)
return "Suspend";
case MM_MODEM_STATE_CHANGE_REASON_FAILURE:
return "Failure";
+ default:
+ g_assert_not_reached ();
}
-
- g_warn_if_reached ();
- return NULL;
}
/* Common options */
diff --git a/cli/mmcli-output.c b/cli/mmcli-output.c
index 62a7a6fb..25877b0b 100644
--- a/cli/mmcli-output.c
+++ b/cli/mmcli-output.c
@@ -332,6 +332,8 @@ output_item_free (OutputItem *item)
g_free (((OutputItemListitem *)item)->value);
g_free (((OutputItemListitem *)item)->extra);
break;
+ default:
+ g_assert_not_reached ();
}
}
@@ -1217,6 +1219,8 @@ mmcli_output_dump (void)
case MMC_OUTPUT_TYPE_JSON:
dump_output_json ();
break;
+ default:
+ g_assert_not_reached ();
}
g_list_free_full (output_items, (GDestroyNotify) output_item_free);
@@ -1240,6 +1244,8 @@ mmcli_output_list_dump (MmcF field)
case MMC_OUTPUT_TYPE_JSON:
dump_output_list_json (field);
break;
+ default:
+ g_assert_not_reached ();
}
g_list_free_full (output_items, (GDestroyNotify) output_item_free);