Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src - add or adjust /* FALLTHROUGH */ where appropriate
details: https://anonhg.NetBSD.org/src/rev/2bd5d335c649
branches: trunk
changeset: 448433:2bd5d335c649
user: mrg <mrg%NetBSD.org@localhost>
date: Sun Feb 03 03:19:25 2019 +0000
description:
- add or adjust /* FALLTHROUGH */ where appropriate
- add __unreachable() after functions that can return but won't in
this case, and thus can't be marked __dead easily
diffstat:
games/backgammon/teachgammon/teach.c | 12 ++++++-
games/battlestar/command2.c | 5 +-
games/battlestar/command3.c | 6 ++-
games/larn/main.c | 6 ++-
games/larn/monster.c | 12 ++++++-
games/larn/movem.c | 6 ++-
games/larn/object.c | 8 +++-
games/mille/move.c | 7 +++-
games/phantasia/fight.c | 5 +-
games/phantasia/main.c | 15 +++++++-
games/phantasia/misc.c | 3 +-
games/quiz/quiz.c | 5 +-
games/rogue/play.c | 5 +-
games/rogue/room.c | 5 +-
games/sail/pl_5.c | 5 +-
libexec/telnetd/state.c | 5 +-
sbin/fsck_ext2fs/main.c | 5 +-
sbin/fsck_ffs/quota2.c | 3 +-
sbin/fsck_lfs/main.c | 3 +-
sbin/restore/interactive.c | 5 +-
sys/arch/amd64/amd64/db_disasm.c | 5 +-
sys/arch/amd64/amd64/trap.c | 5 +-
sys/arch/i386/i386/process_machdep.c | 5 +-
sys/arch/i386/i386/trap.c | 5 +-
sys/compat/linux/common/linux_hdio.c | 5 +-
sys/compat/ossaudio/ossaudio.c | 10 +++---
sys/ddb/db_examine.c | 5 +-
sys/ddb/db_write_cmd.c | 5 +-
sys/dev/acpi/acpi_cpu_cstate.c | 7 ++-
sys/dev/bluetooth/btsco.c | 6 +-
sys/dev/ic/adwlib.c | 7 +++-
sys/dev/ic/elink3.c | 5 +-
sys/dev/ic/isp_netbsd.c | 5 +-
sys/dev/ic/ncr53c9x.c | 7 +++-
sys/dev/ic/pdq_ifsubr.c | 58 ++++++++++++++---------------------
sys/dev/ic/rtw.c | 5 +-
sys/dev/isa/fd.c | 5 +-
sys/dev/isa/gus.c | 5 +-
sys/dev/isa/if_ate.c | 5 +-
sys/dev/isa/sbdsp.c | 18 +++++++---
sys/dev/pci/bktr/bktr_core.c | 5 +-
sys/dev/pci/if_bce.c | 5 +-
sys/dev/pci/if_bge.c | 8 +++-
sys/dev/pci/if_dge.c | 7 +++-
sys/dev/pci/if_ipw.c | 6 +-
sys/dev/pci/if_iwi.c | 8 ++--
sys/dev/pci/if_msk.c | 7 +++-
sys/dev/pci/if_sk.c | 8 +++-
sys/dev/pci/mpii.c | 5 +-
sys/dev/pci/pdcsata.c | 5 +-
sys/dev/pcmcia/if_ray.c | 6 ++-
sys/dev/pcmcia/pcmcia_cis.c | 5 +-
sys/dev/scsipi/atapi_base.c | 5 +-
sys/dev/scsipi/st.c | 6 ++-
sys/dev/usb/umass.c | 16 ++++++---
sys/dev/usb/usb.c | 7 ++-
sys/dev/wscons/wsdisplay.c | 6 +-
sys/kern/kern_rndpool.c | 7 +++-
sys/kern/kern_synch.c | 5 +-
sys/kern/sys_descrip.c | 5 +-
sys/kern/sys_ptrace_common.c | 6 ++-
sys/net/if_fddisubr.c | 5 +-
sys/net/if_strip.c | 8 ++--
sys/netbt/hci_ioctl.c | 8 +++-
sys/nfs/nfs_serv.c | 5 +-
sys/nfs/nfs_syscalls.c | 5 +-
tests/include/t_paths.c | 5 +-
tests/lib/libc/sys/t_ptrace_wait.c | 6 ++-
tests/lib/libc/sys/t_sendrecv.c | 5 +-
usr.bin/colcrt/colcrt.c | 5 +-
usr.bin/ctags/ctags.c | 5 +-
usr.bin/ctags/fortran.c | 5 +-
usr.bin/deroff/deroff.c | 5 +-
usr.bin/fstat/fstat.c | 6 ++-
usr.bin/ftp/domacro.c | 6 +-
usr.bin/indent/indent.c | 7 +++-
usr.bin/indent/io.c | 5 +-
usr.bin/indent/lexi.c | 6 ++-
usr.bin/indent/parse.c | 6 ++-
usr.bin/jot/jot.c | 8 +++-
usr.bin/make/var.c | 8 +++-
usr.bin/rdist/gram.y | 6 ++-
usr.bin/rdist/server.c | 7 ++-
usr.bin/rs/rs.c | 12 ++++++-
usr.bin/sockstat/sockstat.c | 5 +-
usr.bin/ul/ul.c | 5 +-
usr.bin/vgrind/vfontedpr.c | 5 +-
usr.sbin/acpitools/aml/aml_store.c | 5 +-
usr.sbin/bootp/common/readfile.c | 3 +-
usr.sbin/btdevctl/db.c | 6 ++-
usr.sbin/lpr/filters/lpf.c | 6 ++-
usr.sbin/lpr/lpd/printjob.c | 6 ++-
usr.sbin/lpr/lprm/lprm.c | 5 +-
usr.sbin/makefs/udf.c | 7 ++-
usr.sbin/map-mbone/mapper.c | 5 ++-
usr.sbin/mrouted/main.c | 6 ++-
usr.sbin/mtrace/mtrace.c | 7 +++-
usr.sbin/npf/npfctl/npfctl.c | 3 +-
usr.sbin/rtadvd/advcap.c | 3 +-
usr.sbin/sup/source/supfilesrv.c | 3 +-
usr.sbin/syslogd/syslogd.c | 5 +-
usr.sbin/wsmuxctl/wsmuxctl.c | 3 +-
102 files changed, 420 insertions(+), 254 deletions(-)
diffs (truncated from 3237 to 300 lines):
diff -r 137c50b08af8 -r 2bd5d335c649 games/backgammon/teachgammon/teach.c
--- a/games/backgammon/teachgammon/teach.c Sat Feb 02 22:39:32 2019 +0000
+++ b/games/backgammon/teachgammon/teach.c Sun Feb 03 03:19:25 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: teach.c,v 1.24 2013/09/13 20:46:50 joerg Exp $ */
+/* $NetBSD: teach.c,v 1.25 2019/02/03 03:19:25 mrg Exp $ */
/*
* Copyright (c) 1980, 1993
@@ -39,7 +39,7 @@
#if 0
static char sccsid[] = "@(#)teach.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: teach.c,v 1.24 2013/09/13 20:46:50 joerg Exp $");
+__RCSID("$NetBSD: teach.c,v 1.25 2019/02/03 03:19:25 mrg Exp $");
#endif
#endif /* not lint */
@@ -98,34 +98,42 @@
if ((i = wrtext(intro2)) != 0)
break;
+ /* FALLTHROUGH */
case 3:
if ((i = wrtext(moves)) != 0)
break;
+ /* FALLTHROUGH */
case 4:
if ((i = wrtext(removepiece)) != 0)
break;
+ /* FALLTHROUGH */
case 5:
if ((i = wrtext(hits)) != 0)
break;
+ /* FALLTHROUGH */
case 6:
if ((i = wrtext(endgame)) != 0)
break;
+ /* FALLTHROUGH */
case 7:
if ((i = wrtext(doubl)) != 0)
break;
+ /* FALLTHROUGH */
case 8:
if ((i = wrtext(stragy)) != 0)
break;
+ /* FALLTHROUGH */
case 9:
if ((i = wrtext(prog)) != 0)
break;
+ /* FALLTHROUGH */
case 10:
if ((i = wrtext(lastch)) != 0)
break;
diff -r 137c50b08af8 -r 2bd5d335c649 games/battlestar/command2.c
--- a/games/battlestar/command2.c Sat Feb 02 22:39:32 2019 +0000
+++ b/games/battlestar/command2.c Sun Feb 03 03:19:25 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: command2.c,v 1.3 2005/07/01 06:04:54 jmc Exp $ */
+/* $NetBSD: command2.c,v 1.4 2019/02/03 03:19:25 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)com2.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: command2.c,v 1.3 2005/07/01 06:04:54 jmc Exp $");
+__RCSID("$NetBSD: command2.c,v 1.4 2019/02/03 03:19:25 mrg Exp $");
#endif
#endif /* not lint */
@@ -271,6 +271,7 @@
puts("Your fantasy is over.");
die();
}
+ /* FALLTHROUGH */
case -1:
puts("Kill what?");
break;
diff -r 137c50b08af8 -r 2bd5d335c649 games/battlestar/command3.c
--- a/games/battlestar/command3.c Sat Feb 02 22:39:32 2019 +0000
+++ b/games/battlestar/command3.c Sun Feb 03 03:19:25 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: command3.c,v 1.4 2018/02/04 08:48:05 mrg Exp $ */
+/* $NetBSD: command3.c,v 1.5 2019/02/03 03:19:25 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)com3.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: command3.c,v 1.4 2018/02/04 08:48:05 mrg Exp $");
+__RCSID("$NetBSD: command3.c,v 1.5 2019/02/03 03:19:25 mrg Exp $");
#endif
#endif /* not lint */
@@ -145,9 +145,11 @@
case NORMGOD:
printf("She screams as you wrestle her into ");
puts("the hole.");
+ /* FALLTHROUGH */
case TIMER:
power += 7;
ego -= 10;
+ /* FALLTHROUGH */
case AMULET:
case MEDALION:
case TALISMAN:
diff -r 137c50b08af8 -r 2bd5d335c649 games/larn/main.c
--- a/games/larn/main.c Sat Feb 02 22:39:32 2019 +0000
+++ b/games/larn/main.c Sun Feb 03 03:19:25 2019 +0000
@@ -1,9 +1,9 @@
-/* $NetBSD: main.c,v 1.25 2012/06/19 05:30:43 dholland Exp $ */
+/* $NetBSD: main.c,v 1.26 2019/02/03 03:19:25 mrg Exp $ */
/* main.c */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: main.c,v 1.25 2012/06/19 05:30:43 dholland Exp $");
+__RCSID("$NetBSD: main.c,v 1.26 2019/02/03 03:19:25 mrg Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -793,6 +793,7 @@
savegame(savefilename);
wizard = 1;
died(-257); /* save the game - doesn't return */
+ __unreachable();
case 'Z':
yrepcount = 0;
@@ -918,6 +919,7 @@
case 'g':
cursors();
lprintf("\nThe stuff you are carrying presently weighs %ld pounds", (long) packweight());
+ /* FALLTHROUGH */
case ' ':
yrepcount = 0;
nomove = 1;
diff -r 137c50b08af8 -r 2bd5d335c649 games/larn/monster.c
--- a/games/larn/monster.c Sat Feb 02 22:39:32 2019 +0000
+++ b/games/larn/monster.c Sun Feb 03 03:19:25 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: monster.c,v 1.18 2012/06/19 05:30:43 dholland Exp $ */
+/* $NetBSD: monster.c,v 1.19 2019/02/03 03:19:25 mrg Exp $ */
/*
* monster.c Larn is copyrighted 1986 by Noah Morgan.
@@ -100,7 +100,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: monster.c,v 1.18 2012/06/19 05:30:43 dholland Exp $");
+__RCSID("$NetBSD: monster.c,v 1.19 2019/02/03 03:19:25 mrg Exp $");
#endif /* not lint */
#include <string.h>
@@ -1011,20 +1011,28 @@
switch (ttgetch()) {
case 'b':
i++;
+ /* FALLTHROUGH */
case 'n':
i++;
+ /* FALLTHROUGH */
case 'y':
i++;
+ /* FALLTHROUGH */
case 'u':
i++;
+ /* FALLTHROUGH */
case 'h':
i++;
+ /* FALLTHROUGH */
case 'k':
i++;
+ /* FALLTHROUGH */
case 'l':
i++;
+ /* FALLTHROUGH */
case 'j':
i++;
+ /* FALLTHROUGH */
goto out;
};
out:
diff -r 137c50b08af8 -r 2bd5d335c649 games/larn/movem.c
--- a/games/larn/movem.c Sat Feb 02 22:39:32 2019 +0000
+++ b/games/larn/movem.c Sun Feb 03 03:19:25 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: movem.c,v 1.9 2012/06/19 05:30:43 dholland Exp $ */
+/* $NetBSD: movem.c,v 1.10 2019/02/03 03:19:25 mrg Exp $ */
/*
* movem.c (move monster) Larn is copyrighted 1986 by Noah Morgan.
@@ -12,7 +12,7 @@
*/
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: movem.c,v 1.9 2012/06/19 05:30:43 dholland Exp $");
+__RCSID("$NetBSD: movem.c,v 1.10 2019/02/03 03:19:25 mrg Exp $");
#endif /* not lint */
#include "header.h"
@@ -185,6 +185,7 @@
case OMIRROR:
if (mitem[m][k] == VAMPIRE)
goto smm;
+ /* FALLTHROUGH */
default:
screen[m][k] = 0;
break;
@@ -437,6 +438,7 @@
case 1:
case 2: /* change direction to a random one */
sp->dir = rnd(8);
+ /* FALLTHROUGH */
default: /* move in normal direction */
dir = sp->dir;
len = sp->lifetime;
diff -r 137c50b08af8 -r 2bd5d335c649 games/larn/object.c
--- a/games/larn/object.c Sat Feb 02 22:39:32 2019 +0000
+++ b/games/larn/object.c Sun Feb 03 03:19:25 2019 +0000
@@ -1,10 +1,10 @@
-/* $NetBSD: object.c,v 1.16 2012/06/19 05:30:43 dholland Exp $ */
+/* $NetBSD: object.c,v 1.17 2019/02/03 03:19:25 mrg Exp $ */
/* object.c Larn is copyrighted 1986 by Noah Morgan. */
#include <sys/cdefs.h>
#ifndef lint
-__RCSID("$NetBSD: object.c,v 1.16 2012/06/19 05:30:43 dholland Exp $");
+__RCSID("$NetBSD: object.c,v 1.17 2019/02/03 03:19:25 mrg Exp $");
#endif /* not lint */
#include "header.h"
#include "extern.h"
@@ -148,6 +148,7 @@
item[playerx][playery] = OTELEPORTER;
know[playerx][playery] = 1;
+ /* FALLTHROUGH */
case OTELEPORTER:
lprcat("\nZaaaappp! You've been teleported!\n");
beep();
@@ -404,6 +405,7 @@
item[playerx][playery] = OTRAPARROW;
know[playerx][playery] = 0;
+ /* FALLTHROUGH */
case OTRAPARROW:
lprcat("\nYou are hit by an arrow");
beep(); /* for an arrow trap */
@@ -418,6 +420,7 @@
item[playerx][playery] = ODARTRAP;
know[playerx][playery] = 0;
+ /* FALLTHROUGH */
case ODARTRAP:
lprcat("\nYou are hit by a dart");
beep(); /* for a dart trap */
@@ -434,6 +437,7 @@
item[playerx][playery] = OTRAPDOOR;
know[playerx][playery] = 1;
+ /* FALLTHROUGH */
case OTRAPDOOR:
lastnum = 272; /* a trap door */
if ((level == MAXLEVEL - 1) || (level == MAXLEVEL + MAXVLEVEL - 1)) {
diff -r 137c50b08af8 -r 2bd5d335c649 games/mille/move.c
--- a/games/mille/move.c Sat Feb 02 22:39:32 2019 +0000
+++ b/games/mille/move.c Sun Feb 03 03:19:25 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: move.c,v 1.18 2011/08/31 16:24:56 plunky Exp $ */
+/* $NetBSD: move.c,v 1.19 2019/02/03 03:19:25 mrg Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: move.c,v 1.18 2011/08/31 16:24:56 plunky Exp $");
+__RCSID("$NetBSD: move.c,v 1.19 2019/02/03 03:19:25 mrg Exp $");
#endif
#endif /* not lint */
@@ -232,12 +232,15 @@
case C_200:
if (pp->nummiles[C_200] == 2)
return error("only two 200's per hand");
+ /* FALLTHROUGH */
Home |
Main Index |
Thread Index |
Old Index