Module Name:    src
Committed By:   dholland
Date:           Wed Aug 12 08:21:41 UTC 2009

Modified Files:
        src/games/phantasia: fight.c interplayer.c io.c main.c misc.c
            phantglobs.h

Log Message:
sprinkle static


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/games/phantasia/fight.c
cvs rdiff -u -r1.10 -r1.11 src/games/phantasia/interplayer.c \
    src/games/phantasia/phantglobs.h
cvs rdiff -u -r1.12 -r1.13 src/games/phantasia/io.c
cvs rdiff -u -r1.21 -r1.22 src/games/phantasia/main.c
cvs rdiff -u -r1.17 -r1.18 src/games/phantasia/misc.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/games/phantasia/fight.c
diff -u src/games/phantasia/fight.c:1.11 src/games/phantasia/fight.c:1.12
--- src/games/phantasia/fight.c:1.11	Mon May 25 23:08:45 2009
+++ src/games/phantasia/fight.c	Wed Aug 12 08:21:41 2009
@@ -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 @@
 	clrtobot();
 }
 
-int
+static int
 pickmonster(void)
 {
 	if (Player.p_specialtype == SC_VALAR)
@@ -192,7 +203,7 @@
 						return ((int) ROLL(14.0, 25.0));
 }
 
-void
+static void
 playerhits(void)
 {
 	double  inflict;	/* damage inflicted */
@@ -335,7 +346,7 @@
 
 }
 
-void
+static void
 monsthits(void)
 {
 	double  inflict;	/* damage inflicted */
@@ -585,7 +596,7 @@
 	}
 }
 
-void
+static void
 cancelmonster(void)
 {
 	Curmonster.m_energy = 0.0;
@@ -594,7 +605,7 @@
 	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 @@
 	}
 }
 
-void
+static void
 throwspell(void)
 {
 	double  inflict;	/* damage inflicted */
@@ -831,7 +842,7 @@
 		}
 }
 
-void
+static void
 callmonster(int which)
 {
 	struct monster Othermonster;	/* to find a name for mimics */
@@ -908,7 +919,7 @@
 	Curmonster.m_melee = Curmonster.m_skirmish = 0.0;
 }
 
-void
+static void
 awardtreasure(void)
 {
 	int     whichtreasure;	/* calculated treasure to grant */
@@ -1332,7 +1343,7 @@
 	}
 }
 
-void
+static void
 cursedtreasure(void)
 {
 	if (Player.p_charms > 0) {
@@ -1349,7 +1360,7 @@
 		}
 }
 
-void
+static void
 scramblestats(void)
 {
 	double  dbuf[6];	/* to put statistic in */

Index: src/games/phantasia/interplayer.c
diff -u src/games/phantasia/interplayer.c:1.10 src/games/phantasia/interplayer.c:1.11
--- src/games/phantasia/interplayer.c:1.10	Mon May 25 23:08:45 2009
+++ src/games/phantasia/interplayer.c	Wed Aug 12 08:21:41 2009
@@ -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 @@
 	}
 }
 
-void
+static void
 battleplayer(long foeplace)
 {
 	double  dtemp;		/* for temporary calculations */
@@ -273,7 +278,7 @@
 		death("Interterminal battle");
 }
 
-void
+static void
 myturn(void)
 {
 	double  dtemp;		/* for temporary calculations */
@@ -384,7 +389,7 @@
 		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 @@
 	fseek(Energyvoidfp, 0L, SEEK_SET);
 }
 
-long
+static long
 allocvoid(void)
 {
 	long    loc = 0L;	/* location of new energy void */
Index: src/games/phantasia/phantglobs.h
diff -u src/games/phantasia/phantglobs.h:1.10 src/games/phantasia/phantglobs.h:1.11
--- src/games/phantasia/phantglobs.h:1.10	Mon May 25 22:35:01 2009
+++ src/games/phantasia/phantglobs.h	Wed Aug 12 08:21:41 2009
@@ -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 @@
 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 @@
 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);

Index: src/games/phantasia/io.c
diff -u src/games/phantasia/io.c:1.12 src/games/phantasia/io.c:1.13
--- src/games/phantasia/io.c:1.12	Mon May 25 23:08:45 2009
+++ src/games/phantasia/io.c	Wed Aug 12 08:21:41 2009
@@ -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 @@
 	return (*choices);
 }
 
-void
+static void
 catchalarm(int dummy __unused)
 {
 	longjmp(Timeoenv, 1);

Index: src/games/phantasia/main.c
diff -u src/games/phantasia/main.c:1.21 src/games/phantasia/main.c:1.22
--- src/games/phantasia/main.c:1.21	Tue May 26 00:30:16 2009
+++ src/games/phantasia/main.c	Wed Aug 12 08:21:41 2009
@@ -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 @@
 	}
 }
 
-void
+static void
 initialstate(void)
 {
 	struct stat sb;
@@ -325,7 +334,7 @@
 	srandom((unsigned) time(NULL));	/* prime random numbers */
 }
 
-long
+static long
 rollnewplayer(void)
 {
 	int     chartype;	/* character type */
@@ -415,7 +424,7 @@
 	return (allocrecord());
 }
 
-void
+static void
 procmain(void)
 {
 	int     ch;		/* input */
@@ -625,7 +634,7 @@
 	}
 }
 
-void
+static void
 titlelist(void)
 {
 	FILE   *fp;		/* used for opening various files */
@@ -735,7 +744,7 @@
 	refresh();
 }
 
-long
+static long
 recallplayer(void)
 {
 	long    loc = 0L;	/* location in player file */
@@ -794,7 +803,7 @@
 	return (-1L);
 }
 
-void
+static void
 neatstuff(void)
 {
 	double  temp;		/* for temporary calculations */
@@ -896,7 +905,7 @@
 	}
 }
 
-void
+static void
 genchar(int type)
 {
 	int     subscript;	/* used for subscripting into Stattable */
@@ -932,7 +941,7 @@
 		Player.p_experience = ROLL(600.0, 200.0);
 }
 
-void
+static void
 playinit(void)
 {
 	/* catch/ingnore signals */

Index: src/games/phantasia/misc.c
diff -u src/games/phantasia/misc.c:1.17 src/games/phantasia/misc.c:1.18
--- src/games/phantasia/misc.c:1.17	Mon May 25 23:14:33 2009
+++ src/games/phantasia/misc.c	Wed Aug 12 08:21:41 2009
@@ -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 @@
 	fflush(Playersfp);
 }
 
-double
+static double
 explevel(double experience)
 {
 	if (experience < 1.1e7)

Reply via email to