summaryrefslogtreecommitdiffstats
path: root/gomoku/main.c
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>1997-10-10 13:36:01 +0000
committerlukem <lukem@NetBSD.org>1997-10-10 13:36:01 +0000
commit3936117409cf27503dff2c5d4d2ba20840a85873 (patch)
tree36799758f37408f4211a1a72c734889dc0eac7fe /gomoku/main.c
parent34ef7ac7fd8bd4c426cd292ac4eb658d67867eab (diff)
downloadbsdgames-darwin-3936117409cf27503dff2c5d4d2ba20840a85873.tar.gz
bsdgames-darwin-3936117409cf27503dff2c5d4d2ba20840a85873.tar.zst
bsdgames-darwin-3936117409cf27503dff2c5d4d2ba20840a85873.zip
WARNSify
Diffstat (limited to 'gomoku/main.c')
-rw-r--r--gomoku/main.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/gomoku/main.c b/gomoku/main.c
index fc749944..9d56e26b 100644
--- a/gomoku/main.c
+++ b/gomoku/main.c
@@ -1,4 +1,4 @@
-/* $NetBSD: main.c,v 1.3 1997/01/03 01:35:28 cgd Exp $ */
+/* $NetBSD: main.c,v 1.4 1997/10/10 13:36:04 lukem Exp $ */
/*
* Copyright (c) 1994
@@ -36,24 +36,23 @@
* SUCH DAMAGE.
*/
+#include <sys/cdefs.h>
#ifndef lint
-static char copyright[] =
-"@(#) Copyright (c) 1994\n\
- The Regents of the University of California. All rights reserved.\n";
+__COPYRIGHT("@(#) Copyright (c) 1994\n\
+ The Regents of the University of California. All rights reserved.\n");
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 5/4/95";
#else
-static char rcsid[] = "$NetBSD: main.c,v 1.3 1997/01/03 01:35:28 cgd Exp $";
+__RCSID("$NetBSD: main.c,v 1.4 1997/10/10 13:36:04 lukem Exp $");
#endif
#endif /* not lint */
#include <curses.h>
#include <err.h>
#include <signal.h>
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@@ -83,11 +82,9 @@ int movelog[BSZ * BSZ]; /* log of all the moves */
int movenum; /* current move number */
char *plyr[2]; /* who's who */
-extern void quit();
-#ifdef DEBUG
-extern void whatsup();
-#endif
+int main __P((int, char *[]));
+int
main(argc, argv)
int argc;
char **argv;
@@ -100,13 +97,15 @@ main(argc, argv)
"%3d %-6s"
};
+ color = curmove = 0;
+
prog = strrchr(argv[0], '/');
if (prog)
prog++;
else
prog = argv[0];
- while ((ch = getopt(argc, argv, "bcdD:u")) != EOF) {
+ while ((ch = getopt(argc, argv, "bcdD:u")) != -1) {
switch (ch) {
case 'b': /* background */
interactive = 0;
@@ -150,7 +149,7 @@ again:
#ifdef DEBUG
signal(SIGINT, whatsup);
#else
- signal(SIGINT, quit);
+ signal(SIGINT, quitsig);
#endif
if (inputfp == NULL && test == 0) {
@@ -311,7 +310,7 @@ again:
replay:
ask("replay? ");
if (getline(buf, sizeof(buf)) &&
- buf[0] == 'y' || buf[0] == 'Y')
+ (buf[0] == 'y' || buf[0] == 'Y'))
goto again;
if (strcmp(buf, "save") == 0) {
FILE *fp;
@@ -331,8 +330,11 @@ again:
}
}
quit();
+ /* NOTREACHED */
+ return(0);
}
+int
readinput(fp)
FILE *fp;
{
@@ -492,6 +494,7 @@ syntax:
/*
* Display debug info.
*/
+void
dlog(str)
char *str;
{
@@ -504,6 +507,7 @@ dlog(str)
fprintf(stderr, "%s\n", str);
}
+void
log(str)
char *str;
{
@@ -526,9 +530,17 @@ quit()
exit(0);
}
+void
+quitsig(dummy)
+ int dummy;
+{
+ quit();
+}
+
/*
* Die gracefully.
*/
+void
panic(str)
char *str;
{