From 04f4d7044367099914cf1906ae27ac20c24e44cf Mon Sep 17 00:00:00 2001 From: jsm Date: Wed, 8 Sep 1999 21:17:44 +0000 Subject: Add use of `const' where appropriate to the games. This merges in all such remaining changes from the Linux port of the NetBSD games, except in hunt (where substantial changes from OpenBSD need to be looked at). Some such changes were previously covered in PRs bin/6041, bin/6146, bin/6148, bin/6150, bin/6151, bin/6580, bin/6660, bin/7993, bin/7994, bin/8039, bin/8057 and bin/8093. --- phantasia/misc.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'phantasia/misc.c') diff --git a/phantasia/misc.c b/phantasia/misc.c index 4b5dc0f4..89cd940b 100644 --- a/phantasia/misc.c +++ b/phantasia/misc.c @@ -1,4 +1,4 @@ -/* $NetBSD: misc.c,v 1.4 1998/08/30 09:19:39 veego Exp $ */ +/* $NetBSD: misc.c,v 1.5 1999/09/08 21:17:54 jsm Exp $ */ /* * misc.c Phantasia miscellaneous support routines @@ -10,7 +10,7 @@ void movelevel() { - struct charstats *statptr; /* for pointing into Stattable */ + const struct charstats *statptr; /* for pointing into Stattable */ double new; /* new level */ double inc; /* increment between new and old levels */ @@ -60,15 +60,15 @@ movelevel() death("Old age"); } -char * +const char * descrlocation(playerp, shortflag) struct player *playerp; bool shortflag; { double circle; /* corresponding circle for coordinates */ int quadrant; /* quandrant of grid */ - char *label; /* pointer to place name */ - static char *nametable[4][4] = /* names of places */ + const char *label; /* pointer to place name */ + static const char *const nametable[4][4] = /* names of places */ { {"Anorien", "Ithilien", "Rohan", "Lorien"}, {"Gondor", "Mordor", "Dunland", "Rovanion"}, @@ -412,7 +412,7 @@ displaystats() void allstatslist() { - static char *flags[] = /* to print value of some bools */ + static const char *const flags[] = /* to print value of some bools */ { "False", " True" @@ -442,13 +442,13 @@ allstatslist() flags[(int)Player.p_palantir]); } -char * +const char * descrtype(playerp, shortflag) struct player *playerp; bool shortflag; { int type; /* for caluculating result subscript */ - static char *results[] =/* description table */ + static const char *const results[] =/* description table */ { " Magic User", " MU", " Fighter", " F ", @@ -508,7 +508,7 @@ descrtype(playerp, shortflag) long findname(name, playerp) - char *name; + const char *name; struct player *playerp; { long loc = 0; /* location in the file */ @@ -576,11 +576,11 @@ leavegame() void death(how) - char *how; + const char *how; { FILE *fp; /* for updating various files */ int ch; /* input */ - static char *deathmesg[] = + static const char *const deathmesg[] = /* add more messages here, if desired */ { "You have been wounded beyond repair. ", @@ -935,7 +935,7 @@ readmessage() void error(whichfile) - char *whichfile; + const char *whichfile; { int (*funcp) __P((const char *,...)); @@ -973,7 +973,7 @@ ill_sig(whichsig) /* NOTREACHED */ } -char * +const char * descrstatus(playerp) struct player *playerp; { -- cgit v1.2.3