From dc6514954049bf3d7c993996025a81414423c89b Mon Sep 17 00:00:00 2001 From: mrg Date: Sun, 3 Feb 2019 03:19:25 +0000 Subject: - 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 --- phantasia/main.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'phantasia/main.c') 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 */ -- cgit v1.2.3