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) {
| ^~~~~~
This commit is contained in:
+2
-3
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user