]> diplodocus.org Git - nmh/commitdiff
Added /* FALLTHRU */ comments where gcc 7 noticed their need.
authorDavid Levine <levinedl@acm.org>
Mon, 27 Feb 2017 03:50:42 +0000 (22:50 -0500)
committerDavid Levine <levinedl@acm.org>
Mon, 27 Feb 2017 04:03:29 +0000 (23:03 -0500)
And replaced similar comments to be consistent.  Used that comment
because it satisfies gcc -Wimplicit-fallthrough=4.

36 files changed:
config/config.c
mts/smtp/smtp.c
sbr/addrsbr.c
sbr/cpydgst.c
sbr/fmt_compile.c
sbr/fmt_new.c
sbr/m_getfld.c
sbr/mf.c
sbr/mts.c
sbr/ruserpass.c
sbr/seq_read.c
uip/aliasbr.c
uip/burst.c
uip/comp.c
uip/fmtdump.c
uip/fmttest.c
uip/forw.c
uip/inc.c
uip/mhbuildsbr.c
uip/mhlsbr.c
uip/mhparse.c
uip/mhshowsbr.c
uip/new.c
uip/picksbr.c
uip/popsbr.c
uip/post.c
uip/rcvdist.c
uip/repl.c
uip/rmf.c
uip/scansbr.c
uip/send.c
uip/sendsbr.c
uip/show.c
uip/slocal.c
uip/whatnowsbr.c
uip/whom.c

index 020d610..81c3683 100644 (file)
@@ -63,7 +63,8 @@ etcpath (char *file)
                *--cp = '/';
 
            if (access (epath, R_OK) != NOTOK)
-               return epath;   /* else fall */
+               return epath;
+               /* FALLTHRU */
 try_it:
 
        default: 
index 77bcb6e..78f8355 100644 (file)
@@ -623,7 +623,8 @@ sm_end (int type)
        case NOTOK: 
            sm_note.code = sm_reply.code;
            sm_note.length = sm_reply.length;
-           memcpy (sm_note.text, sm_reply.text, sm_reply.length + 1);/* fall */
+           memcpy (sm_note.text, sm_reply.text, sm_reply.length + 1);
+           /* FALLTHRU */
        case DONE: 
            if (smtalk (SM_RSET, "RSET") == 250 && type == DONE)
                return RP_OK;
@@ -764,7 +765,8 @@ sm_wstream (char *buffer, int len)
                    if (netsec_write(nsc, ".", 1, &errstr) != OK) {
                    sm_nerror(errstr);
                    return NOTOK;
-               } /* FALL THROUGH */
+               }
+               /* FALLTHRU */
 
            default: 
                sm_nl = FALSE;
index bb6c4f0..49953f6 100644 (file)
@@ -385,7 +385,8 @@ ismymbox (struct mailname *np)
 
            case UUCPHOST:
                if (strcasecmp (np->m_host, SystemName()))
-                   break;              /* fall */
+                   break;
+                   /* FALLTHRU */
            case LOCALHOST:
 local_test: ;
                if (!strcasecmp (np->m_mbox, mq.m_mbox))
index 55df3fc..53923b2 100644 (file)
@@ -51,8 +51,8 @@ cpydgst (int in, int out, char *ifile, char *ofile)
                        output ('-');
                        output (' ');
                    }
-                   state = S2; /* fall */
-
+                   state = S2;
+                   /* FALLTHRU */
                case S2: 
                    output (*cp);
                    if (*cp == '\n')
index c8618ed..f7fcff2 100644 (file)
@@ -578,7 +578,7 @@ do_name(char *sp, int preprocess)
            ismymbox ((struct mailname *) 0);
            primed++;
        }
-       /* fall through */
+       /* FALLTHRU */
     case FT_PARSEADDR:
        if (cm->c_type & CT_DATE) {
            CERROR("component used as both date and address");
@@ -740,7 +740,7 @@ do_func(char *sp)
 
     case TF_EXPR_SV:
        LV(FT_SAVESTR, 0);
-       /* fall through */
+       /* FALLTHRU */
     case TF_EXPR:
        *--cp = c;
        cp = do_expr(cp, t->extra);
index 18f4898..e5de56f 100644 (file)
@@ -102,7 +102,8 @@ normalize (char *cp)
                    break;
 
                case 0: 
-                   cp--;       /* fall */
+                   cp--;
+                   /* FALLTHRU */
                default: 
                    *dp++ = *cp;
                    break;
index f640a2a..4976b1c 100644 (file)
@@ -606,7 +606,7 @@ m_getfld (m_getfld_state_t *gstate, char name[NAMESZ], char *buf, int *bufsz,
            while (isspace ((unsigned char) *--cp) && cp >= name) continue;
            *++cp = 0;
            /* readpos points to the first character of the field body. */
-           /* fall through */
+           /* FALLTHRU */
 
        case FLDPLUS: {
            /*
index 084643b..a604ce9 100644 (file)
--- a/sbr/mf.c
+++ b/sbr/mf.c
@@ -288,6 +288,7 @@ again: ;
                strcpy (err, "extraneous semi-colon");
                return NOTOK;
            }
+           /* FALLTHRU */
        case LX_COMA: 
             mh_xfree(note);
             note = NULL;
@@ -391,6 +392,7 @@ again: ;
                        strcpy (err, "extraneous semi-colon");
                        return NOTOK;
                    }
+                   /* FALLTHRU */
                case LX_COMA: 
                case LX_END: 
                    return OK;
@@ -623,6 +625,7 @@ my_lex (char *buffer)
                    continue;
                case '(': 
                    i++;
+                   /* FALLTHRU */
                default: 
                    ADDCHR(c);
                    continue;
@@ -650,6 +653,7 @@ my_lex (char *buffer)
                        cp = NULL;
                        return (last_lex = LX_ERR);
                    }
+                   /* FALLTHRU */
                default: 
                    ADDCHR(c);
                    continue;
@@ -673,6 +677,7 @@ my_lex (char *buffer)
                        cp = NULL;
                        return (last_lex = LX_ERR);
                    }
+                   /* FALLTHRU */
                default: 
                    ADDCHR(c);
                    continue;
@@ -781,7 +786,8 @@ mfgets (FILE *in, char **bp)
                    case '\t': 
                        *cp++ = '\n';
                        break;
-               }               /* fall into default case */
+               }
+               /* FALLTHRU */
 
            default: 
                *cp++ = i;
index 285ced5..9db8106 100644 (file)
--- a/sbr/mts.c
+++ b/sbr/mts.c
@@ -182,6 +182,7 @@ tailor_value (char *s)
                case 't': *bp = '\t'; break;
 
                case 0: s--;
+                   /* FALLTHRU */
                case QUOTE: 
                    *bp = QUOTE;
                    break;
index 9784e89..2bd8d63 100644 (file)
@@ -80,7 +80,7 @@ ruserpass(const char *host, char **aname, char **apass, int flags)
            switch(t) {
            case DEFAULT:
                usedefault = 1;
-               /* FALL THROUGH */
+               /* FALLTHRU */
 
            case MACH:
                if (!usedefault) {
index 8b58639..20ba5cf 100644 (file)
@@ -104,7 +104,7 @@ seq_public (struct msgs *mp, int lockflag, int *failed_to_lock)
            case BODY:
                lkfclosedata (fp, seqfile);
                adios (NULL, "no blank lines are permitted in %s", seqfile);
-               /* fall */
+               /* FALLTHRU */
 
            case FILEEOF:
                break;
index e9724f7..015f48a 100644 (file)
@@ -202,7 +202,7 @@ alias (char *file)
                    fclose (fp);
                    return i;
                }
-
+               /* FALLTHRU */
            case ':':           /* comment */
            case ';': 
            case '#':
index 49dad2d..ab2a9e5 100644 (file)
@@ -521,6 +521,7 @@ cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len, int mime)
 
                    default: 
                        state = S2;
+                       /* FALLTHRU */
                    case '\n': 
                        fputc (c, out);
                        break;
@@ -531,6 +532,7 @@ cpybrst (FILE *in, FILE *out, char *ifile, char *ofile, int len, int mime)
                switch (c) {
                    case '\n': 
                        state = S1;
+                       /* FALLTHRU */
                    default: 
                        fputc (c, out);
                        break;
index a018d74..7ca48db 100644 (file)
@@ -123,7 +123,7 @@ main (int argc, char **argv)
 
                case BILDSW:
                    build++;
-                   /* fall through */
+                   /* FALLTHRU */
                case NWHATSW: 
                    nwhat++;
                    continue;
index 9a6e351..a23c21c 100644 (file)
@@ -266,6 +266,7 @@ dumpone(struct format *fmt)
        case FT_IF_MATCH:
        case FT_IF_AMATCH:
                printf(" continue else goto");
+               /* FALLTHRU */
        case FT_GOTO:
                i = findlabel(fmt + fmt->f_skip);
                printf(" L%d", i);
index 80b73d9..cb4c82e 100644 (file)
@@ -649,7 +649,7 @@ process_single_file(FILE *in, struct msgs_array *comps, int *dat, int msgsize,
 
                fmt_addcomptext("body", rbuf);
            }
-           /* fall through */
+           /* FALLTHRU */
 
        default:
            goto finished;
@@ -894,6 +894,7 @@ dumpone(struct format *fmt)
        case FT_IF_MATCH:
        case FT_IF_AMATCH:
                printf(" continue else goto");
+               /* FALLTHRU */
        case FT_GOTO:
                i = findlabel(fmt + fmt->f_skip);
                printf(" L%d", i);
index 5b4d901..501f651 100644 (file)
@@ -163,7 +163,8 @@ main (int argc, char **argv)
                    nwhat = 0;
                    continue;
                case BILDSW:
-                   buildsw++;  /* fall... */
+                   buildsw++;
+                   /* FALLTHRU */
                case NWHATSW: 
                    nwhat++;
                    continue;
index b32b3e1..1973a6a 100644 (file)
--- a/uip/inc.c
+++ b/uip/inc.c
@@ -690,7 +690,7 @@ go_to_it:
                trnflag = 0;
                noisy++;
                /* advise (cp, "unable to read"); already advised */
-               /* fall thru */
+               /* FALLTHRU */
 
            case SCNERR:
            case SCNNUM:
@@ -851,7 +851,7 @@ go_to_it:
                trnflag = 0;
                noisy++;
                /* advise (cp, "unable to read"); already advised */
-               /* fall thru */
+               /* FALLTHRU */
 
            case SCNERR:
            case SCNNUM:
index 2639043..c8b8799 100644 (file)
@@ -343,7 +343,7 @@ finish_field:
 
        case BODY:
            fseek (in, (long) (-strlen (buf)), SEEK_CUR);
-           /* fall through */
+           /* FALLTHRU */
        case FILEEOF:
            break;
 
@@ -809,7 +809,7 @@ rock_and_roll:
                ct->c_encoding = CE_7BIT;
                goto call_init;
            }
-           /* else fall... */
+           /* FALLTHRU */
        case CT_MULTIPART:
            adios (NULL, "it doesn't make sense to define an in-line %s content",
                   ct->c_type == CT_MESSAGE ? "message" : "multipart");
@@ -1288,7 +1288,7 @@ compose_content (CT ct, int verbose)
                    case 'F':
                        /* %f, and stdout is not-redirected */
                        xstdout = 1;
-                       /* and fall... */
+                       /* FALLTHRU */
 
                    case 'f':
                        /*
@@ -2017,7 +2017,7 @@ setup_attach_content(CT ct, char *filename)
        if (strcasecmp(ct->c_ctinfo.ci_subtype, "external-body") == 0)
            adios(NULL, "external-body messages must be specified "
                "by mhbuild directives");
-       /* Fall through */
+       /* FALLTHRU */
 
     default:
        /*
index 329ad79..f07d786 100644 (file)
@@ -361,16 +361,20 @@ mhl (int argc, char **argv)
                case AMBIGSW: 
                    ambigsw (cp, mhlswitches);
                    mhldone (1);
+                   /* FALLTHRU */
                case UNKWNSW: 
                    mhladios (NULL, "-%s unknown\n", cp);
+                   /* FALLTHRU */
 
                case HELPSW: 
                    snprintf (buf, sizeof(buf), "%s [switches] [files ...]", invo_name);
                    print_help (buf, mhlswitches, 1);
                    mhldone (0);
+                   /* FALLTHRU */
                case VERSIONSW:
                    print_version(invo_name);
                    mhldone (0);
+                   /* FALLTHRU */
 
                case BELLSW: 
                    bellflg = 1;
@@ -449,7 +453,8 @@ mhl (int argc, char **argv)
                    continue;
 
                case FORW2SW: 
-                   forwall++;  /* fall */
+                   forwall++;
+                   /* FALLTHRU */
                case FORW1SW: 
                    forwflg++;
                    clearflg = -1;/* XXX */
@@ -900,7 +905,7 @@ process (char *folder, char *fname, int ofilen, int ofilec)
            cp = folder ? concat (folder, ":", fname2, NULL) : mh_xstrdup(fname2);
            if (ontty != PITTY)
                SIGNAL (SIGINT, intrser);
-           mhlfile (fp, cp, ofilen, ofilec);  /* FALL THROUGH! */
+           mhlfile (fp, cp, ofilen, ofilec);
             free (cp);
 
            for (ap = arglist_head; ap; ap = ap->a_next) {
@@ -909,7 +914,8 @@ process (char *folder, char *fname, int ofilen, int ofilec)
            }
 
            if (arglist_head)
-               fmt_free(NULL, 1);
+               fmt_free(NULL, 1);
+           /* FALLTHRU */
 
        default:
            if (ontty != PITTY)
index 85c3292..5db4efe 100644 (file)
@@ -960,7 +960,7 @@ invalid:
 
        case '(':
            i++;
-           /* and fall... */
+           /* FALLTHRU */
        default:
            *bp++ = c;
            continue;
@@ -1531,7 +1531,7 @@ no_body:
                    case CT_MESSAGE:
                        if (p->c_subtype != MESSAGE_RFC822)
                            break;
-                       /* else fall... */
+                       /* FALLTHRU */
                    default:
                        e->eb_partno = ct->c_partno;
                        if (p->c_ctinitfnx)
@@ -3479,7 +3479,7 @@ bad_quote:
                    case '\\':
                        if (*++cp == '\0')
                            goto bad_quote;
-                       /* FALL THROUGH */
+                       /* FALLTHRU */
                    default:
                        len++;
                        continue;
@@ -3931,7 +3931,7 @@ param_len(PM pm, int index, size_t valueoff, int *encode, int *cont,
            case '\\':
                len++;
                maxfit--;
-           /* FALL THROUGH */
+           /* FALLTHRU */
            default:
                len++;
                maxfit--;
@@ -4039,6 +4039,7 @@ normal_param(PM pm, char *output, size_t len, size_t valuelen,
        case '"':
            *output++ = '\\';
            outlen++;
+           /* FALLTHRU */
        default:
            *output++ = *p++;
            outlen++;
index 7298f5b..6b2efa8 100644 (file)
@@ -844,7 +844,7 @@ parse_display_string (CT ct, char *cp, int *xstdin, int *xlist,
            case 'F':
                /* %f, and stdin is terminal not content */
                *xstdin = 1;
-               /* and fall... */
+               /* FALLTHRU */
 
            case 'f':
                if (multipart) {
@@ -898,7 +898,7 @@ parse_display_string (CT ct, char *cp, int *xstdin, int *xlist,
 
            case 'p':
                /* No longer supported */
-               /* and fall... */
+               /* FALLTHRU */
 
            case 'l':
                /* display listing prior to displaying content */
index 7a1f234..e2fe81c 100644 (file)
--- a/uip/new.c
+++ b/uip/new.c
@@ -178,7 +178,7 @@ get_msgnums(char *folder, char *sequences[])
 
             case BODY:
                 adios (NULL, "no blank lines are permitted in %s", seqfile);
-                /* fall */
+               /* FALLTHRU */
 
             case FILEEOF:
                 break;
index 3d9c5b5..6faa108 100644 (file)
@@ -633,6 +633,7 @@ gcompile (struct nexus *n, char *astr)
            case '\\': 
                if ((c = *sp++) == '\0')
                    goto cerror;
+               /* FALLTHRU */
        defchar: 
            default: 
                *ep++ = CCHR;
index 16eba46..ebb9b18 100644 (file)
@@ -272,7 +272,7 @@ pop_init (char *host, char *port, char *user, char *proxy, int snoop,
            strncpy (buffer, response, sizeof(buffer));
            command ("QUIT");
            strncpy (response, buffer, sizeof(response));
-                               /* and fall */
+           /* FALLTHRU */
 
        case NOTOK: 
        case DONE: 
index 385aae2..9973beb 100644 (file)
@@ -1867,6 +1867,7 @@ do_text (char *file, int fd)
        case RP_NO: 
        case RP_NDEL: 
            die (NULL, "posting failed; %s", rp_string (retval));
+           /* FALLTHRU */
 
        default: 
            die (NULL, "unexpected response; %s", rp_string (retval));
index a8231e9..7a96658 100644 (file)
@@ -129,7 +129,8 @@ main (int argc, char **argv)
        sleep (5);
     switch (child_id) {
        case NOTOK: 
-           admonish (NULL, "unable to fork");/* fall */
+           admonish (NULL, "unable to fork");
+           /* FALLTHRU */
        case OK: 
            execvp (program, vec);
            fprintf (stderr, "unable to exec ");
index 7f0c7ba..15aa0a3 100644 (file)
@@ -225,7 +225,8 @@ main (int argc, char **argv)
                    nwhat = 0;
                    continue;
                case BILDSW: 
-                   buildsw++;  /* fall... */
+                   buildsw++;
+                   /* FALLTHRU */
                case NWHATSW: 
                    nwhat++;
                    continue;
index 30f9421..6a86fe6 100644 (file)
--- a/uip/rmf.c
+++ b/uip/rmf.c
@@ -133,7 +133,8 @@ rmf (char *folder)
     switch (i = chdir (maildir = m_maildir (folder))) {
        case OK: 
            if (access (".", W_OK) != NOTOK && access ("..", W_OK) != NOTOK)
-               break;          /* fall otherwise */
+               break;
+           /* FALLTHRU */
 
        case NOTOK: 
            snprintf (cur, sizeof(cur), "atr-%s-%s",
@@ -162,7 +163,8 @@ rmf (char *folder)
            case '.': 
                if (strcmp (dp->d_name, ".") == 0
                        || strcmp (dp->d_name, "..") == 0)
-                   continue;   /* else fall */
+                   continue;
+               /* FALLTHRU */
 
            case ',': 
                break;
index 191e69e..87bcb59 100644 (file)
@@ -273,7 +273,7 @@ body:;
                    state = BODY;
                    goto body;
                }
-               /* fall through */
+               /* FALLTHRU */
 
            case FILEEOF:
                goto finished;
index 2d162a7..da7532a 100644 (file)
@@ -243,7 +243,8 @@ main (int argc, char **argv)
                    continue;
 
                case DEBUGSW: 
-                   debugsw++;  /* fall */
+                   debugsw++;
+                   /* FALLTHRU */
                case NFILTSW: 
                case FRMTSW: 
                case NFRMTSW: 
@@ -283,7 +284,7 @@ main (int argc, char **argv)
                case SASLMECHSW:
                    if (!(saslmech = *argp) || *saslmech == '-')
                        adios (NULL, "missing argument to %s", argp[-1]);
-                   /* Fall through */
+                   /* FALLTHRU */
 
                case ALIASW: 
                case FILTSW: 
@@ -483,8 +484,10 @@ go_to_it:
         switch (sendsbr (vec, vecp, program, msgs[msgnum], &st, 1, auth_svc)) {
            case DONE: 
                done (++status);
+               /* FALLTHRU */
            case NOTOK: 
-               status++;       /* fall */
+               status++;
+               /* FALLTHRU */
            case OK:
                break;
        }
index 33dd345..6409aec 100644 (file)
@@ -522,6 +522,7 @@ alert (char *file, int out)
        case NOTOK:
            /* oops -- fork error */
            advise ("fork", "unable to");
+           /* FALLTHRU */
 
        case OK:
            /* child process -- send it */
@@ -621,6 +622,7 @@ anno (int fd, struct stat *st)
                            "unable to fork, so doing annotations by hand...");
            if (cwd == NULL)
                cwd = mh_xstrdup(pwd ());
+           /* FALLTHRU */
 
        case OK:
            /* block a few signals */
index 9aa84b3..7fb4cfa 100644 (file)
@@ -96,6 +96,7 @@ main (int argc, char **argv)
                    goto non_mhl_switches;
                case NHEADSW:
                    headersw = 0;
+                   /* FALLTHRU */
                case CONCATSW:
                case NCONCATSW:
 non_mhl_switches:
@@ -413,7 +414,7 @@ invalid:
                            continue;
                        case '(':
                            i++;
-                           /* and fall... */
+                           /* FALLTHRU */
                        default:
                            continue;
                        case ')':
index 0e3baae..f41b6ad 100644 (file)
@@ -484,7 +484,8 @@ usr_delivery (int fd, char *delivery, int su)
                 * do this - else fall through
                 */
                if (!next)
-                   continue;   /* else fall */
+                   continue;
+               /* FALLTHRU */
 
            case '?': 
                /*
@@ -492,7 +493,8 @@ usr_delivery (int fd, char *delivery, int su)
                 * consider delivered if action is successful.
                 */
                if (won)
-                   continue;   /* else fall */
+                   continue;
+               /* FALLTHRU */
 
            case 'A': 
            case 'a': 
@@ -538,7 +540,8 @@ usr_delivery (int fd, char *delivery, int su)
                    if (won)
                        continue;
                    break;
-               }               /* else fall */
+               }
+               /* FALLTHRU */
 
            default: 
                /* parse message and build lookup table */
@@ -565,7 +568,8 @@ usr_delivery (int fd, char *delivery, int su)
            case 'q':
                /* deliver to quoted pipe */
                if (strcasecmp (action, "qpipe"))
-                   continue;   /* else fall */
+                   continue;
+               /* FALLTHRU */
            case '^':
                expand (tmpbuf, string, fd);
                if (split (tmpbuf, vec) < 1)
@@ -576,7 +580,8 @@ usr_delivery (int fd, char *delivery, int su)
            case 'p': 
                /* deliver to pipe */
                if (strcasecmp (action, "pipe"))
-                   continue;   /* else fall */
+                   continue;
+               /* FALLTHRU */
            case '|': 
                vec[2] = "sh";
                vec[3] = "-c";
@@ -594,7 +599,8 @@ usr_delivery (int fd, char *delivery, int su)
                }
                /* deliver to nmh folder */
                else if (strcasecmp (action, "folder"))
-                   continue;   /* else fall */
+                   continue;
+               /* FALLTHRU */
            case '+':
                status = usr_folder (fd, string);
                break;
@@ -607,7 +613,8 @@ usr_delivery (int fd, char *delivery, int su)
                }
                /* mbox format */
                else if (strcasecmp (action, "mbox"))
-                   continue;   /* else fall */
+                   continue;
+               /* FALLTHRU */
 
            case '>': 
                /* mbox format */
index 919dd90..61cf45d 100644 (file)
@@ -834,6 +834,7 @@ sendfile (char **arg, char *file, int pushsw)
     switch (child_id) {
        case NOTOK:
            advise (NULL, "unable to fork, so sending directly...");
+           /* FALLTHRU */
        case OK:
            vec = argsplit(sendproc, &program, &vecp);
            if (pushsw)
@@ -1119,7 +1120,8 @@ sendit (char *sp, char **arg, char *file, int pushed)
                    continue;
 
                case DEBUGSW:
-                   debugsw++;  /* fall */
+                   debugsw++;
+                   /* FALLTHRU */
                case NFILTSW:
                case FRMTSW:
                case NFRMTSW:
@@ -1159,7 +1161,7 @@ sendit (char *sp, char **arg, char *file, int pushed)
 
                case SASLMECHSW:
                     saslmech = *argp;
-                   /* fall thru */
+                   /* FALLTHRU */
                case ALIASW:
                case FILTSW:
                case WIDTHSW:
@@ -1185,6 +1187,7 @@ sendit (char *sp, char **arg, char *file, int pushed)
                        advise (NULL, "missing argument to %s", argp[-2]);
                        return;
                    }
+                   /* FALLTHRU */
                case SNDRFSW:
                    continue;
 
index 411c477..4a3f81d 100644 (file)
@@ -182,7 +182,8 @@ main (int argc, char **argv)
 
     switch (distsw ? child_id : OK) {
        case NOTOK:
-           advise (NULL, "unable to fork, so checking directly...");
+           advise (NULL, "unable to fork, so checking directly...");
+           /* FALLTHRU */
        case OK:
            execvp (postproc, vec);
            fprintf (stderr, "unable to exec ");