summaryrefslogtreecommitdiffstats
path: root/phantasia
diff options
context:
space:
mode:
authormrg <mrg@NetBSD.org>2019-02-03 03:19:25 +0000
committermrg <mrg@NetBSD.org>2019-02-03 03:19:25 +0000
commitdc6514954049bf3d7c993996025a81414423c89b (patch)
tree62f1a633c2e85d4bfcee4a574b5fa5c66ba88816 /phantasia
parent2d315c293c005d7227edf8d5800e4f9dc2795baa (diff)
downloadbsdgames-darwin-dc6514954049bf3d7c993996025a81414423c89b.tar.gz
bsdgames-darwin-dc6514954049bf3d7c993996025a81414423c89b.tar.zst
bsdgames-darwin-dc6514954049bf3d7c993996025a81414423c89b.zip
- 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 (limited to 'phantasia')
-rw-r--r--phantasia/fight.c5
-rw-r--r--phantasia/main.c15
-rw-r--r--phantasia/misc.c3
3 files changed, 17 insertions, 6 deletions
diff --git a/phantasia/fight.c b/phantasia/fight.c
index 1f01b9de..0a1ab064 100644
--- a/phantasia/fight.c
+++ b/phantasia/fight.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fight.c,v 1.13 2009/08/31 08:27:16 dholland Exp $ */
+/* $NetBSD: fight.c,v 1.14 2019/02/03 03:19:25 mrg Exp $ */
/*
* fight.c Phantasia monster fighting routines
@@ -1316,6 +1316,7 @@ awardtreasure(void)
/* fall through to treasure type 9 if
* no treasure from above */
+ /* FALLTHROUGH */
case 9: /* treasure type 9 */
switch (whichtreasure) {
case 1:
@@ -1326,8 +1327,8 @@ awardtreasure(void)
++Player.p_crowns;
break;
}
- /* fall through otherwise */
+ /* FALLTHROUGH */
case 2:
addstr("You've been blessed!\n");
Player.p_blessing = TRUE;
diff --git a/phantasia/main.c b/phantasia/main.c
index bd17453e..c8850da8 100644
--- a/phantasia/main.c
+++ b/phantasia/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.23 2009/08/31 08:27:16 dholland Exp $ */
+/* $NetBSD: main.c,v 1.24 2019/02/03 03:19:25 mrg Exp $ */
/*
* Phantasia 3.3.2 -- Interterminal fantasy game
@@ -108,11 +108,13 @@ main(int argc, char **argv)
case 'a': /* all users */
activelist();
cleanup(TRUE);
+ __unreachable();
/* NOTREACHED */
case 'p': /* purge old players */
purgeoldplayers();
cleanup(TRUE);
+ __unreachable();
/* NOTREACHED */
case 'S': /* set 'Wizard' */
@@ -126,11 +128,13 @@ main(int argc, char **argv)
case 'm': /* monsters */
monstlist();
cleanup(TRUE);
+ __unreachable();
/* NOTREACHED */
case 'b': /* scoreboard */
scorelist();
cleanup(TRUE);
+ __unreachable();
/* NOTREACHED */
}
@@ -143,15 +147,18 @@ main(int argc, char **argv)
if (examine) {
changestats(FALSE);
cleanup(TRUE);
+ __unreachable();
/* NOTREACHED */
}
if (!noheader) {
titlelist();
purgeoldplayers(); /* clean up old characters */
}
- if (headeronly)
+ if (headeronly) {
cleanup(TRUE);
- /* NOTREACHED */
+ __unreachable();
+ /* NOTREACHED */
+ }
do
/* get the player structure filled */
@@ -167,6 +174,7 @@ main(int argc, char **argv)
case 'Q':
cleanup(TRUE);
+ __unreachable();
/* NOTREACHED */
default:
@@ -544,6 +552,7 @@ procmain(void)
case '5': /* good-bye */
leavegame();
+ __unreachable();
/* NOTREACHED */
case '6': /* cloak */
diff --git a/phantasia/misc.c b/phantasia/misc.c
index 59785376..180d6137 100644
--- a/phantasia/misc.c
+++ b/phantasia/misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.21 2011/09/01 07:18:50 plunky Exp $ */
+/* $NetBSD: misc.c,v 1.22 2019/02/03 03:19:25 mrg Exp $ */
/*
* misc.c Phantasia miscellaneous support routines
@@ -729,6 +729,7 @@ altercoordinates(double xnew, double ynew, int operation)
ynew = Player.p_y - ROLL(1.0, 5.0);
/* fall through for check */
+ /* FALLTHROUGH */
case A_SPECIFIC: /* just move player */
if (Beyond && fabs(xnew) < D_BEYOND && fabs(ynew) < D_BEYOND)
/*