vim-patch:8.0.1215: newer gcc warns for implicit fallthrough

Problem:    Newer gcc warns for implicit fallthrough.
Solution:   Consistently use a FALLTHROUGH comment. (Christian Brabandt)
2f40d129bf
This commit is contained in:
Jan Edmund Lazo 2018-09-20 06:32:15 -04:00
parent 47d74bf32f
commit 6a329b0548
11 changed files with 32 additions and 30 deletions

View File

@ -3723,7 +3723,7 @@ int build_stl_str_hl(
case STL_OFFSET_X:
base = kNumBaseHexadecimal;
// fallthrough
FALLTHROUGH;
case STL_OFFSET:
{
long l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL);
@ -3734,7 +3734,7 @@ int build_stl_str_hl(
}
case STL_BYTEVAL_X:
base = kNumBaseHexadecimal;
// fallthrough
FALLTHROUGH;
case STL_BYTEVAL:
num = byteval;
if (num == NL)

View File

@ -775,7 +775,7 @@ static int insert_handle_key(InsertState *s)
if (echeck_abbr(ESC + ABBR_OFF)) {
break;
}
// FALLTHROUGH
FALLTHROUGH;
case Ctrl_C: // End input mode
if (s->c == Ctrl_C && cmdwin_type != 0) {
@ -4967,16 +4967,16 @@ static unsigned quote_meta(char_u *dest, char_u *src, int len)
if (ctrl_x_mode == CTRL_X_DICTIONARY
|| ctrl_x_mode == CTRL_X_THESAURUS)
break;
// fallthrough
FALLTHROUGH;
case '~':
if (!p_magic) /* quote these only if magic is set */
break;
// fallthrough
FALLTHROUGH;
case '\\':
if (ctrl_x_mode == CTRL_X_DICTIONARY
|| ctrl_x_mode == CTRL_X_THESAURUS)
break;
// fallthrough
FALLTHROUGH;
case '^': // currently it's not needed.
case '$':
m++;

View File

@ -3290,7 +3290,7 @@ const char * set_one_cmd_context(
while ((xp->xp_pattern = (char_u *)strchr(arg, ' ')) != NULL) {
arg = (const char *)xp->xp_pattern + 1;
}
// FALLTHROUGH
FALLTHROUGH;
case CMD_buffer:
case CMD_sbuffer:
case CMD_checktime:

View File

@ -1587,7 +1587,7 @@ static int command_line_handle_key(CommandLineState *s)
}
return command_line_not_changed(s);
}
// fallthrough
FALLTHROUGH;
case K_UP:
case K_DOWN:

View File

@ -1045,7 +1045,8 @@ static void command_line_scan(mparm_T *parmp)
argv_idx = -1;
break;
}
} // FALLTHROUGH
FALLTHROUGH;
}
case 'S': // "-S {file}" execute Vim script
case 'i': // "-i {shada}" use for ShaDa file
case 'u': // "-u {vimrc}" vim inits file
@ -1189,7 +1190,8 @@ scripterror:
argv_idx = -1;
break;
}
} // FALLTHROUGH
FALLTHROUGH;
}
case 'W': { // "-W {scriptout}" overwrite script file
if (scriptout != NULL) {
goto scripterror;

View File

@ -2255,7 +2255,7 @@ static int do_more_prompt(int typed_char)
skip_redraw = TRUE; /* skip redraw once */
need_wait_return = FALSE; /* don't wait in main() */
}
/*FALLTHROUGH*/
FALLTHROUGH;
case 'q': /* quit */
case Ctrl_C:
case ESC:

View File

@ -1867,7 +1867,7 @@ void do_pending_operator(cmdarg_T *cap, int old_col, bool gui_yank)
} else {
bangredo = true; // do_bang() will put cmd in redo buffer.
}
// fallthrough
FALLTHROUGH;
case OP_INDENT:
case OP_COLON:
@ -4480,7 +4480,7 @@ dozet:
break;
}
undo = true;
/*FALLTHROUGH*/
FALLTHROUGH;
case 'g': /* "zg": add good word to word list */
case 'w': /* "zw": add wrong word to word list */
@ -6907,7 +6907,7 @@ static void nv_g_cmd(cmdarg_T *cap)
/* "g'm" and "g`m": jump to mark without setting pcmark */
case '\'':
cap->arg = true;
/*FALLTHROUGH*/
FALLTHROUGH;
case '`':
nv_gomark(cap);
break;
@ -6965,7 +6965,7 @@ static void nv_g_cmd(cmdarg_T *cap)
case 'q':
case 'w':
oap->cursor_start = curwin->w_cursor;
/*FALLTHROUGH*/
FALLTHROUGH;
case '~':
case 'u':
case 'U':

View File

@ -1806,7 +1806,7 @@ static char_u *regatom(int *flagp)
goto collection;
/* "\_x" is character class plus newline */
/*FALLTHROUGH*/
FALLTHROUGH;
/*
* Character classes.
@ -5155,7 +5155,7 @@ regrepeat (
case IDENT:
case IDENT + ADD_NL:
testval = TRUE;
/*FALLTHROUGH*/
FALLTHROUGH;
case SIDENT:
case SIDENT + ADD_NL:
while (count < maxcount) {
@ -5182,7 +5182,7 @@ regrepeat (
case KWORD:
case KWORD + ADD_NL:
testval = TRUE;
/*FALLTHROUGH*/
FALLTHROUGH;
case SKWORD:
case SKWORD + ADD_NL:
while (count < maxcount) {
@ -5211,7 +5211,7 @@ regrepeat (
case FNAME:
case FNAME + ADD_NL:
testval = TRUE;
/*FALLTHROUGH*/
FALLTHROUGH;
case SFNAME:
case SFNAME + ADD_NL:
while (count < maxcount) {
@ -5239,7 +5239,7 @@ regrepeat (
case PRINT:
case PRINT + ADD_NL:
testval = TRUE;
/*FALLTHROUGH*/
FALLTHROUGH;
case SPRINT:
case SPRINT + ADD_NL:
while (count < maxcount) {
@ -5418,7 +5418,7 @@ do_class:
case ANYOF:
case ANYOF + ADD_NL:
testval = TRUE;
/*FALLTHROUGH*/
FALLTHROUGH;
case ANYBUT:
case ANYBUT + ADD_NL:

View File

@ -1221,7 +1221,7 @@ static int nfa_regatom(void)
goto collection;
/* "\_x" is character class plus newline */
/*FALLTHROUGH*/
FALLTHROUGH;
/*
* Character classes.
@ -4209,7 +4209,7 @@ skip_add:
subs = addstate(l, state->out, subs, pim, off_arg);
break;
}
// fallthrough
FALLTHROUGH;
case NFA_MCLOSE1:
case NFA_MCLOSE2:
case NFA_MCLOSE3:

View File

@ -4204,7 +4204,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
}
PROF_STORE(sp->ts_state)
sp->ts_state = STATE_PLAIN;
// FALLTHROUGH
FALLTHROUGH;
case STATE_PLAIN:
// Go over all possible bytes at this node, add each to tword[]
@ -4386,7 +4386,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
break;
}
// FALLTHROUGH
FALLTHROUGH;
case STATE_INS_PREP:
if (sp->ts_flags & TSF_DIDDEL) {
@ -4416,7 +4416,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
}
break;
// FALLTHROUGH
FALLTHROUGH;
case STATE_INS:
// Insert one byte. Repeat this for each possible byte at this
@ -4552,7 +4552,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
memmove(p + MB_PTR2LEN(p + n), p, n);
utf_char2bytes(c, p);
// FALLTHROUGH
FALLTHROUGH;
case STATE_SWAP3:
// Swap two bytes, skipping one: "123" -> "321". We change
@ -4695,7 +4695,7 @@ static void suggest_trie_walk(suginfo_T *su, langp_T *lp, char_u *fword, bool so
memmove(p, p + tl, n);
utf_char2bytes(c, p + n);
// FALLTHROUGH
FALLTHROUGH;
case STATE_REP_INI:
// Check if matching with REP items from the .aff file would work.

View File

@ -367,7 +367,7 @@ newwindow:
g_do_tagpreview = Prenum;
else
g_do_tagpreview = p_pvh;
/*FALLTHROUGH*/
FALLTHROUGH;
case ']':
case Ctrl_RSB:
CHECK_CMDWIN
@ -465,7 +465,7 @@ wingotofile:
g_do_tagpreview = Prenum;
else
g_do_tagpreview = p_pvh;
/*FALLTHROUGH*/
FALLTHROUGH;
case ']':
case Ctrl_RSB:
// Keep visual mode, can select words to use as a tag.