From: Richard Russon Date: Sat, 25 Nov 2017 00:18:30 +0000 (+0000) Subject: fallthrough X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4858380fd7566a8d532f8c02862c6fc4c0b4801d;p=neomutt fallthrough --- diff --git a/browser.c b/browser.c index 4fb2ce980..fc90239b6 100644 --- a/browser.c +++ b/browser.c @@ -1470,8 +1470,7 @@ void mutt_select_file(char *f, size_t flen, int flags, char ***files, int *numfi #endif else mutt_file_concat_path(f, LastDir, state.entry[menu->current].name, flen); - - /* Fall through to OP_EXIT */ + /* fallthrough */ case OP_EXIT: diff --git a/compose.c b/compose.c index ee1effc32..0d66014d0 100644 --- a/compose.c +++ b/compose.c @@ -1531,8 +1531,7 @@ int mutt_compose_menu(struct Header *msg, /* structure for new message */ } else if (i == MUTT_ABORT) break; /* abort */ - - /* fall through to postpone! */ + /* fallthrough */ case OP_COMPOSE_POSTPONE_MESSAGE: diff --git a/curs_main.c b/curs_main.c index ed6379ce9..3bf6fd785 100644 --- a/curs_main.c +++ b/curs_main.c @@ -1232,6 +1232,7 @@ int mutt_index_menu(void) case OP_GET_PARENT: CHECK_MSGCOUNT; CHECK_VISIBLE; + /* fallthrough */ case OP_GET_MESSAGE: CHECK_IN_MAILBOX; @@ -3167,12 +3168,11 @@ int mutt_index_menu(void) #ifdef USE_NNTP case OP_FOLLOWUP: case OP_FORWARD_TO_GROUP: - CHECK_MSGCOUNT; CHECK_VISIBLE; + /* fallthrough */ case OP_POST: - CHECK_ATTACH; if (op != OP_FOLLOWUP || !CURHDR->env->followup_to || (mutt_str_strcasecmp(CURHDR->env->followup_to, "poster") != 0) || @@ -3196,7 +3196,7 @@ int mutt_index_menu(void) break; } #endif - + /* fallthrough */ case OP_REPLY: CHECK_ATTACH; diff --git a/enter.c b/enter.c index a64bd2f6a..3de82d1ff 100644 --- a/enter.c +++ b/enter.c @@ -457,8 +457,10 @@ int mutt_enter_string_full(char *buf, size_t buflen, int col, int flags, int mul break; } else if (!(flags & MUTT_FILE)) + { goto self_insert; - /* fall through to completion routine (MUTT_FILE) */ + } + /* fallthrough */ case OP_EDITOR_COMPLETE: case OP_EDITOR_COMPLETE_QUERY: diff --git a/handler.c b/handler.c index b0b3e6234..73b4d5a73 100644 --- a/handler.c +++ b/handler.c @@ -876,7 +876,8 @@ static int text_enriched_handler(struct Body *a, struct State *s) tag_len = 0; state = TAG; } - /* Yes, fall through (it wasn't a <<, so this char is first in TAG) */ + /* Yes, (it wasn't a <<, so this char is first in TAG) */ + /* fallthrough */ case TAG: if (wc == (wchar_t) '>') { diff --git a/hdrline.c b/hdrline.c index 4920adf98..c0d3af34b 100644 --- a/hdrline.c +++ b/hdrline.c @@ -506,7 +506,7 @@ static const char *hdr_format_str(char *dest, size_t destlen, size_t col, int co break; } } - /* fall through on failure */ + /* fallthrough */ case 'a': colorlen = add_index_color(dest, destlen, flags, MT_COLOR_INDEX_AUTHOR); @@ -538,7 +538,8 @@ static const char *hdr_format_str(char *dest, size_t destlen, size_t col, int co /* break if 'K' returns nothing */ break; } - /* fall through if 'B' returns nothing */ + /* if 'B' returns nothing */ + /* fallthrough */ case 'b': if (ctx) diff --git a/main.c b/main.c index 5819fe4d4..9d76d5834 100644 --- a/main.c +++ b/main.c @@ -406,6 +406,7 @@ int main(int argc, char **argv, char **env) snprintf(buf, sizeof(buf), "set news_server=%s", optarg); mutt_list_insert_tail(&commands, mutt_str_strdup(buf)); } + /* fallthrough */ case 'G': /* List of newsgroups */ flags |= MUTT_SELECT | MUTT_NEWS; diff --git a/ncrypt/smime.c b/ncrypt/smime.c index e4b8f3806..a0e17a9dc 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -2135,9 +2135,10 @@ int smime_send_menu(struct Header *msg) } break; - case 4: /* (c)lear */ + case 4: FREE(&SmimeEncryptWith); - /* fallback */ + /* (c)lear */ + /* fallthrough */ case -1: /* Ctrl-G or Enter */ choice = 0; break; diff --git a/pager.c b/pager.c index 943132ff7..230af5e0c 100644 --- a/pager.c +++ b/pager.c @@ -2451,7 +2451,8 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e break; } - /* no previous search pattern, so fall through to search */ + /* no previous search pattern */ + /* fallthrough */ case OP_SEARCH: case OP_SEARCH_REVERSE: @@ -2947,7 +2948,7 @@ int mutt_pager(const char *banner, const char *fname, int flags, struct Pager *e break; } #endif - + /* fallthrough */ case OP_REPLY: CHECK_MODE(IsHeader(extra) || IsMsgAttach(extra)); CHECK_ATTACH; diff --git a/pattern.c b/pattern.c index 8c4f94e2c..185b24016 100644 --- a/pattern.c +++ b/pattern.c @@ -1994,6 +1994,7 @@ int mutt_pattern_func(int op, char *prompt) { case MUTT_UNDELETE: mutt_set_flag(Context, Context->hdrs[Context->v2r[i]], MUTT_PURGE, 0); + /* fallthrough */ case MUTT_DELETE: mutt_set_flag(Context, Context->hdrs[Context->v2r[i]], MUTT_DELETE, (op == MUTT_DELETE)); diff --git a/query.c b/query.c index 3696cc72f..988872ec2 100644 --- a/query.c +++ b/query.c @@ -429,8 +429,7 @@ static void query_menu(char *buf, size_t buflen, struct Query *results, int retb done = 2; break; } - /* fall through to OP_MAIL */ - + /* fallthrough */ case OP_MAIL: msg = mutt_new_header(); msg->env = mutt_new_envelope(); diff --git a/recvattach.c b/recvattach.c index da28008bb..f6c0c0386 100644 --- a/recvattach.c +++ b/recvattach.c @@ -232,8 +232,10 @@ const char *mutt_attach_fmt(char *dest, size_t destlen, size_t col, int cols, else if (aptr->content->description || (mutt_is_message_type(aptr->content->type, aptr->content->subtype) && MessageFormat && aptr->content->hdr)) + { break; - /* FALLS THROUGH TO 'F' */ + } + /* fallthrough */ case 'F': if (!optional) { @@ -248,7 +250,7 @@ const char *mutt_attach_fmt(char *dest, size_t destlen, size_t col, int cols, optional = 0; break; } - /* FALLS THROUGH TO 'f' */ + /* fallthrough */ case 'f': if (!optional) { @@ -1359,8 +1361,8 @@ void mutt_view_attachments(struct Header *hdr) if (!CURATTACH->content->hdr->env->followup_to || (mutt_str_strcasecmp(CURATTACH->content->hdr->env->followup_to, "poster") != 0) || - query_quadoption(OPT_FOLLOWUP_TO_POSTER, - _("Reply by mail as poster prefers?")) != MUTT_YES) + (query_quadoption(OPT_FOLLOWUP_TO_POSTER, + _("Reply by mail as poster prefers?")) != MUTT_YES)) { mutt_attach_reply(CURATTACH->fp, hdr, actx, menu->tagprefix ? NULL : CURATTACH->content, @@ -1369,7 +1371,7 @@ void mutt_view_attachments(struct Header *hdr) break; } #endif - + /* fallthrough */ case OP_REPLY: case OP_GROUP_REPLY: case OP_LIST_REPLY: diff --git a/signal.c b/signal.c index 0f5ebb302..0e3b8d1c2 100644 --- a/signal.c +++ b/signal.c @@ -80,6 +80,7 @@ static void sighandler(int sig) if (!IsEndwin) endwin(); kill(0, SIGSTOP); + /* fallthrough */ case SIGCONT: if (!IsEndwin)