summaryrefslogtreecommitdiffstats
path: root/gomoku
diff options
context:
space:
mode:
authordholland <dholland@NetBSD.org>2009-06-04 05:27:04 +0000
committerdholland <dholland@NetBSD.org>2009-06-04 05:27:04 +0000
commit7e3d1e2e5930a9b9e295b12b5a0bff07e8cd85b3 (patch)
tree94daf6108bb82b5435f9fab49b6e7ed316698e7b /gomoku
parentb384b7ee2511f7ac65ac137707ffa6ad63d1e634 (diff)
downloadbsdgames-darwin-7e3d1e2e5930a9b9e295b12b5a0bff07e8cd85b3.tar.gz
bsdgames-darwin-7e3d1e2e5930a9b9e295b12b5a0bff07e8cd85b3.tar.zst
bsdgames-darwin-7e3d1e2e5930a9b9e295b12b5a0bff07e8cd85b3.zip
ANSIfy function declarations.x
Diffstat (limited to 'gomoku')
-rw-r--r--gomoku/bdinit.c9
-rw-r--r--gomoku/bdisp.c28
-rw-r--r--gomoku/main.c28
-rw-r--r--gomoku/makemove.c10
-rw-r--r--gomoku/pickmove.c71
-rw-r--r--gomoku/stoc.c13
6 files changed, 53 insertions, 106 deletions
diff --git a/gomoku/bdinit.c b/gomoku/bdinit.c
index 53ea7d25..a601314a 100644
--- a/gomoku/bdinit.c
+++ b/gomoku/bdinit.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bdinit.c,v 1.5 2003/08/07 09:37:15 agc Exp $ */
+/* $NetBSD: bdinit.c,v 1.6 2009/06/04 05:27:04 dholland Exp $ */
/*
* Copyright (c) 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "from: @(#)bdinit.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: bdinit.c,v 1.5 2003/08/07 09:37:15 agc Exp $");
+__RCSID("$NetBSD: bdinit.c,v 1.6 2009/06/04 05:27:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -45,8 +45,7 @@ __RCSID("$NetBSD: bdinit.c,v 1.5 2003/08/07 09:37:15 agc Exp $");
#include "gomoku.h"
void
-bdinit(bp)
- struct spotstr *bp;
+bdinit(struct spotstr *bp)
{
int i, j, r;
struct spotstr *sp;
@@ -172,7 +171,7 @@ bdinit(bp)
* common open spaces shared between the two frames.
*/
void
-init_overlap()
+init_overlap(void)
{
struct spotstr *sp1, *sp2;
struct combostr *cbp;
diff --git a/gomoku/bdisp.c b/gomoku/bdisp.c
index b1f18033..70297ce2 100644
--- a/gomoku/bdisp.c
+++ b/gomoku/bdisp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bdisp.c,v 1.9 2008/08/08 16:10:47 drochner Exp $ */
+/* $NetBSD: bdisp.c,v 1.10 2009/06/04 05:27:04 dholland Exp $ */
/*
* Copyright (c) 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)bdisp.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: bdisp.c,v 1.9 2008/08/08 16:10:47 drochner Exp $");
+__RCSID("$NetBSD: bdisp.c,v 1.10 2009/06/04 05:27:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -59,7 +59,7 @@ extern char *plyr[];
* Initialize screen display.
*/
void
-cursinit()
+cursinit(void)
{
if (!initscr()) {
@@ -75,7 +75,7 @@ cursinit()
* Restore screen display.
*/
void
-cursfini()
+cursfini(void)
{
leaveok(stdscr, FALSE);
@@ -89,7 +89,7 @@ cursfini()
* Initialize board display.
*/
void
-bdisp_init()
+bdisp_init(void)
{
int i, j;
@@ -121,8 +121,7 @@ bdisp_init()
* Update who is playing whom.
*/
void
-bdwho(update)
- int update;
+bdwho(int update)
{
int i;
@@ -144,7 +143,7 @@ bdwho(update)
* Update the board display after a move.
*/
void
-bdisp()
+bdisp(void)
{
int i, j, c;
struct spotstr *sp;
@@ -173,8 +172,7 @@ bdisp()
* Dump board display to a file.
*/
void
-bdump(fp)
- FILE *fp;
+bdump(FILE *fp)
{
int i, j, c;
struct spotstr *sp;
@@ -212,8 +210,7 @@ bdump(fp)
* Display a transcript entry
*/
void
-dislog(str)
- const char *str;
+dislog(const char *str)
{
if (++lastline >= SCRNH - 1) {
@@ -232,8 +229,7 @@ dislog(str)
*/
void
-ask(str)
- const char *str;
+ask(const char *str)
{
int len = strlen(str);
@@ -245,9 +241,7 @@ ask(str)
}
int
-getline(buf, size)
- char *buf;
- int size;
+getline(char *buf, int size)
{
char *cp, *end;
int c;
diff --git a/gomoku/main.c b/gomoku/main.c
index 58257483..39cd6272 100644
--- a/gomoku/main.c
+++ b/gomoku/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.14 2008/07/20 01:03:21 lukem Exp $ */
+/* $NetBSD: main.c,v 1.15 2009/06/04 05:27:04 dholland Exp $ */
/*
* Copyright (c) 1994
@@ -42,7 +42,7 @@ __COPYRIGHT("@(#) Copyright (c) 1994\
#if 0
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95";
#else
-__RCSID("$NetBSD: main.c,v 1.14 2008/07/20 01:03:21 lukem Exp $");
+__RCSID("$NetBSD: main.c,v 1.15 2009/06/04 05:27:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -82,9 +82,7 @@ const char *plyr[2]; /* who's who */
int main(int, char *[]);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char **argv)
{
char buf[128];
int color, curmove, i, ch;
@@ -335,8 +333,7 @@ again:
}
int
-readinput(fp)
- FILE *fp;
+readinput(FILE *fp)
{
char *cp;
int c;
@@ -353,8 +350,7 @@ readinput(fp)
* Handle strange situations.
*/
void
-whatsup(signum)
- int signum;
+whatsup(int signum)
{
int i, pnum, n, s1, s2, d1, d2;
struct spotstr *sp;
@@ -495,8 +491,7 @@ syntax:
* Display debug info.
*/
void
-dlog(str)
- const char *str;
+dlog(const char *str)
{
if (debugfp)
@@ -508,8 +503,7 @@ dlog(str)
}
void
-glog(str)
- const char *str;
+glog(const char *str)
{
if (debugfp)
@@ -521,7 +515,7 @@ glog(str)
}
void
-quit()
+quit(void)
{
if (interactive) {
bdisp(); /* show final board */
@@ -531,8 +525,7 @@ quit()
}
void
-quitsig(dummy)
- int dummy __unused;
+quitsig(int dummy __unused)
{
quit();
}
@@ -541,8 +534,7 @@ quitsig(dummy)
* Die gracefully.
*/
void
-panic(str)
- const char *str;
+panic(const char *str)
{
fprintf(stderr, "%s: %s\n", prog, str);
fputs("resign\n", stdout);
diff --git a/gomoku/makemove.c b/gomoku/makemove.c
index e28d0a14..e3b63428 100644
--- a/gomoku/makemove.c
+++ b/gomoku/makemove.c
@@ -1,4 +1,4 @@
-/* $NetBSD: makemove.c,v 1.8 2006/05/11 00:17:07 mrg Exp $ */
+/* $NetBSD: makemove.c,v 1.9 2009/06/04 05:27:04 dholland Exp $ */
/*
* Copyright (c) 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)makemove.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: makemove.c,v 1.8 2006/05/11 00:17:07 mrg Exp $");
+__RCSID("$NetBSD: makemove.c,v 1.9 2009/06/04 05:27:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -59,8 +59,7 @@ const int weight[5] = { 0, 1, 7, 22, 100 };
* TIE The game is a tie.
*/
int
-makemove(us, mv)
- int us, mv;
+makemove(int us, int mv)
{
struct spotstr *sp, *fsp;
union comboval *cp;
@@ -217,8 +216,7 @@ makemove(us, mv)
* fix up the overlap array due to updating spot osp.
*/
void
-update_overlap(osp)
- struct spotstr *osp;
+update_overlap(struct spotstr *osp)
{
struct spotstr *sp, *sp1, *sp2;
int i, f, r, r1, d, d1, n;
diff --git a/gomoku/pickmove.c b/gomoku/pickmove.c
index 1cdd7cc2..096ccb30 100644
--- a/gomoku/pickmove.c
+++ b/gomoku/pickmove.c
@@ -1,4 +1,4 @@
-/* $NetBSD: pickmove.c,v 1.13 2008/01/28 07:01:01 dholland Exp $ */
+/* $NetBSD: pickmove.c,v 1.14 2009/06/04 05:27:04 dholland Exp $ */
/*
* Copyright (c) 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)pickmove.c 8.2 (Berkeley) 5/3/95";
#else
-__RCSID("$NetBSD: pickmove.c,v 1.13 2008/01/28 07:01:01 dholland Exp $");
+__RCSID("$NetBSD: pickmove.c,v 1.14 2009/06/04 05:27:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -66,8 +66,7 @@ int tmpmap[MAPSZ]; /* map for blocking <1,x> combos */
int nforce; /* count of opponent <1,x> combos */
int
-pickmove(us)
- int us;
+pickmove(int us)
{
struct spotstr *sp, *sp1, *sp2;
union comboval *Ocp, *Tcp;
@@ -166,10 +165,7 @@ pickmove(us)
* Return true if spot 'sp' is better than spot 'sp1' for color 'us'.
*/
int
-better(sp, sp1, us)
- const struct spotstr *sp;
- const struct spotstr *sp1;
- int us;
+better(const struct spotstr *sp, const struct spotstr *sp1, int us)
{
int them, s, s1;
@@ -227,8 +223,7 @@ int curlevel; /* implicit parameter to makecombo() */
* Also, try to combine frames to find more complex (chained) moves.
*/
void
-scanframes(color)
- int color;
+scanframes(int color)
{
struct combostr *cbp, *ecbp;
struct spotstr *sp;
@@ -412,11 +407,7 @@ scanframes(color)
* within the frame 'ocbp' and combo value 's'.
*/
void
-makecombo2(ocbp, osp, off, s)
- struct combostr *ocbp;
- struct spotstr *osp;
- int off;
- int s;
+makecombo2(struct combostr *ocbp, struct spotstr *osp, int off, int s)
{
struct spotstr *fsp;
struct combostr *ncbp;
@@ -546,8 +537,7 @@ makecombo2(ocbp, osp, off, s)
* combinations of 'level' number of frames.
*/
void
-addframes(level)
- int level;
+addframes(int level)
{
struct combostr *cbp, *ecbp;
struct spotstr *sp, *fsp;
@@ -647,11 +637,7 @@ addframes(level)
* within the frame 'ocbp' and combo value 's'.
*/
void
-makecombo(ocbp, osp, off, s)
- struct combostr *ocbp;
- struct spotstr *osp;
- int off;
- int s;
+makecombo(struct combostr *ocbp, struct spotstr *osp, int off, int s)
{
struct combostr *cbp, *ncbp;
struct spotstr *sp;
@@ -798,8 +784,7 @@ struct combostr *ecombo[MAXDEPTH]; /* separate from elist to save space */
* in 'ocbp' that will complete the combo.
*/
void
-makeempty(ocbp)
- struct combostr *ocbp;
+makeempty(struct combostr *ocbp)
{
struct combostr *cbp, *tcbp, **cbpp;
struct elist *ep, *nep;
@@ -957,9 +942,7 @@ makeempty(ocbp)
* would be trying to "complete" the combo or trying to block it.
*/
void
-updatecombo(cbp, color)
- struct combostr *cbp;
- int color;
+updatecombo(struct combostr *cbp, int color)
{
struct spotstr *sp;
struct combostr *tcbp;
@@ -1048,9 +1031,7 @@ updatecombo(cbp, color)
* Add combo to the end of the list.
*/
void
-appendcombo(cbp, color)
- struct combostr *cbp;
- int color __unused;
+appendcombo(struct combostr *cbp, int color __unused)
{
struct combostr *pcbp, *ncbp;
@@ -1079,12 +1060,8 @@ appendcombo(cbp, color)
* 's' is the combo value for frame 'fcpb'.
*/
int
-checkframes(cbp, fcbp, osp, s, vertices)
- struct combostr *cbp;
- struct combostr *fcbp;
- struct spotstr *osp;
- int s;
- struct ovlp_info *vertices;
+checkframes(struct combostr *cbp, struct combostr *fcbp, struct spotstr *osp,
+ int s, struct ovlp_info *vertices)
{
struct combostr *tcbp, *lcbp;
int i, n, mask, flg, verts, loop, myindex, fcnt;
@@ -1221,10 +1198,8 @@ checkframes(cbp, fcbp, osp, s, vertices)
* Otherwise, add the new combo to the hash list.
*/
int
-sortcombo(scbpp, cbpp, fcbp)
- struct combostr **scbpp;
- struct combostr **cbpp;
- struct combostr *fcbp;
+sortcombo(struct combostr **scbpp, struct combostr **cbpp,
+ struct combostr *fcbp)
{
struct combostr **spp, **cpp;
struct combostr *cbp, *ecbp;
@@ -1335,9 +1310,7 @@ inserted:
* Print the combo into string 'str'.
*/
void
-printcombo(cbp, str)
- struct combostr *cbp;
- char *str;
+printcombo(struct combostr *cbp, char *str)
{
struct combostr *tcbp;
@@ -1353,8 +1326,7 @@ printcombo(cbp, str)
#ifdef DEBUG
void
-markcombo(ocbp)
- struct combostr *ocbp;
+markcombo(struct combostr *ocbp)
{
struct combostr *cbp, *tcbp, **cbpp;
struct elist *ep, *nep, **epp;
@@ -1468,9 +1440,7 @@ markcombo(ocbp)
}
void
-clearcombo(cbp, open)
- struct combostr *cbp;
- int open;
+clearcombo(struct combostr *cbp, int open)
{
struct spotstr *sp;
struct combostr *tcbp;
@@ -1489,10 +1459,7 @@ clearcombo(cbp, open)
}
int
-list_eq(scbpp, cbpp, n)
- struct combostr **scbpp;
- struct combostr **cbpp;
- int n;
+list_eq(struct combostr **scbpp, struct combostr **cbpp, int n)
{
struct combostr **spp, **cpp;
diff --git a/gomoku/stoc.c b/gomoku/stoc.c
index 48430c83..5311fb22 100644
--- a/gomoku/stoc.c
+++ b/gomoku/stoc.c
@@ -1,4 +1,4 @@
-/* $NetBSD: stoc.c,v 1.9 2005/04/19 20:17:12 rillig Exp $ */
+/* $NetBSD: stoc.c,v 1.10 2009/06/04 05:27:04 dholland Exp $ */
/*
* Copyright (c) 1994
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)stoc.c 8.1 (Berkeley) 7/24/94";
#else
-__RCSID("$NetBSD: stoc.c,v 1.9 2005/04/19 20:17:12 rillig Exp $");
+__RCSID("$NetBSD: stoc.c,v 1.10 2009/06/04 05:27:04 dholland Exp $");
#endif
#endif /* not lint */
@@ -63,8 +63,7 @@ static const struct mvstr mv[] = {
* Turn the spot number form of a move into the character form.
*/
const char *
-stoc(s)
- int s;
+stoc(int s)
{
static char buf[32];
int i;
@@ -80,8 +79,7 @@ stoc(s)
* Turn the character form of a move into the spot number form.
*/
int
-ctos(mp)
- const char *mp;
+ctos(const char *mp)
{
int i;
@@ -100,8 +98,7 @@ ctos(mp)
* Turn a letter into a number.
*/
int
-lton(c)
- int c;
+lton(int c)
{
int i;