summaryrefslogtreecommitdiffstats
path: root/phantasia
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-08-12 08:21:41 +0000
committerdholland <dholland@NetBSD.org>2009-08-12 08:21:41 +0000
commit4fa17c6f9afc7c76d0350d5d9e5996391aa18137 (patch)
treedf25abab941a9c4156963af474b6ba2a96023025 /phantasia
parent8916e2056e90ba2c157dfd2b98fb48837d565646 (diff)
downloadbsdgames-darwin-4fa17c6f9afc7c76d0350d5d9e5996391aa18137.tar.gz
bsdgames-darwin-4fa17c6f9afc7c76d0350d5d9e5996391aa18137.tar.zst
bsdgames-darwin-4fa17c6f9afc7c76d0350d5d9e5996391aa18137.zip
sprinkle static
Diffstat (limited to 'phantasia')
-rw-r--r--phantasia/fight.c33
-rw-r--r--phantasia/interplayer.c15
-rw-r--r--phantasia/io.c6
-rw-r--r--phantasia/main.c27
-rw-r--r--phantasia/misc.c8
-rw-r--r--phantasia/phantglobs.h27
6 files changed, 60 insertions, 56 deletions
diff --git a/phantasia/fight.c b/phantasia/fight.c
index d001dabe..ee4e15b1 100644
--- a/phantasia/fight.c
+++ b/phantasia/fight.c
@@ -1,4 +1,4 @@
-/* $NetBSD: fight.c,v 1.11 2009/05/25 23:08:45 dholland Exp $ */
+/* $NetBSD: fight.c,v 1.12 2009/08/12 08:21:41 dholland Exp $ */
/*
* fight.c Phantasia monster fighting routines
@@ -8,6 +8,17 @@
#undef bool
#include <curses.h>
+static void awardtreasure(void);
+static void callmonster(int);
+static void cancelmonster(void);
+static void cursedtreasure(void);
+static void hitmonster(double);
+static void monsthits(void);
+static int pickmonster(void);
+static void playerhits(void);
+static void scramblestats(void);
+static void throwspell(void);
+
void
encounter(int particular)
{
@@ -152,7 +163,7 @@ encounter(int particular)
clrtobot();
}
-int
+static int
pickmonster(void)
{
if (Player.p_specialtype == SC_VALAR)
@@ -192,7 +203,7 @@ pickmonster(void)
return ((int) ROLL(14.0, 25.0));
}
-void
+static void
playerhits(void)
{
double inflict; /* damage inflicted */
@@ -335,7 +346,7 @@ playerhits(void)
}
-void
+static void
monsthits(void)
{
double inflict; /* damage inflicted */
@@ -585,7 +596,7 @@ SPECIALHIT:
}
}
-void
+static void
cancelmonster(void)
{
Curmonster.m_energy = 0.0;
@@ -594,7 +605,7 @@ cancelmonster(void)
Curmonster.m_flock = 0.0;
}
-void
+static void
hitmonster(double inflict)
{
mvprintw(Lines++, 0, "You hit %s %.0f times!", Enemyname, inflict);
@@ -621,7 +632,7 @@ hitmonster(double inflict)
}
}
-void
+static void
throwspell(void)
{
double inflict; /* damage inflicted */
@@ -831,7 +842,7 @@ throwspell(void)
}
}
-void
+static void
callmonster(int which)
{
struct monster Othermonster; /* to find a name for mimics */
@@ -908,7 +919,7 @@ callmonster(int which)
Curmonster.m_melee = Curmonster.m_skirmish = 0.0;
}
-void
+static void
awardtreasure(void)
{
int whichtreasure; /* calculated treasure to grant */
@@ -1332,7 +1343,7 @@ awardtreasure(void)
}
}
-void
+static void
cursedtreasure(void)
{
if (Player.p_charms > 0) {
@@ -1349,7 +1360,7 @@ cursedtreasure(void)
}
}
-void
+static void
scramblestats(void)
{
double dbuf[6]; /* to put statistic in */
diff --git a/phantasia/interplayer.c b/phantasia/interplayer.c
index d47d32e0..3bb797d4 100644
--- a/phantasia/interplayer.c
+++ b/phantasia/interplayer.c
@@ -1,4 +1,4 @@
-/* $NetBSD: interplayer.c,v 1.10 2009/05/25 23:08:45 dholland Exp $ */
+/* $NetBSD: interplayer.c,v 1.11 2009/08/12 08:21:41 dholland Exp $ */
/*
* interplayer.c - player to player routines for Phantasia
@@ -8,6 +8,11 @@
#undef bool
#include <curses.h>
+static long allocvoid(void);
+static void battleplayer(long);
+static void myturn(void);
+static void tampered(int, double, double);
+
void
checkbattle(void)
{
@@ -45,7 +50,7 @@ checkbattle(void)
}
}
-void
+static void
battleplayer(long foeplace)
{
double dtemp; /* for temporary calculations */
@@ -273,7 +278,7 @@ LEAVE:
death("Interterminal battle");
}
-void
+static void
myturn(void)
{
double dtemp; /* for temporary calculations */
@@ -384,7 +389,7 @@ checktampered(void)
tampered(Other.p_tampered, Other.p_1scratch, Other.p_2scratch);
}
-void
+static void
tampered(int what, double arg1, double arg2)
{
long loc; /* location in file of other players */
@@ -866,7 +871,7 @@ writevoid(struct energyvoid *vp, long loc)
fseek(Energyvoidfp, 0L, SEEK_SET);
}
-long
+static long
allocvoid(void)
{
long loc = 0L; /* location of new energy void */
diff --git a/phantasia/io.c b/phantasia/io.c
index 1f9d330f..239942ab 100644
--- a/phantasia/io.c
+++ b/phantasia/io.c
@@ -1,4 +1,4 @@
-/* $NetBSD: io.c,v 1.12 2009/05/25 23:08:45 dholland Exp $ */
+/* $NetBSD: io.c,v 1.13 2009/08/12 08:21:41 dholland Exp $ */
/*
* io.c - input/output routines for Phantasia
@@ -9,6 +9,8 @@
#include <sys/cdefs.h>
#include <curses.h>
+static void catchalarm(int) __dead;
+
void
getstring(char *cp, int mx)
{
@@ -234,7 +236,7 @@ getanswer(const char *choices, phbool def)
return (*choices);
}
-void
+static void
catchalarm(int dummy __unused)
{
longjmp(Timeoenv, 1);
diff --git a/phantasia/main.c b/phantasia/main.c
index 57fe7557..7e480d0a 100644
--- a/phantasia/main.c
+++ b/phantasia/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.21 2009/05/26 00:30:16 dholland Exp $ */
+/* $NetBSD: main.c,v 1.22 2009/08/12 08:21:41 dholland Exp $ */
/*
* Phantasia 3.3.2 -- Interterminal fantasy game
@@ -61,6 +61,15 @@
#undef bool
#include <curses.h>
+static void genchar(int);
+static void initialstate(void);
+static void neatstuff(void);
+static void playinit(void);
+static void procmain(void);
+static long recallplayer(void);
+static long rollnewplayer(void);
+static void titlelist(void);
+
int main(int, char **);
int
@@ -268,7 +277,7 @@ main(int argc, char **argv)
}
}
-void
+static void
initialstate(void)
{
struct stat sb;
@@ -325,7 +334,7 @@ initialstate(void)
srandom((unsigned) time(NULL)); /* prime random numbers */
}
-long
+static long
rollnewplayer(void)
{
int chartype; /* character type */
@@ -415,7 +424,7 @@ rollnewplayer(void)
return (allocrecord());
}
-void
+static void
procmain(void)
{
int ch; /* input */
@@ -625,7 +634,7 @@ procmain(void)
}
}
-void
+static void
titlelist(void)
{
FILE *fp; /* used for opening various files */
@@ -735,7 +744,7 @@ titlelist(void)
refresh();
}
-long
+static long
recallplayer(void)
{
long loc = 0L; /* location in player file */
@@ -794,7 +803,7 @@ recallplayer(void)
return (-1L);
}
-void
+static void
neatstuff(void)
{
double temp; /* for temporary calculations */
@@ -896,7 +905,7 @@ neatstuff(void)
}
}
-void
+static void
genchar(int type)
{
int subscript; /* used for subscripting into Stattable */
@@ -932,7 +941,7 @@ genchar(int type)
Player.p_experience = ROLL(600.0, 200.0);
}
-void
+static void
playinit(void)
{
/* catch/ingnore signals */
diff --git a/phantasia/misc.c b/phantasia/misc.c
index 881f4cc4..48909029 100644
--- a/phantasia/misc.c
+++ b/phantasia/misc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: misc.c,v 1.17 2009/05/25 23:14:33 dholland Exp $ */
+/* $NetBSD: misc.c,v 1.18 2009/08/12 08:21:41 dholland Exp $ */
/*
* misc.c Phantasia miscellaneous support routines
@@ -9,7 +9,9 @@
#include <curses.h>
-void
+static double explevel(double);
+
+static void
movelevel(void)
{
const struct charstats *statptr; /* for pointing into Stattable */
@@ -682,7 +684,7 @@ writerecord(struct player *playerp, long place)
fflush(Playersfp);
}
-double
+static double
explevel(double experience)
{
if (experience < 1.1e7)
diff --git a/phantasia/phantglobs.h b/phantasia/phantglobs.h
index 82cf9c32..b151a4d8 100644
--- a/phantasia/phantglobs.h
+++ b/phantasia/phantglobs.h
@@ -1,4 +1,4 @@
-/* $NetBSD: phantglobs.h,v 1.10 2009/05/25 22:35:01 dholland Exp $ */
+/* $NetBSD: phantglobs.h,v 1.11 2009/08/12 08:21:41 dholland Exp $ */
/*
* phantglobs.h - global declarations for Phantasia
@@ -66,20 +66,13 @@ const char *descrtype(struct player *, bool);
void activelist(void);
void adjuststats(void);
long allocrecord(void);
-long allocvoid(void);
void allstatslist(void);
void altercoordinates(double, double, int);
-void awardtreasure(void);
-void battleplayer(long);
-void callmonster(int);
-void cancelmonster(void);
-void catchalarm(int) __dead;
void changestats(bool);
void checkbattle(void);
void checktampered(void);
void cleanup(int);
void collecttaxes(double, double);
-void cursedtreasure(void);
void death(const char *);
void displaystats(void);
double distance(double, double, double, double);
@@ -88,41 +81,23 @@ double drandom(void);
void encounter(int);
void enterscore(void);
void error(const char *);
-double explevel(double);
long findname(const char *, struct player *);
void freerecord(struct player *, long);
-void genchar(int);
int getanswer(const char *, bool);
void getstring(char *, int);
-void hitmonster(double);
void ill_sig(int);
double infloat(void);
-void initialstate(void);
void initplayer(struct player *);
int inputoption(void);
void interrupt(void);
void leavegame(void);
-void monsthits(void);
void monstlist(void);
void more(int);
-void movelevel(void);
-void myturn(void);
-void neatstuff(void);
-int pickmonster(void);
-void playerhits(void);
-void playinit(void);
-void procmain(void);
void purgeoldplayers(void);
void readmessage(void);
void readrecord(struct player *, long);
-long recallplayer(void);
-long rollnewplayer(void);
void scorelist(void);
-void scramblestats(void);
-void tampered(int, double, double);
void throneroom(void);
-void throwspell(void);
-void titlelist(void);
void tradingpost(void);
void truncstring(char *);
void userlist(bool);