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: case STL_OFFSET_X:
base = kNumBaseHexadecimal; base = kNumBaseHexadecimal;
// fallthrough FALLTHROUGH;
case STL_OFFSET: case STL_OFFSET:
{ {
long l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL); 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: case STL_BYTEVAL_X:
base = kNumBaseHexadecimal; base = kNumBaseHexadecimal;
// fallthrough FALLTHROUGH;
case STL_BYTEVAL: case STL_BYTEVAL:
num = byteval; num = byteval;
if (num == NL) if (num == NL)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1221,7 +1221,7 @@ static int nfa_regatom(void)
goto collection; goto collection;
/* "\_x" is character class plus newline */ /* "\_x" is character class plus newline */
/*FALLTHROUGH*/ FALLTHROUGH;
/* /*
* Character classes. * Character classes.
@ -4209,7 +4209,7 @@ skip_add:
subs = addstate(l, state->out, subs, pim, off_arg); subs = addstate(l, state->out, subs, pim, off_arg);
break; break;
} }
// fallthrough FALLTHROUGH;
case NFA_MCLOSE1: case NFA_MCLOSE1:
case NFA_MCLOSE2: case NFA_MCLOSE2:
case NFA_MCLOSE3: 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) PROF_STORE(sp->ts_state)
sp->ts_state = STATE_PLAIN; sp->ts_state = STATE_PLAIN;
// FALLTHROUGH FALLTHROUGH;
case STATE_PLAIN: case STATE_PLAIN:
// Go over all possible bytes at this node, add each to tword[] // 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; break;
} }
// FALLTHROUGH FALLTHROUGH;
case STATE_INS_PREP: case STATE_INS_PREP:
if (sp->ts_flags & TSF_DIDDEL) { 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; break;
// FALLTHROUGH FALLTHROUGH;
case STATE_INS: case STATE_INS:
// Insert one byte. Repeat this for each possible byte at this // 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); memmove(p + MB_PTR2LEN(p + n), p, n);
utf_char2bytes(c, p); utf_char2bytes(c, p);
// FALLTHROUGH FALLTHROUGH;
case STATE_SWAP3: case STATE_SWAP3:
// Swap two bytes, skipping one: "123" -> "321". We change // 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); memmove(p, p + tl, n);
utf_char2bytes(c, p + n); utf_char2bytes(c, p + n);
// FALLTHROUGH FALLTHROUGH;
case STATE_REP_INI: case STATE_REP_INI:
// Check if matching with REP items from the .aff file would work. // Check if matching with REP items from the .aff file would work.

View File

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