From 4966efff7bc9071f04706819e62e1a291d22bcb2 Mon Sep 17 00:00:00 2001 From: charnier Date: Sun, 25 Aug 2002 13:10:45 +0000 Subject: [PATCH] Replace various spelling with FALLTHROUGH which is lint()able --- games/hack/hack.apply.c | 6 ++++-- games/hack/hack.c | 6 ++++-- games/hack/hack.do_name.c | 6 ++++-- games/hack/hack.dog.c | 8 +++++--- games/hack/hack.eat.c | 12 +++++++----- games/hack/hack.mkobj.c | 6 ++++-- games/hack/hack.objnam.c | 10 ++++++---- games/hack/hack.trap.c | 6 ++++-- games/hack/hack.wizard.c | 6 ++++-- games/phantasia/fight.c | 4 ++-- games/phantasia/misc.c | 2 +- lib/libc/net/ns_addr.c | 2 +- lib/libc/net/ns_ntoa.c | 2 +- lib/libc/regex/regcomp.c | 2 +- lib/libc_r/uthread/uthread_kern.c | 2 +- lib/libipx/ipx_addr.c | 2 +- lib/libkse/thread/thr_kern.c | 2 +- lib/libpthread/thread/thr_kern.c | 2 +- lib/libutil/login_cap.c | 2 +- lib/libutil/property.c | 2 +- libexec/bootpd/readfile.c | 5 +++-- libexec/telnetd/state.c | 6 +++--- sbin/dump/traverse.c | 4 ++-- sbin/fsck_ffs/pass2.c | 13 +++++++------ sbin/fsck_ffs/pass5.c | 11 ++++++----- sbin/restore/interactive.c | 2 +- sbin/restore/restore.c | 4 ++-- sbin/routed/output.c | 2 +- sbin/sysctl/sysctl.c | 2 +- 29 files changed, 80 insertions(+), 59 deletions(-) diff --git a/games/hack/hack.apply.c b/games/hack/hack.apply.c index a63bc40bc1a6..0de483d8a8a4 100644 --- a/games/hack/hack.apply.c +++ b/games/hack/hack.apply.c @@ -1,6 +1,8 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.apply.c - version 1.0.3 */ -/* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include "hack.h" #include "def.edog.h" @@ -37,7 +39,7 @@ doapply() { use_magic_whistle(obj); break; } - /* fall into next case */ + /* FALLTHROUGH */ case WHISTLE: use_whistle(obj); break; diff --git a/games/hack/hack.c b/games/hack/hack.c index f1e1c28c59d2..5a272044adae 100644 --- a/games/hack/hack.c +++ b/games/hack/hack.c @@ -1,6 +1,8 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.c - version 1.0.3 */ -/* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include "hack.h" #include @@ -496,7 +498,7 @@ struct monst *mtmp; case '+': if(x != u.ux && y != u.uy) break; if(flags.run != 1) goto stop; - /* fall into next case */ + /* FALLTHROUGH */ case CORR_SYM: corr: if(flags.run == 1 || flags.run == 3) { diff --git a/games/hack/hack.do_name.c b/games/hack/hack.do_name.c index add0b8a56ad3..24dce8a158e6 100644 --- a/games/hack/hack.do_name.c +++ b/games/hack/hack.do_name.c @@ -1,6 +1,8 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.do_name.c - version 1.0.3 */ -/* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include "hack.h" #include @@ -209,7 +211,7 @@ extern char *shkname(); (void) strcpy(buf, shkname(mtmp)); break; } - /* fall into next case */ + /* FALLTHROUGH */ default: (void) sprintf(buf, "the %s%s", mtmp->minvis ? "invisible " : "", diff --git a/games/hack/hack.dog.c b/games/hack/hack.dog.c index 600ff6d010de..6272a18a27f7 100644 --- a/games/hack/hack.dog.c +++ b/games/hack/hack.dog.c @@ -1,6 +1,8 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.dog.c - version 1.0.3 */ -/* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include "hack.h" #include "hack.mfndpos.h" @@ -96,7 +98,7 @@ dogfood(obj) struct obj *obj; { ); default: if(!obj->cursed) return(APPORT); - /* fall into next case */ + /* FALLTHROUGH */ case BALL_SYM: case CHAIN_SYM: case ROCK_SYM: @@ -180,7 +182,7 @@ int info[9]; /* first we look for food */ gtyp = UNDEF; /* no goal as yet */ -#ifdef LINT +#ifdef lint gx = gy = 0; /* suppress 'used before set' message */ #endif /* LINT */ for(obj = fobj; obj; obj = obj->nobj) { diff --git a/games/hack/hack.eat.c b/games/hack/hack.eat.c index c410ea1e51a8..6f4116bc20b7 100644 --- a/games/hack/hack.eat.c +++ b/games/hack/hack.eat.c @@ -1,6 +1,8 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.eat.c - version 1.0.3 */ -/* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include "hack.h" char POISONOUS[] = "ADKSVabhks"; @@ -394,11 +396,11 @@ int tp = 0; case 'n': u.uhp = u.uhpmax; flags.botl = 1; - /* fall into next case */ + /* FALLTHROUGH */ case '@': pline("You cannibal! You will be sorry for this!"); /* not tp++; */ - /* fall into next case */ + /* FALLTHROUGH */ case 'd': Aggravate_monster |= INTRINSIC; break; @@ -411,12 +413,12 @@ int tp = 0; Invis |= INTRINSIC; See_invisible |= INTRINSIC; } - /* fall into next case */ + /* FALLTHROUGH */ case 'y': #ifdef QUEST u.uhorizon++; #endif /* QUEST */ - /* fall into next case */ + /* FALLTHROUGH */ case 'B': Confusion = 50; break; diff --git a/games/hack/hack.mkobj.c b/games/hack/hack.mkobj.c index cc8ce6d48ab0..7ef15409e792 100644 --- a/games/hack/hack.mkobj.c +++ b/games/hack/hack.mkobj.c @@ -1,6 +1,8 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.mkobj.c - version 1.0.3 */ -/* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include "hack.h" @@ -76,7 +78,7 @@ int otyp; if(otmp->otyp == TIN) otmp->spe = rnd(...); #endif /* NOT_YET_IMPLEMENTED */ - /* fall into next case */ + /* FALLTHROUGH */ case GEM_SYM: otmp->quan = rn2(6) ? 1 : 2; case TOOL_SYM: diff --git a/games/hack/hack.objnam.c b/games/hack/hack.objnam.c index eebc05230b22..add63a24417f 100644 --- a/games/hack/hack.objnam.c +++ b/games/hack/hack.objnam.c @@ -1,6 +1,8 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.objnam.c - version 1.0.2 */ -/* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include "hack.h" #define Sprintf (void) sprintf @@ -112,7 +114,7 @@ int pl = (obj->quan != 1); break; } /* fungis ? */ - /* fall into next case */ + /* FALLTHROUGH */ case WEAPON_SYM: if(obj->otyp == WORM_TOOTH && pl) { pl = 0; @@ -124,7 +126,7 @@ int pl = (obj->quan != 1); Strcpy(buf, "crysknives"); break; } - /* fall into next case */ + /* FALLTHROUGH */ case ARMOR_SYM: case CHAIN_SYM: case ROCK_SYM: @@ -258,7 +260,7 @@ char *bp = xname(obj); case ARMOR_SYM: if(obj->owornmask & W_ARMOR) Strcat(bp, " (being worn)"); - /* fall into next case */ + /* FALLTHROUGH */ case WEAPON_SYM: if(obj->known) { Strcat(prefix, sitoa(obj->spe)); diff --git a/games/hack/hack.trap.c b/games/hack/hack.trap.c index 682e961d9353..9d100989b334 100644 --- a/games/hack/hack.trap.c +++ b/games/hack/hack.trap.c @@ -1,6 +1,8 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.trap.c - version 1.0.3 */ -/* $FreeBSD$ */ + +#include +__FBSDID("$FreeBSD$"); #include "hack.h" @@ -256,7 +258,7 @@ float_down(){ break; case TRAPDOOR: if(!xdnstair || u.ustuck) break; - /* fall into next case */ + /* FALLTHROUGH */ default: dotrap(trap); } diff --git a/games/hack/hack.wizard.c b/games/hack/hack.wizard.c index f4a4712925fe..2065475c1922 100644 --- a/games/hack/hack.wizard.c +++ b/games/hack/hack.wizard.c @@ -1,9 +1,11 @@ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* hack.wizard.c - version 1.0.3 */ -/* $FreeBSD$ */ /* wizard code - inspired by rogue code from Merlyn Leroy (digi-g!brian) */ +#include +__FBSDID("$FreeBSD$"); + #include "hack.h" extern struct permonst pm_wizard; extern struct monst *makemon(); @@ -137,7 +139,7 @@ struct monst *mtmp; case 1: pline("\"Destroy the thief, my pets!\""); aggravate(); /* aggravate all the monsters */ - /* fall into next case */ + /* FALLTHROUGH */ case 2: if (flags.no_of_wizards == 1 && rnd(5) == 0) /* if only 1 wizard, clone himself */ diff --git a/games/phantasia/fight.c b/games/phantasia/fight.c index ae778d42e152..030b29bab4fc 100644 --- a/games/phantasia/fight.c +++ b/games/phantasia/fight.c @@ -1549,7 +1549,7 @@ double dtemp; /* for temporary calculations */ } } /* end treasure types 10 - 13 */ - /* fall through to treasure type 9 if no treasure from above */ + /* FALLTHROUGH to treasure type 9 if no treasure from above */ case 9: /* treasure type 9 */ switch (whichtreasure) @@ -1563,7 +1563,7 @@ double dtemp; /* for temporary calculations */ ++Player.p_crowns; break; } - /* fall through otherwise */ + /* FALLTHROUGH */ case 2: addstr("You've been blessed!\n"); diff --git a/games/phantasia/misc.c b/games/phantasia/misc.c index f46e3fdabdd8..c103e08e5c46 100644 --- a/games/phantasia/misc.c +++ b/games/phantasia/misc.c @@ -1114,7 +1114,7 @@ int operation; case A_NEAR: /* pick random coordinates near */ xnew = Player.p_x + ROLL(1.0, 5.0); ynew = Player.p_y - ROLL(1.0, 5.0); - /* fall through for check */ + /* FALLTHROUGH for check */ case A_SPECIFIC: /* just move player */ if (Beyond && fabs(xnew) < D_BEYOND && fabs(ynew) < D_BEYOND) diff --git a/lib/libc/net/ns_addr.c b/lib/libc/net/ns_addr.c index 6ebcbbb35ac7..1c77bcc97bad 100644 --- a/lib/libc/net/ns_addr.c +++ b/lib/libc/net/ns_addr.c @@ -167,7 +167,7 @@ Field(buf, out, len) case 'h': case 'H': base16 = 1; - /* fall into */ + /* FALLTHROUGH */ default: *--bp = 0; /* Ends Loop */ diff --git a/lib/libc/net/ns_ntoa.c b/lib/libc/net/ns_ntoa.c index 0063a8cc4ffe..8caa55433ee6 100644 --- a/lib/libc/net/ns_ntoa.c +++ b/lib/libc/net/ns_ntoa.c @@ -91,7 +91,7 @@ spectHex(p0) case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': *p += ('A' - 'a'); - /* fall into . . . */ + /* FALLTHROUGH */ case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': ok = 1; case '1': case '2': case '3': case '4': case '5': diff --git a/lib/libc/regex/regcomp.c b/lib/libc/regex/regcomp.c index 2dcd497818c6..91de8d760f2a 100644 --- a/lib/libc/regex/regcomp.c +++ b/lib/libc/regex/regcomp.c @@ -1741,7 +1741,7 @@ struct re_guts *g; return; } } while (OP(s) != O_QUEST && OP(s) != O_CH); - /* fallthrough */ + /* FALLTHROUGH */ case OBOW: /* things that break a sequence */ case OEOW: case OBOL: diff --git a/lib/libc_r/uthread/uthread_kern.c b/lib/libc_r/uthread/uthread_kern.c index a4cc3c395b65..2bd855cdbe37 100644 --- a/lib/libc_r/uthread/uthread_kern.c +++ b/lib/libc_r/uthread/uthread_kern.c @@ -394,7 +394,7 @@ _thread_kern_scheduler(void) case PS_SELECT_WAIT: /* Return zero file descriptors ready: */ pthread->data.poll_data->nfds = 0; - /* fall through */ + /* FALLTHROUGH */ default: /* * Remove this thread from the waiting queue diff --git a/lib/libipx/ipx_addr.c b/lib/libipx/ipx_addr.c index 30b3f6a2d6d4..99da44042699 100644 --- a/lib/libipx/ipx_addr.c +++ b/lib/libipx/ipx_addr.c @@ -169,7 +169,7 @@ Field(buf, out, len) case 'h': case 'H': base16 = 1; - /* fall into */ + /* FALLTHROUGH */ default: *--bp = 0; /* Ends Loop */ diff --git a/lib/libkse/thread/thr_kern.c b/lib/libkse/thread/thr_kern.c index a4cc3c395b65..2bd855cdbe37 100644 --- a/lib/libkse/thread/thr_kern.c +++ b/lib/libkse/thread/thr_kern.c @@ -394,7 +394,7 @@ _thread_kern_scheduler(void) case PS_SELECT_WAIT: /* Return zero file descriptors ready: */ pthread->data.poll_data->nfds = 0; - /* fall through */ + /* FALLTHROUGH */ default: /* * Remove this thread from the waiting queue diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c index a4cc3c395b65..2bd855cdbe37 100644 --- a/lib/libpthread/thread/thr_kern.c +++ b/lib/libpthread/thread/thr_kern.c @@ -394,7 +394,7 @@ _thread_kern_scheduler(void) case PS_SELECT_WAIT: /* Return zero file descriptors ready: */ pthread->data.poll_data->nfds = 0; - /* fall through */ + /* FALLTHROUGH */ default: /* * Remove this thread from the waiting queue diff --git a/lib/libutil/login_cap.c b/lib/libutil/login_cap.c index 55784d7a05da..7d501288b24b 100644 --- a/lib/libutil/login_cap.c +++ b/lib/libutil/login_cap.c @@ -245,7 +245,7 @@ login_getclassbyname(char const *name, const struct passwd *pwd) msg = "%s: no default/fallback class '%s'"; if (cgetent(&lc->lc_cap, login_dbarray, (char*)name) != 0 && r >= 0) break; - /* Fallthru - just return system defaults */ + /* FALLTHROUGH - just return system defaults */ case 0: /* success! */ if ((lc->lc_class = strdup(name)) != NULL) { if (dir) { diff --git a/lib/libutil/property.c b/lib/libutil/property.c index 815ce6cd0b9f..57383f91cab2 100644 --- a/lib/libutil/property.c +++ b/lib/libutil/property.c @@ -85,7 +85,7 @@ properties_read(int fd) ch = buf[0]; bp = 1; } - /* Fall through deliberately since we already have a character and state == LOOK */ + /* FALLTHROUGH deliberately since we already have a character and state == LOOK */ case LOOK: if (isspace(ch)) diff --git a/libexec/bootpd/readfile.c b/libexec/bootpd/readfile.c index 7477c3f6ce29..ab583d485db4 100644 --- a/libexec/bootpd/readfile.c +++ b/libexec/bootpd/readfile.c @@ -577,7 +577,8 @@ read_entry(fp, buffer, bufsiz) case '\\': if ((c = fgetc(fp)) < 0) { /* Backslash */ goto done; /* EOF. . . .*/ - } /* else fall through */ + } + /* FALLTHROUGH */ default: *buffer++ = c; /* Other character, store it */ length++; @@ -608,7 +609,7 @@ read_entry(fp, buffer, bufsiz) goto top; /* Backslash-newline continuation */ } } - /* fall through if "other" character */ + /* FALLTHROUGH if "other" character */ default: *buffer++ = c; /* Store other characters */ length++; diff --git a/libexec/telnetd/state.c b/libexec/telnetd/state.c index 229b6d94b5fb..412fd941d259 100644 --- a/libexec/telnetd/state.c +++ b/libexec/telnetd/state.c @@ -103,7 +103,7 @@ telrcv(void) if ((c == 0) || (c == '\n')) { break; } - /* FALL THROUGH */ + /* FALLTHROUGH */ case TS_DATA: if (c == IAC) { @@ -1256,7 +1256,7 @@ suboption(void) case ENV_ESC: if (!SB_EOF()) c = SB_GET(); - /* FALL THROUGH */ + /* FALLTHROUGH */ default: empty = 0; continue; @@ -1343,7 +1343,7 @@ suboption(void) if (SB_EOF()) break; c = SB_GET(); - /* FALL THROUGH */ + /* FALLTHROUGH */ default: *cp++ = c; break; diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c index 5be1dca71531..9baec8807972 100644 --- a/sbin/dump/traverse.c +++ b/sbin/dump/traverse.c @@ -458,13 +458,13 @@ dumpino(union dinode *dp, ino_t ino) return; } #endif - /* fall through */ + /* FALLTHROUGH */ case S_IFDIR: case S_IFREG: if (DIP(dp, di_size) > 0) break; - /* fall through */ + /* FALLTHROUGH */ case S_IFIFO: case S_IFSOCK: diff --git a/sbin/fsck_ffs/pass2.c b/sbin/fsck_ffs/pass2.c index 597181dfcd76..388dc8ede810 100644 --- a/sbin/fsck_ffs/pass2.c +++ b/sbin/fsck_ffs/pass2.c @@ -31,13 +31,14 @@ * SUCH DAMAGE. */ -#ifndef lint #if 0 +#ifndef lint static const char sccsid[] = "@(#)pass2.c 8.9 (Berkeley) 4/28/95"; -#endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ +#endif + +#include +__FBSDID("$FreeBSD$"); #include @@ -406,7 +407,7 @@ pass2check(struct inodesc *idesc) case DSTATE: if (inoinfo(idesc->id_number)->ino_state == DFOUND) inoinfo(dirp->d_ino)->ino_state = DFOUND; - /* fall through */ + /* FALLTHROUGH */ case DFOUND: inp = getinoinfo(dirp->d_ino); @@ -431,7 +432,7 @@ pass2check(struct inodesc *idesc) } if (idesc->id_entryno > 2) inp->i_parent = idesc->id_number; - /* fall through */ + /* FALLTHROUGH */ case FSTATE: if (dirp->d_type != inoinfo(dirp->d_ino)->ino_type) { diff --git a/sbin/fsck_ffs/pass5.c b/sbin/fsck_ffs/pass5.c index 1d81d05db67a..6685e395e926 100644 --- a/sbin/fsck_ffs/pass5.c +++ b/sbin/fsck_ffs/pass5.c @@ -31,13 +31,14 @@ * SUCH DAMAGE. */ -#ifndef lint #if 0 +#ifndef lint static const char sccsid[] = "@(#)pass5.c 8.9 (Berkeley) 4/28/95"; -#endif -static const char rcsid[] = - "$FreeBSD$"; #endif /* not lint */ +#endif + +#include +__FBSDID("$FreeBSD$"); #include #include @@ -215,7 +216,7 @@ pass5(void) case DCLEAR: case DFOUND: newcg->cg_cs.cs_ndir++; - /* fall through */ + /* FALLTHROUGH */ case FSTATE: case FCLEAR: diff --git a/sbin/restore/interactive.c b/sbin/restore/interactive.c index 54f16e35f387..5bfe82132f94 100644 --- a/sbin/restore/interactive.c +++ b/sbin/restore/interactive.c @@ -594,7 +594,7 @@ mkentry(char *name, struct direct *dp, struct afile *fp) default: fprintf(stderr, "Warning: undefined file type %d\n", dp->d_type); - /* fall through */ + /* FALLTHROUGH */ case DT_REG: fp->postfix = ' '; break; diff --git a/sbin/restore/restore.c b/sbin/restore/restore.c index 96f6c2d36f7c..8b463a70b9e0 100644 --- a/sbin/restore/restore.c +++ b/sbin/restore/restore.c @@ -321,7 +321,7 @@ nodeupdates(char *name, ino_t ino, int type) } else { mktempname(np); } - /* fall through */ + /* FALLTHROUGH */ /* * A previously non-existent file. @@ -352,7 +352,7 @@ nodeupdates(char *name, ino_t ino, int type) case ONTAPE|INOFND: if (type == LEAF && (ip->e_flags & KEEP) == 0) ip->e_flags |= EXTRACT; - /* fall through */ + /* FALLTHROUGH */ case INOFND: if ((ip->e_flags & KEEP) == 0) { renameit(myname(ip), name); diff --git a/sbin/routed/output.c b/sbin/routed/output.c index 0077ba01c28a..cc110efc5c0e 100644 --- a/sbin/routed/output.c +++ b/sbin/routed/output.c @@ -727,7 +727,7 @@ supply(struct sockaddr_in *dst, case OUT_QUERY: ws.state |= WS_ST_QUERY; - /* fall through */ + /* FALLTHROUGH */ case OUT_BROADCAST: case OUT_UNICAST: v2buf.type = (vers == RIPv2) ? type : NO_OUT_RIPV2; diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index f499f63a4fee..bb5c4c17b62d 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -596,7 +596,7 @@ show_var(int *oid, int nlen) printf("%s%s", name, sep); return ((*func)(len, p)); } - /* FALL THROUGH */ + /* FALLTHROUGH */ default: if (!oflag && !xflag) return (1);