Module Name:    src
Committed By:   dholland
Date:           Mon May 25 23:08:45 UTC 2009

Modified Files:
        src/games/phantasia: fight.c gamesupport.c interplayer.c io.c main.c
            misc.c setup.c

Log Message:
ANSIfy function declarations. Object file diffs cross-checked.


To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.11 src/games/phantasia/fight.c
cvs rdiff -u -r1.9 -r1.10 src/games/phantasia/gamesupport.c \
    src/games/phantasia/interplayer.c
cvs rdiff -u -r1.11 -r1.12 src/games/phantasia/io.c
cvs rdiff -u -r1.17 -r1.18 src/games/phantasia/main.c
cvs rdiff -u -r1.15 -r1.16 src/games/phantasia/misc.c
cvs rdiff -u -r1.18 -r1.19 src/games/phantasia/setup.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.10 src/games/phantasia/fight.c:1.11
--- src/games/phantasia/fight.c:1.10	Sun Apr 11 13:35:06 2004
+++ src/games/phantasia/fight.c	Mon May 25 23:08:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: fight.c,v 1.10 2004/04/11 13:35:06 he Exp $	*/
+/*	$NetBSD: fight.c,v 1.11 2009/05/25 23:08:45 dholland Exp $	*/
 
 /*
  * fight.c   Phantasia monster fighting routines
@@ -9,8 +9,7 @@
 #include <curses.h>
 
 void
-encounter(particular)
-	int     particular;
+encounter(int particular)
 {
 	volatile bool    firsthit = Player.p_blessing;	/* set if player gets
 							 * the first hit */
@@ -154,7 +153,7 @@
 }
 
 int
-pickmonster()
+pickmonster(void)
 {
 	if (Player.p_specialtype == SC_VALAR)
 		/* even chance of any monster */
@@ -194,7 +193,7 @@
 }
 
 void
-playerhits()
+playerhits(void)
 {
 	double  inflict;	/* damage inflicted */
 	int     ch;		/* input */
@@ -337,7 +336,7 @@
 }
 
 void
-monsthits()
+monsthits(void)
 {
 	double  inflict;	/* damage inflicted */
 	int     ch;		/* input */
@@ -587,7 +586,7 @@
 }
 
 void
-cancelmonster()
+cancelmonster(void)
 {
 	Curmonster.m_energy = 0.0;
 	Curmonster.m_experience = 0.0;
@@ -596,8 +595,7 @@
 }
 
 void
-hitmonster(inflict)
-	double  inflict;
+hitmonster(double inflict)
 {
 	mvprintw(Lines++, 0, "You hit %s %.0f times!", Enemyname, inflict);
 	Curmonster.m_energy -= inflict;
@@ -624,7 +622,7 @@
 }
 
 void
-throwspell()
+throwspell(void)
 {
 	double  inflict;	/* damage inflicted */
 	double  dtemp;		/* for dtemporary calculations */
@@ -834,8 +832,7 @@
 }
 
 void
-callmonster(which)
-	int     which;
+callmonster(int which)
 {
 	struct monster Othermonster;	/* to find a name for mimics */
 
@@ -912,7 +909,7 @@
 }
 
 void
-awardtreasure()
+awardtreasure(void)
 {
 	int     whichtreasure;	/* calculated treasure to grant */
 	int     temp;		/* temporary */
@@ -1336,7 +1333,7 @@
 }
 
 void
-cursedtreasure()
+cursedtreasure(void)
 {
 	if (Player.p_charms > 0) {
 		addstr("But your charm saved you!\n");
@@ -1353,7 +1350,7 @@
 }
 
 void
-scramblestats()
+scramblestats(void)
 {
 	double  dbuf[6];	/* to put statistic in */
 	double  dtemp1, dtemp2;	/* for swapping values */

Index: src/games/phantasia/gamesupport.c
diff -u src/games/phantasia/gamesupport.c:1.9 src/games/phantasia/gamesupport.c:1.10
--- src/games/phantasia/gamesupport.c:1.9	Tue Feb 15 12:58:21 2005
+++ src/games/phantasia/gamesupport.c	Mon May 25 23:08:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: gamesupport.c,v 1.9 2005/02/15 12:58:21 jsm Exp $	*/
+/*	$NetBSD: gamesupport.c,v 1.10 2009/05/25 23:08:45 dholland Exp $	*/
 
 /*
  * gamesupport.c - auxiliary routines for support of Phantasia
@@ -9,8 +9,7 @@
 #include <curses.h>
 
 void
-changestats(ingameflag)
-	phbool  ingameflag;
+changestats(phbool ingameflag)
 {
 	static char flag[2] =	/* for printing values of bools */
 	{'F', 'T'};
@@ -440,7 +439,7 @@
 }
 
 void
-monstlist()
+monstlist(void)
 {
 	int     count = 0;	/* count in file */
 
@@ -454,7 +453,7 @@
 }
 
 void
-scorelist()
+scorelist(void)
 {
 	struct scoreboard sbuf;	/* for reading entries */
 	FILE   *fp;		/* to open the file */
@@ -468,7 +467,7 @@
 }
 
 void
-activelist()
+activelist(void)
 {
 	fseek(Playersfp, 0L, SEEK_SET);
 	printf("Current characters on file are:\n\n");
@@ -482,7 +481,7 @@
 }
 
 void
-purgeoldplayers()
+purgeoldplayers(void)
 {
 	int     today;		/* day of year for today */
 	int     daysold;	/* how many days since the character has been
@@ -511,7 +510,7 @@
 }
 
 void
-enterscore()
+enterscore(void)
 {
 	struct scoreboard sbuf;	/* buffer to read in scoreboard entries */
 	FILE   *fp;		/* to open scoreboard file */
Index: src/games/phantasia/interplayer.c
diff -u src/games/phantasia/interplayer.c:1.9 src/games/phantasia/interplayer.c:1.10
--- src/games/phantasia/interplayer.c:1.9	Tue Feb 15 12:58:21 2005
+++ src/games/phantasia/interplayer.c	Mon May 25 23:08:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: interplayer.c,v 1.9 2005/02/15 12:58:21 jsm Exp $	*/
+/*	$NetBSD: interplayer.c,v 1.10 2009/05/25 23:08:45 dholland Exp $	*/
 
 /*
  * interplayer.c - player to player routines for Phantasia
@@ -9,7 +9,7 @@
 #include <curses.h>
 
 void
-checkbattle()
+checkbattle(void)
 {
 	long    foeloc = 0L;	/* location in file of person to fight */
 
@@ -46,8 +46,7 @@
 }
 
 void
-battleplayer(foeplace)
-	long    foeplace;
+battleplayer(long foeplace)
 {
 	double  dtemp;		/* for temporary calculations */
 	double  oldhits = 0.0;	/* previous damage inflicted by foe */
@@ -275,7 +274,7 @@
 }
 
 void
-myturn()
+myturn(void)
 {
 	double  dtemp;		/* for temporary calculations */
 	int     ch;		/* input */
@@ -353,7 +352,7 @@
 }
 
 void
-checktampered()
+checktampered(void)
 {
 	long    loc = 0L;	/* location in energy void file */
 
@@ -386,10 +385,7 @@
 }
 
 void
-tampered(what, arg1, arg2)
-	int     what;
-	double  arg1;
-	double  arg2;
+tampered(int what, double arg1, double arg2)
 {
 	long    loc;		/* location in file of other players */
 
@@ -538,8 +534,7 @@
 }
 
 void
-userlist(ingameflag)
-	phbool  ingameflag;
+userlist(phbool ingameflag)
 {
 	int     numusers = 0;	/* number of users on file */
 
@@ -601,7 +596,7 @@
 }
 
 void
-throneroom()
+throneroom(void)
 {
 	FILE   *fp;		/* to clear energy voids */
 	long    loc = 0L;	/* location of old king in player file */
@@ -655,7 +650,7 @@
 }
 
 void
-dotampered()
+dotampered(void)
 {
 	short   tamper;		/* value for tampering with other players */
 	const char   *option;		/* pointer to option description */
@@ -862,9 +857,7 @@
 }
 
 void
-writevoid(vp, loc)
-	struct energyvoid *vp;
-	long    loc;
+writevoid(struct energyvoid *vp, long loc)
 {
 
 	fseek(Energyvoidfp, loc, SEEK_SET);
@@ -874,7 +867,7 @@
 }
 
 long
-allocvoid()
+allocvoid(void)
 {
 	long    loc = 0L;	/* location of new energy void */
 

Index: src/games/phantasia/io.c
diff -u src/games/phantasia/io.c:1.11 src/games/phantasia/io.c:1.12
--- src/games/phantasia/io.c:1.11	Sat Dec 15 19:44:42 2007
+++ src/games/phantasia/io.c	Mon May 25 23:08:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: io.c,v 1.11 2007/12/15 19:44:42 perry Exp $	*/
+/*	$NetBSD: io.c,v 1.12 2009/05/25 23:08:45 dholland Exp $	*/
 
 /*
  * io.c - input/output routines for Phantasia
@@ -10,9 +10,7 @@
 #include <curses.h>
 
 void
-getstring(cp, mx)
-	char   *cp;
-	int     mx;
+getstring(char *cp, int mx)
 {
 	char   *inptr;		/* pointer into string for next string */
 	int     x, y;		/* original x, y coordinates on screen */
@@ -62,15 +60,14 @@
 }
 
 void
-more(where)
-	int     where;
+more(int where)
 {
 	mvaddstr(where, 0, "-- more --");
 	getanswer(" ", FALSE);
 }
 
 double
-infloat()
+infloat(void)
 {
 	double  result;		/* return value */
 
@@ -83,7 +80,7 @@
 }
 
 int
-inputoption()
+inputoption(void)
 {
 	++Player.p_age;		/* increase age */
 
@@ -99,7 +96,7 @@
 }
 
 void
-interrupt()
+interrupt(void)
 {
 	char    line[81];	/* a place to store data already on screen */
 	int     loop;		/* counter */
@@ -155,9 +152,7 @@
 }
 
 int
-getanswer(choices, def)
-	const char   *choices;
-	phbool  def;
+getanswer(const char *choices, phbool def)
 {
 	int     ch;		/* input */
 	volatile int	loop;	/* counter */
@@ -240,8 +235,7 @@
 }
 
 void
-catchalarm(dummy)
-	int dummy __unused;
+catchalarm(int dummy __unused)
 {
 	longjmp(Timeoenv, 1);
 }

Index: src/games/phantasia/main.c
diff -u src/games/phantasia/main.c:1.17 src/games/phantasia/main.c:1.18
--- src/games/phantasia/main.c:1.17	Fri Aug  8 16:10:47 2008
+++ src/games/phantasia/main.c	Mon May 25 23:08:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: main.c,v 1.17 2008/08/08 16:10:47 drochner Exp $	*/
+/*	$NetBSD: main.c,v 1.18 2009/05/25 23:08:45 dholland Exp $	*/
 
 /*
  * Phantasia 3.3.2 -- Interterminal fantasy game
@@ -63,9 +63,7 @@
 int	main(int, char **);
 
 int
-main(argc, argv)
-	int     argc;
-	char  **argv;
+main(int argc, char **argv)
 {
 	bool    noheader = FALSE;	/* set if don't want header */
 	bool    headeronly = FALSE;	/* set if only want header */
@@ -270,7 +268,7 @@
 }
 
 void
-initialstate()
+initialstate(void)
 {
 	struct stat sb;
 
@@ -321,7 +319,7 @@
 }
 
 long
-rollnewplayer()
+rollnewplayer(void)
 {
 	int     chartype;	/* character type */
 	int     ch;		/* input */
@@ -411,7 +409,7 @@
 }
 
 void
-procmain()
+procmain(void)
 {
 	int     ch;		/* input */
 	double  x;		/* desired new x coordinate */
@@ -621,7 +619,7 @@
 }
 
 void
-titlelist()
+titlelist(void)
 {
 	FILE   *fp;		/* used for opening various files */
 	bool    councilfound = FALSE;	/* set if we find a member of the
@@ -726,7 +724,7 @@
 }
 
 long
-recallplayer()
+recallplayer(void)
 {
 	long    loc = 0L;	/* location in player file */
 	int     loop;		/* loop counter */
@@ -785,7 +783,7 @@
 }
 
 void
-neatstuff()
+neatstuff(void)
 {
 	double  temp;		/* for temporary calculations */
 	int     ch;		/* input */
@@ -887,8 +885,7 @@
 }
 
 void
-genchar(type)
-	int     type;
+genchar(int type)
 {
 	int     subscript;	/* used for subscripting into Stattable */
 	const struct charstats *statptr; /* for pointing into Stattable */
@@ -924,7 +921,7 @@
 }
 
 void
-playinit()
+playinit(void)
 {
 	/* catch/ingnore signals */
 
@@ -1007,8 +1004,7 @@
 }
 
 void
-cleanup(doexit)
-	int    doexit;
+cleanup(int doexit)
 {
 	if (Windows) {
 		move(LINES - 2, 0);

Index: src/games/phantasia/misc.c
diff -u src/games/phantasia/misc.c:1.15 src/games/phantasia/misc.c:1.16
--- src/games/phantasia/misc.c:1.15	Mon Jan 28 06:20:15 2008
+++ src/games/phantasia/misc.c	Mon May 25 23:08:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: misc.c,v 1.15 2008/01/28 06:20:15 dholland Exp $	*/
+/*	$NetBSD: misc.c,v 1.16 2009/05/25 23:08:45 dholland Exp $	*/
 
 /*
  * misc.c  Phantasia miscellaneous support routines
@@ -10,7 +10,7 @@
 
 
 void
-movelevel()
+movelevel(void)
 {
 	const struct charstats *statptr; /* for pointing into Stattable */
 	double  new;		/* new level */
@@ -63,9 +63,7 @@
 }
 
 const char   *
-descrlocation(playerp, shortflag)
-	struct player *playerp;
-	phbool  shortflag;
+descrlocation(struct player *playerp, phbool shortflag)
 {
 	double  circle;		/* corresponding circle for coordinates */
 	int     quadrant;	/* quandrant of grid */
@@ -143,7 +141,7 @@
 }
 
 void
-tradingpost()
+tradingpost(void)
 {
 	double  numitems;	/* number of items to purchase */
 	double  cost;		/* cost of purchase */
@@ -400,7 +398,7 @@
 }
 
 void
-displaystats()
+displaystats(void)
 {
 	mvprintw(0, 0, "%s%s\n", Player.p_name, descrlocation(&Player, FALSE));
 	mvprintw(1, 0, "Level :%7.0f   Energy  :%9.0f(%9.0f)  Mana :%9.0f  Users:%3d\n",
@@ -412,7 +410,7 @@
 }
 
 void
-allstatslist()
+allstatslist(void)
 {
 	static const char *const flags[] = /* to print value of some bools */
 	{
@@ -445,9 +443,7 @@
 }
 
 const char   *
-descrtype(playerp, shortflag)
-	struct player *playerp;
-	phbool  shortflag;
+descrtype(struct player *playerp, phbool shortflag)
 {
 	int     type;		/* for caluculating result subscript */
 	static const char *const results[] =/* description table */
@@ -509,9 +505,7 @@
 }
 
 long
-findname(name, playerp)
-	const char   *name;
-	struct player *playerp;
+findname(const char *name, struct player *playerp)
 {
 	long    loc = 0;	/* location in the file */
 
@@ -529,7 +523,7 @@
 }
 
 long
-allocrecord()
+allocrecord(void)
 {
 	long    loc = 0L;	/* location in file */
 
@@ -551,9 +545,7 @@
 }
 
 void
-freerecord(playerp, loc)
-	struct player *playerp;
-	long    loc;
+freerecord(struct player *playerp, long loc)
 {
 	playerp->p_name[0] = CH_MARKDELETE;
 	playerp->p_status = S_NOTUSED;
@@ -561,7 +553,7 @@
 }
 
 void
-leavegame()
+leavegame(void)
 {
 
 	if (Player.p_level < 1.0)
@@ -577,8 +569,7 @@
 }
 
 void
-death(how)
-	const char   *how;
+death(const char *how)
 {
 	FILE   *fp;		/* for updating various files */
 	int     ch;		/* input */
@@ -682,9 +673,7 @@
 }
 
 void
-writerecord(playerp, place)
-	struct player *playerp;
-	long    place;
+writerecord(struct player *playerp, long place)
 {
 	fseek(Playersfp, place, SEEK_SET);
 	fwrite((char *) playerp, SZ_PLAYERSTRUCT, 1, Playersfp);
@@ -692,8 +681,7 @@
 }
 
 double
-explevel(experience)
-	double  experience;
+explevel(double experience)
 {
 	if (experience < 1.1e7)
 		return (floor(pow((experience / 1000.0), 0.4875)));
@@ -702,8 +690,7 @@
 }
 
 void
-truncstring(string)
-	char   *string;
+truncstring(char *string)
 {
 	int     length;		/* length of string */
 
@@ -713,10 +700,7 @@
 }
 
 void
-altercoordinates(xnew, ynew, operation)
-	double  xnew;
-	double  ynew;
-	int     operation;
+altercoordinates(double xnew, double ynew, int operation)
 {
 	switch (operation) {
 	case A_FORCED:		/* move with no checks */
@@ -766,16 +750,14 @@
 }
 
 void
-readrecord(playerp, loc)
-	struct player *playerp;
-	long    loc;
+readrecord(struct player *playerp, long loc)
 {
 	fseek(Playersfp, loc, SEEK_SET);
 	fread((char *) playerp, SZ_PLAYERSTRUCT, 1, Playersfp);
 }
 
 void
-adjuststats()
+adjuststats(void)
 {
 	double  dtemp;		/* for temporary calculations */
 
@@ -866,8 +848,7 @@
 }
 
 void
-initplayer(playerp)
-	struct player *playerp;
+initplayer(struct player *playerp)
 {
 	playerp->p_experience =
 	    playerp->p_level =
@@ -926,7 +907,7 @@
 }
 
 void
-readmessage()
+readmessage(void)
 {
 	move(3, 0);
 	clrtoeol();
@@ -936,8 +917,7 @@
 }
 
 void
-error(whichfile)
-	const char   *whichfile;
+error(const char *whichfile)
 {
 	int     (*funcp)(const char *,...);
 
@@ -954,8 +934,7 @@
 }
 
 double
-distance(x_1, x_2, y_1, y_2)
-	double  x_1, x_2, y_1, y_2;
+distance(double x_1, double x_2, double y_1, double y_2)
 {
 	double  deltax, deltay;
 
@@ -965,8 +944,7 @@
 }
 
 void
-ill_sig(whichsig)
-	int     whichsig;
+ill_sig(int whichsig)
 {
 	clear();
 	if (!(whichsig == SIGINT || whichsig == SIGQUIT))
@@ -976,8 +954,7 @@
 }
 
 const char *
-descrstatus(playerp)
-	struct player *playerp;
+descrstatus(struct player *playerp)
 {
 	switch (playerp->p_status) {
 	case S_PLAYING:
@@ -1013,7 +990,7 @@
 }
 
 double
-drandom()
+drandom(void)
 {
 	if (sizeof(int) != 2)
 		/* use only low bits */
@@ -1023,9 +1000,7 @@
 }
 
 void
-collecttaxes(gold, gems)
-	double  gold;
-	double  gems;
+collecttaxes(double gold, double gems)
 {
 	FILE   *fp;		/* to update Goldfile */
 	double  dtemp;		/* for temporary calculations */

Index: src/games/phantasia/setup.c
diff -u src/games/phantasia/setup.c:1.18 src/games/phantasia/setup.c:1.19
--- src/games/phantasia/setup.c:1.18	Wed Jan 16 23:23:25 2008
+++ src/games/phantasia/setup.c	Mon May 25 23:08:45 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: setup.c,v 1.18 2008/01/16 23:23:25 lukem Exp $	*/
+/*	$NetBSD: setup.c,v 1.19 2009/05/25 23:08:45 dholland Exp $	*/
 
 /*
  * setup.c - set up all files for Phantasia
@@ -68,9 +68,7 @@
 const char *monsterfile = "monsters.asc";
 
 int
-main(argc, argv)
-	int argc;
-	char *argv[];
+main(int argc, char *argv[])
 {
 	const char *const *filename; /* for pointing to file names */
 	int		fd;		/* file descriptor */
@@ -229,8 +227,7 @@
 / ************************************************************************/
 
 void
-Error(str, file)
-	const char	*str, *file;
+Error(const char *str, const char *file)
 {
     fprintf(stderr, "Error: ");
     fprintf(stderr, str, file);
@@ -262,7 +259,7 @@
 / ************************************************************************/
 
 double
-drandom()
+drandom(void)
 {
     if (sizeof(int) != 2)
 	return((double) (random() & 0x7fff) / 32768.0);

Reply via email to