Instead of a case statement falling through, with a "FALLTHRU" comment,
to the follow case that just does a break, continue, goto, etc.,
control-flow statement, duplicate the statement in place of the comment.
Fall-through should be the exception, and saving a break statement
doesn't offset the cognitive cost when reading the source.
12 files changed:
strcpy (err, "extraneous semi-colon");
return NOTOK;
}
- /* FALLTHRU */
+ return OK;
case LX_COMA:
case LX_END:
return OK;
case BODY:
lkfclosedata (fp, seqfile);
adios (NULL, "no blank lines are permitted in %s", seqfile);
- /* FALLTHRU */
+ break;
case FILEEOF:
break;
fclose (fp);
return i;
}
- /* FALLTHRU */
+ continue;
case ':': /* comment */
case ';':
case '#':
fmt_addcomptext("body", rbuf);
}
- /* FALLTHRU */
+ goto finished;
default:
goto finished;
trnflag = 0;
noisy++;
/* advise (cp, "unable to read"); already advised */
- /* FALLTHRU */
+ break;
case SCNERR:
case SCNNUM:
trnflag = 0;
noisy++;
/* advise (cp, "unable to read"); already advised */
- /* FALLTHRU */
+ break;
case SCNERR:
case SCNNUM:
case BODY:
fseek (in, (long) (-strlen (buf)), SEEK_CUR);
- /* FALLTHRU */
+ break;
case FILEEOF:
break;
case BODY:
adios (NULL, "no blank lines are permitted in %s", seqfile);
- /* FALLTHRU */
+ break;
case FILEEOF:
break;
case RP_NO:
case RP_NDEL:
die (NULL, "posting failed; %s", rp_string (retval));
- /* FALLTHRU */
+ break;
default:
die (NULL, "unexpected response; %s", rp_string (retval));
if (strcmp (dp->d_name, ".") == 0
|| strcmp (dp->d_name, "..") == 0)
continue;
- /* FALLTHRU */
+ break;
case ',':
break;
state = BODY;
goto body;
}
- /* FALLTHRU */
+ goto finished;
case FILEEOF:
goto finished;
continue;
case '(':
i++;
- /* FALLTHRU */
+ continue;
default:
continue;
case ')':
inform("missing argument to %s", argp[-2]);
return;
}
- /* FALLTHRU */
+ continue;
case SNDRFSW:
continue;
}