]> granicus.if.org Git - vim/commitdiff
patch 8.0.1215: newer gcc warns for implicit fallthrough v8.0.1215
authorBram Moolenaar <Bram@vim.org>
Tue, 24 Oct 2017 19:49:36 +0000 (21:49 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 24 Oct 2017 19:49:36 +0000 (21:49 +0200)
Problem:    Newer gcc warns for implicit fallthrough.
Solution:   Consistently use a FALLTHROUGH comment. (Christian Brabandt)

14 files changed:
src/buffer.c
src/edit.c
src/eval.c
src/ex_docmd.c
src/ex_getln.c
src/if_perl.xs
src/main.c
src/message.c
src/normal.c
src/regexp.c
src/regexp_nfa.c
src/spell.c
src/version.c
src/window.c

index 1bf692a83093c7472cbe8d02101bf91baa3b278b..0d69b9d66b813cce295261aab46865df6f4d00f5 100644 (file)
@@ -4325,6 +4325,7 @@ build_stl_str_hl(
 
        case STL_OFFSET_X:
            base = 'X';
+           /* FALLTHROUGH */
        case STL_OFFSET:
 #ifdef FEAT_BYTEOFF
            l = ml_find_line_or_offset(wp->w_buffer, wp->w_cursor.lnum, NULL);
@@ -4336,6 +4337,7 @@ build_stl_str_hl(
 
        case STL_BYTEVAL_X:
            base = 'X';
+           /* FALLTHROUGH */
        case STL_BYTEVAL:
            num = byteval;
            if (num == NL)
index 5f513068ae3c21b6d9a1a058464d96f62c98f944..a1796205221c9257fdfdd558868aa7a3a5871378 100644 (file)
@@ -984,7 +984,7 @@ edit(
        case ESC:       /* End input mode */
            if (echeck_abbr(ESC + ABBR_OFF))
                break;
-           /*FALLTHROUGH*/
+           /* FALLTHROUGH */
 
        case Ctrl_C:    /* End input mode */
 #ifdef FEAT_CMDWIN
@@ -5774,13 +5774,16 @@ 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 */
            case '~':
                if (!p_magic)   /* quote these only if magic is set */
                    break;
+               /* FALLTHROUGH */
            case '\\':
                if (ctrl_x_mode == CTRL_X_DICTIONARY
                                           || ctrl_x_mode == CTRL_X_THESAURUS)
                    break;
+               /* FALLTHROUGH */
            case '^':           /* currently it's not needed. */
            case '$':
                m++;
index d4fba7fe0d0b2dbf3a642b6b7a4e02f15926c312..8cb91e783da577d9398c71e89395e7c95115520b 100644 (file)
@@ -6995,7 +6995,7 @@ free_tv(typval_T *varp)
        {
            case VAR_FUNC:
                func_unref(varp->vval.v_string);
-               /*FALLTHROUGH*/
+               /* FALLTHROUGH */
            case VAR_STRING:
                vim_free(varp->vval.v_string);
                break;
@@ -7040,7 +7040,7 @@ clear_tv(typval_T *varp)
        {
            case VAR_FUNC:
                func_unref(varp->vval.v_string);
-               /*FALLTHROUGH*/
+               /* FALLTHROUGH */
            case VAR_STRING:
                vim_free(varp->vval.v_string);
                varp->vval.v_string = NULL;
index ea6df86ad0cc5703dfad252310a92f92205c02c6..036569f76c31731e9477590602d223ef5beaadb9 100644 (file)
@@ -4115,7 +4115,7 @@ set_one_cmd_context(
        case CMD_bunload:
            while ((xp->xp_pattern = vim_strchr(arg, ' ')) != NULL)
                arg = xp->xp_pattern + 1;
-           /*FALLTHROUGH*/
+           /* FALLTHROUGH */
        case CMD_buffer:
        case CMD_sbuffer:
        case CMD_checktime:
index 6876a215a82b305ceb487f16f6043a500be9d1b2..ba6a403597dd6f41a1f5b9da7cb4399f12b14ca3 100644 (file)
@@ -1563,9 +1563,8 @@ getcmdline(
                        break;
                    goto cmdline_not_changed;
                }
-               /* FALLTHROUGH */
-
 #ifdef FEAT_CMDHIST
+               /* FALLTHROUGH */
        case K_UP:
        case K_DOWN:
        case K_S_UP:
index 4ead057c1ccbe344c005e947884228a1ebab9922..2e6004bb9374d81619f6040564c0d3ecc599a2d6 100644 (file)
@@ -1101,6 +1101,7 @@ perl_to_vim(SV *sv, typval_T *rettv)
                rettv->vval.v_number = SvIV(sv);
                break;
            }
+           /* FALLTHROUGH */
        case SVt_PV:    /* string */
        {
            size_t  len         = 0;
index 3db8efb9ba768d0a57858ea17282eb3618701c9c..0dad4d6a804ecb181176efc9af92665b881af9ff 100644 (file)
@@ -2228,7 +2228,7 @@ command_line_scan(mparm_T *parmp)
                    argv_idx = -1;
                    break;
                }
-               /*FALLTHROUGH*/
+               /* FALLTHROUGH */
            case 'S':           /* "-S {file}" execute Vim script */
            case 'i':           /* "-i {viminfo}" use for viminfo */
 #ifndef FEAT_DIFF
@@ -2386,7 +2386,7 @@ scripterror:
                        argv_idx = -1;
                        break;
                    }
-                   /*FALLTHROUGH*/
+                   /* FALLTHROUGH */
                case 'W':       /* "-W {scriptout}" overwrite script file */
                    if (scriptout != NULL)
                        goto scripterror;
index af22607591f860645511eaaefb04a5ba4aaa0438..41ab17a3f69431e976c0230058c8ed1922763436 100644 (file)
@@ -670,7 +670,8 @@ emsg(char_u *s)
 
        ex_exitval = 1;
 
-       /* Reset msg_silent, an error causes messages to be switched back on. */
+       /* Reset msg_silent, an error causes messages to be switched back on.
+        */
        msg_silent = 0;
        cmd_silent = FALSE;
 
@@ -2837,7 +2838,7 @@ 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:
index fbeffe51e9c4fbe44681121e5d2546441afa3537..e781cd70e23fc40e0cc2c33300b5d87217b0703f 100644 (file)
@@ -1945,6 +1945,7 @@ do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank)
                AppendToRedobuff((char_u *)"!\r");  /* use any last used !cmd */
            else
                bangredo = TRUE;    /* do_bang() will put cmd in redo buffer */
+           /* FALLTHROUGH */
 
        case OP_INDENT:
        case OP_COLON:
@@ -5150,7 +5151,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 */
@@ -8267,7 +8268,7 @@ 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;
@@ -8328,7 +8329,7 @@ nv_g_cmd(cmdarg_T *cap)
     case 'q':
     case 'w':
        oap->cursor_start = curwin->w_cursor;
-       /*FALLTHROUGH*/
+       /* FALLTHROUGH */
     case '~':
     case 'u':
     case 'U':
@@ -9117,7 +9118,7 @@ nv_edit(cmdarg_T *cap)
                 * the first column, then it inserts. */
                if (curwin->w_cursor.col == 0)
                    break;
-               /*FALLTHROUGH*/
+               /* FALLTHROUGH */
 
            case 'a':   /* "a"ppend is like "i"nsert on the next character. */
 #ifdef FEAT_VIRTUALEDIT
index c4745ce7a4109e6d268e5103e2037c823fec757c..a5d7a13a4286e061b3247a3999e372cde388a259 100644 (file)
@@ -1997,7 +1997,7 @@ regatom(int *flagp)
            goto collection;
 
        /* "\_x" is character class plus newline */
-       /*FALLTHROUGH*/
+       /* FALLTHROUGH */
 
        /*
         * Character classes.
@@ -5847,7 +5847,7 @@ regrepeat(
       case IDENT:
       case IDENT + ADD_NL:
        testval = TRUE;
-       /*FALLTHROUGH*/
+       /* FALLTHROUGH */
       case SIDENT:
       case SIDENT + ADD_NL:
        while (count < maxcount)
@@ -5877,7 +5877,7 @@ regrepeat(
       case KWORD:
       case KWORD + ADD_NL:
        testval = TRUE;
-       /*FALLTHROUGH*/
+       /* FALLTHROUGH */
       case SKWORD:
       case SKWORD + ADD_NL:
        while (count < maxcount)
@@ -5908,7 +5908,7 @@ regrepeat(
       case FNAME:
       case FNAME + ADD_NL:
        testval = TRUE;
-       /*FALLTHROUGH*/
+       /* FALLTHROUGH */
       case SFNAME:
       case SFNAME + ADD_NL:
        while (count < maxcount)
@@ -5938,7 +5938,7 @@ regrepeat(
       case PRINT:
       case PRINT + ADD_NL:
        testval = TRUE;
-       /*FALLTHROUGH*/
+       /* FALLTHROUGH */
       case SPRINT:
       case SPRINT + ADD_NL:
        while (count < maxcount)
@@ -6131,7 +6131,7 @@ do_class:
       case ANYOF:
       case ANYOF + ADD_NL:
        testval = TRUE;
-       /*FALLTHROUGH*/
+       /* FALLTHROUGH */
 
       case ANYBUT:
       case ANYBUT + ADD_NL:
index 40d6605f01402e6a204ca2e1d67c9735baff5171..86061a3a502e6a8f36eb75a157c2796e6ef13b34 100644 (file)
@@ -1320,7 +1320,7 @@ nfa_regatom(void)
                goto collection;
 
        /* "\_x" is character class plus newline */
-       /*FALLTHROUGH*/
+       /* FALLTHROUGH */
 
        /*
         * Character classes.
@@ -4698,6 +4698,7 @@ skip_add:
                subs = addstate(l, state->out, subs, pim, off_arg);
                break;
            }
+           /* FALLTHROUGH */
        case NFA_MCLOSE1:
        case NFA_MCLOSE2:
        case NFA_MCLOSE3:
index eb1b9fb6c88b223648b6fcc5303cd8cbf2406c90..cdcf822957693663f25b495b82cd3dc98d7a2a84 100644 (file)
@@ -5019,7 +5019,7 @@ suggest_trie_walk(
            }
            PROF_STORE(sp->ts_state)
            sp->ts_state = STATE_PLAIN;
-           /*FALLTHROUGH*/
+           /* FALLTHROUGH */
 
        case STATE_PLAIN:
            /*
@@ -5243,7 +5243,7 @@ suggest_trie_walk(
                }
                break;
            }
-           /*FALLTHROUGH*/
+           /* FALLTHROUGH */
 
        case STATE_INS_PREP:
            if (sp->ts_flags & TSF_DIDDEL)
@@ -5277,7 +5277,7 @@ suggest_trie_walk(
            }
            break;
 
-           /*FALLTHROUGH*/
+           /* FALLTHROUGH */
 
        case STATE_INS:
            /* Insert one byte.  Repeat this for each possible byte at this
@@ -5464,7 +5464,7 @@ suggest_trie_walk(
                *p = p[1];
                p[1] = c;
            }
-           /*FALLTHROUGH*/
+           /* FALLTHROUGH */
 
        case STATE_SWAP3:
            /* Swap two bytes, skipping one: "123" -> "321".  We change
@@ -5703,7 +5703,7 @@ suggest_trie_walk(
                p[1] = p[2];
                p[2] = c;
            }
-           /*FALLTHROUGH*/
+           /* FALLTHROUGH */
 
        case STATE_REP_INI:
            /* Check if matching with REP items from the .aff file would work.
@@ -5736,7 +5736,7 @@ suggest_trie_walk(
 
            PROF_STORE(sp->ts_state)
            sp->ts_state = STATE_REP;
-           /*FALLTHROUGH*/
+           /* FALLTHROUGH */
 
        case STATE_REP:
            /* Try matching with REP items from the .aff file.  For each match
index c8bab5d4cebd0cef221b20923f6b4b03b52c0bfb..05db90f1bf7a5c717a0c1e11944465b13f46971d 100644 (file)
@@ -761,6 +761,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1215,
 /**/
     1214,
 /**/
index 96e32d8ef2ceec017e0c4d949db4f0c8e9a6f17b..ad084a4ebd1d30365841e8b209789ef46ebc823b 100644 (file)
@@ -433,8 +433,8 @@ newwindow:
                    g_do_tagpreview = Prenum;
                else
                    g_do_tagpreview = p_pvh;
-               /*FALLTHROUGH*/
 #endif
+               /* FALLTHROUGH */
     case ']':
     case Ctrl_RSB:
                CHECK_CMDWIN
@@ -557,8 +557,8 @@ wingotofile:
                            g_do_tagpreview = Prenum;
                        else
                            g_do_tagpreview = p_pvh;
-                       /*FALLTHROUGH*/
 #endif
+                       /* FALLTHROUGH */
                    case ']':
                    case Ctrl_RSB:
                        /* keep Visual mode, can select words to use as a tag */