From 3e950664aa8297e56983bbf1b94d765dc5ce3bc0 Mon Sep 17 00:00:00 2001
From: Andreas Mohr <and@gmx.li>
Date: Sat, 5 Dec 2020 11:51:30 +0000
Subject: [PATCH] fix missing fallthrough label warnings
Clang 11 is more ruthless against missing fallthrough label
xstrtol.c:179:9: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
util.c:786:21: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
achown.c:495:9: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
hotlist.c:291:9: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
fish.c:942:9: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
datasource.c:357:5: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
edit.c:3429:5: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
edit.c:3457:5: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
edit.c:4001:9: error: unannotated fall-through between switch labels [-Werror,-Wimplicit-fallthrough]
Signed-off-by: Andreas Mohr <and@gmx.li>
---
lib/strutil/xstrtol.c | 1 +
lib/util.c | 1 +
src/editor/edit.c | 3 +++
src/filemanager/achown.c | 1 +
src/filemanager/hotlist.c | 1 +
src/vfs/fish/fish.c | 1 +
src/viewer/datasource.c | 1 +
7 files changed, 9 insertions(+)
diff --git a/lib/strutil/xstrtol.c b/lib/strutil/xstrtol.c
index 070b3e6bb..4772c9a97 100644
a
|
b
|
xstrtoumax (const char *s, char **ptr, int base, uintmax_t * val, const char *va |
176 | 176 | break; |
177 | 177 | } |
178 | 178 | } |
| 179 | MC_FALLTHROUGH; |
179 | 180 | default: |
180 | 181 | break; |
181 | 182 | } |
diff --git a/lib/util.c b/lib/util.c
index 9f71d9a20..64963a7fe 100644
a
|
b
|
strip_ctrl_codes (char *s) |
783 | 783 | r = new_r + 1; |
784 | 784 | goto osc_out; |
785 | 785 | } |
| 786 | MC_FALLTHROUGH; |
786 | 787 | default: |
787 | 788 | break; |
788 | 789 | } |
diff --git a/src/editor/edit.c b/src/editor/edit.c
index e13be389a..7d6c29424 100644
a
|
b
|
edit_execute_cmd (WEdit * edit, long command, int char_for_insertion) |
3426 | 3426 | edit->column_highlight = 0; |
3427 | 3427 | edit_mark_cmd (edit, TRUE); |
3428 | 3428 | } |
| 3429 | MC_FALLTHROUGH; |
3429 | 3430 | default: |
3430 | 3431 | break; |
3431 | 3432 | } |
… |
… |
edit_execute_cmd (WEdit * edit, long command, int char_for_insertion) |
3454 | 3455 | case CK_MarkLeft: |
3455 | 3456 | case CK_MarkRight: |
3456 | 3457 | edit->force |= REDRAW_CHAR_ONLY; |
| 3458 | MC_FALLTHROUGH; |
3457 | 3459 | default: |
3458 | 3460 | break; |
3459 | 3461 | } |
… |
… |
edit_execute_cmd (WEdit * edit, long command, int char_for_insertion) |
3998 | 4000 | case CK_DeleteToEnd: |
3999 | 4001 | format_paragraph (edit, FALSE); |
4000 | 4002 | edit->force |= REDRAW_PAGE; |
| 4003 | MC_FALLTHROUGH; |
4001 | 4004 | default: |
4002 | 4005 | break; |
4003 | 4006 | } |
diff --git a/src/filemanager/achown.c b/src/filemanager/achown.c
index 315d4103f..9fa82d737 100644
a
|
b
|
chl_callback (Widget * w, Widget * sender, widget_msg_t msg, int parm, void *dat |
492 | 492 | h->ret_value = parm; |
493 | 493 | dlg_stop (h); |
494 | 494 | } |
| 495 | MC_FALLTHROUGH; |
495 | 496 | default: |
496 | 497 | break; |
497 | 498 | } |
diff --git a/src/filemanager/hotlist.c b/src/filemanager/hotlist.c
index f0fe44486..e5d4d63fb 100644
a
|
b
|
fill_listbox (WListbox * list) |
288 | 288 | case HL_TYPE_DOTDOT: |
289 | 289 | case HL_TYPE_ENTRY: |
290 | 290 | listbox_add_item (list, LISTBOX_APPEND_AT_END, 0, current->label, current, FALSE); |
| 291 | MC_FALLTHROUGH; |
291 | 292 | default: |
292 | 293 | break; |
293 | 294 | } |
diff --git a/src/vfs/fish/fish.c b/src/vfs/fish/fish.c
index 5cd279f95..ad0ad85ef 100644
a
|
b
|
fish_dir_load (struct vfs_class *me, struct vfs_s_inode *dir, char *remote_path) |
939 | 939 | ST.st_rdev = makedev (maj, min); |
940 | 940 | #endif |
941 | 941 | } |
| 942 | MC_FALLTHROUGH; |
942 | 943 | default: |
943 | 944 | break; |
944 | 945 | } |
diff --git a/src/viewer/datasource.c b/src/viewer/datasource.c
index 1f97e8dd1..b88b07b01 100644
a
|
b
|
mcview_close_datasource (WView * view) |
354 | 354 | break; |
355 | 355 | case DS_STRING: |
356 | 356 | MC_PTR_FREE (view->ds_string_data); |
| 357 | MC_FALLTHROUGH; |
357 | 358 | default: |
358 | 359 | break; |
359 | 360 | } |