From 3936117409cf27503dff2c5d4d2ba20840a85873 Mon Sep 17 00:00:00 2001 From: lukem Date: Fri, 10 Oct 1997 13:36:01 +0000 Subject: WARNSify --- gomoku/main.c | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to 'gomoku/main.c') 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 #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 #include #include -#include #include #include #include @@ -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; { -- cgit v1.2.3-56-ge451