From 81fbdc5dca4ba4f9673c612f03fede15c8ad3f91 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Sat, 10 Jul 2004 07:26:25 +0000 Subject: more ansi; khalek@linuxgamers.net --- games/boggle/boggle/bog.c | 30 ++++++---------- games/boggle/boggle/help.c | 6 ++-- games/boggle/boggle/mach.c | 77 ++++++++++++++++-------------------------- games/boggle/boggle/prtable.c | 14 +++----- games/boggle/boggle/timer.c | 12 +++---- games/boggle/boggle/word.c | 21 ++++-------- games/boggle/mkdict/mkdict.c | 8 ++--- games/boggle/mkindex/mkindex.c | 13 +++---- 8 files changed, 66 insertions(+), 115 deletions(-) (limited to 'games/boggle') diff --git a/games/boggle/boggle/bog.c b/games/boggle/boggle/bog.c index e522f05e097..24ca7ff76c1 100644 --- a/games/boggle/boggle/bog.c +++ b/games/boggle/boggle/bog.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bog.c,v 1.13 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: bog.c,v 1.14 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: bog.c,v 1.5 1995/04/24 12:22:32 cgd Exp $ */ /*- @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)bog.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: bog.c,v 1.13 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: bog.c,v 1.14 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -121,9 +121,7 @@ int selfuse; int tlimit; int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch, done, i; char *bspec, *p, *seed; @@ -255,8 +253,7 @@ main(argc, argv) * Return a pointer to a legal word or a null pointer when EOF is reached */ char * -batchword(fp) - FILE *fp; +batchword(FILE *fp) { int *p, *q; char *w; @@ -284,7 +281,7 @@ batchword(fp) * Keep track of the running stats */ void -playgame() +playgame(void) { int i, *p, *q; time_t t; @@ -406,9 +403,7 @@ timesup: ; * Return 1 on success, -1 on failure */ int -checkword(word, prev, path) - char *word; - int prev, *path; +checkword(char *word, int prev, int *path) { char *p, *q; int i, *lm; @@ -489,8 +484,7 @@ checkword(word, prev, path) * the current board */ int -validword(word) - char *word; +validword(char *word) { int j; char *q, *w; @@ -524,7 +518,7 @@ validword(word) * Assume both the dictionary and the player's words are already sorted */ void -checkdict() +checkdict(void) { char *p, **pw, *w; int i; @@ -602,8 +596,7 @@ checkdict() * in ascending cube order, oth. make a random board */ void -newgame(b) - char *b; +newgame(char *b) { int i, p, q; char *tmp; @@ -672,14 +665,13 @@ newgame(b) } int -compar(p, q) - const void *p, *q; +compar(const void *p, const void *q) { return (strcmp(*(char **)p, *(char **)q)); } void -usage() +usage(void) { (void) fprintf(stderr, "usage: bog [-bd] [-s#] [-t#] [-w#] [+[+]] [boardspec]\n"); diff --git a/games/boggle/boggle/help.c b/games/boggle/boggle/help.c index 490496fd31a..9b11fc0d502 100644 --- a/games/boggle/boggle/help.c +++ b/games/boggle/boggle/help.c @@ -1,4 +1,4 @@ -/* $OpenBSD: help.c,v 1.3 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: help.c,v 1.4 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: help.c,v 1.2 1995/03/21 12:14:38 cgd Exp $ */ /*- @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)help.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: help.c,v 1.3 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: help.c,v 1.4 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -48,7 +48,7 @@ static char rcsid[] = "$OpenBSD: help.c,v 1.3 2003/06/03 03:01:39 millert Exp $" #include "extern.h" int -help() +help(void) { extern int nlines; int eof, i; diff --git a/games/boggle/boggle/mach.c b/games/boggle/boggle/mach.c index 6431fc6501a..dd4f59e75a8 100644 --- a/games/boggle/boggle/mach.c +++ b/games/boggle/boggle/mach.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mach.c,v 1.7 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: mach.c,v 1.8 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: mach.c,v 1.5 1995/04/28 22:28:48 mycroft Exp $ */ /*- @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)mach.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: mach.c,v 1.7 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: mach.c,v 1.8 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -83,8 +83,7 @@ static void winch_catcher(int); * This is called once, when the program starts */ int -setup(seed) - char *seed; +setup(char *seed) { if (tty_setup() < 0) return(-1); @@ -101,7 +100,7 @@ setup(seed) * This is called once, just before the program terminates */ void -cleanup() +cleanup(void) { tty_cleanup(); } @@ -111,7 +110,7 @@ cleanup() * stats */ void -results() +results(void) { int col, row; int denom1, denom2; @@ -141,17 +140,13 @@ results() } static void -prword(base, indx) - char *base[]; - int indx; +prword(char *base[], int indx) { printw("%s", base[indx]); } static int -prwidth(base, indx) - char *base[]; - int indx; +prwidth(char *base[], int indx) { return (strlen(base[indx])); } @@ -162,8 +157,7 @@ prwidth(base, indx) * - doesn't accept words longer than MAXWORDLEN or containing caps */ char * -getline(q) - char *q; +getline(char *q) { int ch, done; char *p; @@ -257,21 +251,20 @@ getline(q) } int -inputch() +inputch(void) { return (getch() & 0177); } void -redraw() +redraw(void) { clearok(stdscr, 1); refresh(); } void -flushin(fp) - FILE *fp; +flushin(FILE *fp) { (void) tcflush(fileno(fp), TCIFLUSH); @@ -283,7 +276,7 @@ static int gone; * Stop the game timer */ void -stoptime() +stoptime(void) { extern time_t start_t; time_t t; @@ -296,7 +289,7 @@ stoptime() * Restart the game timer */ void -starttime() +starttime(void) { extern time_t start_t; time_t t; @@ -313,7 +306,7 @@ starttime() * There is no check for exceeding COLS */ void -startwords() +startwords(void) { crow = LIST_LINE; ccol = LIST_COL; @@ -330,8 +323,7 @@ startwords() * to start the next column */ void -addword(w) - char *w; +addword(char *w) { int n; @@ -354,7 +346,7 @@ addword(w) * The current word is unacceptable so erase it */ void -badword() +badword(void) { move(crow, ccol); @@ -367,8 +359,7 @@ badword() * No check for wild arg */ void -showword(n) - int n; +showword(int n) { int col, row; @@ -396,7 +387,7 @@ showword(n) * Note: this function knows about the format of the board */ void -findword() +findword(void) { int c, col, found, i, r, row; char buf[MAXWORDLEN + 1]; @@ -471,9 +462,7 @@ findword() * Display a string at the current cursor position for the given number of secs */ void -showstr(str, delaysecs) - char *str; - int delaysecs; +showstr(char *str, int delaysecs) { addstr(str); refresh(); @@ -484,8 +473,7 @@ showstr(str, delaysecs) } void -putstr(s) - char *s; +putstr(char *s) { addstr(s); } @@ -494,8 +482,7 @@ putstr(s) * Get a valid word and put it in the buffer */ void -getword(q) - char *q; +getword(char *q) { int ch, col, done, i, row; char *p; @@ -552,15 +539,13 @@ getword(q) } void -showboard(b) - char *b; +showboard(char *b) { tty_showboard(b); } void -prompt(mesg) - char *mesg; +prompt(char *mesg) { move(PROMPT_LINE, PROMPT_COL); printw("%s", mesg); @@ -569,7 +554,7 @@ prompt(mesg) } static int -tty_setup() +tty_setup(void) { initscr(); raw(); @@ -590,8 +575,7 @@ tty_setup() } static void -stop_catcher(signo) - int signo; +stop_catcher(int signo) { sigset_t sigset, osigset; @@ -611,8 +595,7 @@ stop_catcher(signo) } static void -cont_catcher(signo) - int signo; +cont_catcher(int signo) { noecho(); raw(); @@ -627,8 +610,7 @@ cont_catcher(signo) * It would mean reformatting the entire display */ static void -winch_catcher(signo) - int signo; +winch_catcher(int signo) { struct winsize win; @@ -641,7 +623,7 @@ winch_catcher(signo) } static void -tty_cleanup() +tty_cleanup(void) { move(nlines - 1, 0); refresh(); @@ -651,8 +633,7 @@ tty_cleanup() } static void -tty_showboard(b) - char *b; +tty_showboard(char *b) { int i, line; diff --git a/games/boggle/boggle/prtable.c b/games/boggle/boggle/prtable.c index 15de656dcc3..a0bcd4279c4 100644 --- a/games/boggle/boggle/prtable.c +++ b/games/boggle/boggle/prtable.c @@ -1,4 +1,4 @@ -/* $OpenBSD: prtable.c,v 1.8 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: prtable.c,v 1.9 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: prtable.c,v 1.2 1995/03/21 12:14:42 cgd Exp $ */ /*- @@ -59,11 +59,8 @@ static int get_maxlen(char *[], int, int (*)(char **, int)); * an index */ void -prtable(base, num, d_cols, width, prentry, length) - char *base[]; - int num, d_cols, width; - void (*prentry)(char *[], int); - int (*length)(char *[], int); +prtable(char *base[], int num, int d_cols, int width, + void (*prentry)(char *[], int), int (*length)(char *[], int)) { int c, j; int a, b, cols, loc, maxlen, nrows, z; @@ -110,10 +107,7 @@ prtable(base, num, d_cols, width, prentry, length) } static int -get_maxlen(base, num, length) - char *base[]; - int num; - int (*length)(char **, int); +get_maxlen(char *base[], int num, int (*length)(char **, int)) { int i, len, max; diff --git a/games/boggle/boggle/timer.c b/games/boggle/boggle/timer.c index 4452ee73ca1..185ecec1cc3 100644 --- a/games/boggle/boggle/timer.c +++ b/games/boggle/boggle/timer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: timer.c,v 1.6 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: timer.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: timer.c,v 1.3 1995/04/24 12:22:45 cgd Exp $ */ /*- @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)timer.c 8.2 (Berkeley) 2/22/94"; #else -static char rcsid[] = "$OpenBSD: timer.c,v 1.6 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: timer.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -62,7 +62,7 @@ static int waitch(long); * Leave the cursor where it was initially */ int -timerch() +timerch(void) { extern int tlimit; extern time_t start_t; @@ -97,8 +97,7 @@ timerch() * Returns 1 if input is ready, 0 oth. */ static int -waitch(delay) - long delay; +waitch(long delay) { fd_set fdbits; struct timeval duration; @@ -111,8 +110,7 @@ waitch(delay) } void -delay(tenths) - int tenths; +delay(int tenths) { struct timeval duration; diff --git a/games/boggle/boggle/word.c b/games/boggle/boggle/word.c index 8762f415166..9ab9627dca8 100644 --- a/games/boggle/boggle/word.c +++ b/games/boggle/boggle/word.c @@ -1,4 +1,4 @@ -/* $OpenBSD: word.c,v 1.4 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: word.c,v 1.5 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: word.c,v 1.2 1995/03/21 12:14:45 cgd Exp $ */ /*- @@ -37,7 +37,7 @@ #if 0 static char sccsid[] = "@(#)word.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: word.c,v 1.4 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: word.c,v 1.5 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -62,8 +62,7 @@ static int first = 1, lastch = 0; * NULL on end-of-file */ char * -nextword(fp) - FILE *fp; +nextword(FILE *fp) { extern int wordlen; int ch, pcount; @@ -106,10 +105,7 @@ nextword(fp) * Reset the state of nextword() and do the fseek() */ long -dictseek(fp, offset, ptrname) - FILE *fp; - long offset; - int ptrname; +dictseek(FILE *fp, long offset, int ptrname) { if (fp == NULL) { if ((sp = dictspace + offset) >= dictend) @@ -122,8 +118,7 @@ dictseek(fp, offset, ptrname) } FILE * -opendict(dict) - char *dict; +opendict(char *dict) { FILE *fp; @@ -136,8 +131,7 @@ opendict(dict) * Load the given dictionary and initialize the pointers */ int -loaddict(fp) - FILE *fp; +loaddict(FILE *fp) { struct stat statb; long n; @@ -183,8 +177,7 @@ loaddict(fp) * is made for lines that are too long */ int -loadindex(indexfile) - char *indexfile; +loadindex(char *indexfile) { int i, j; char buf[BUFSIZ]; diff --git a/games/boggle/mkdict/mkdict.c b/games/boggle/mkdict/mkdict.c index ed42b53dd23..d3e2a9c94e2 100644 --- a/games/boggle/mkdict/mkdict.c +++ b/games/boggle/mkdict/mkdict.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkdict.c,v 1.5 2003/06/03 03:01:39 millert Exp $ */ +/* $OpenBSD: mkdict.c,v 1.6 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: mkdict.c,v 1.2 1995/03/21 12:14:49 cgd Exp $ */ /*- @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mkdict.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: mkdict.c,v 1.5 2003/06/03 03:01:39 millert Exp $"; +static char rcsid[] = "$OpenBSD: mkdict.c,v 1.6 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -64,9 +64,7 @@ static char rcsid[] = "$OpenBSD: mkdict.c,v 1.5 2003/06/03 03:01:39 millert Exp #include "bog.h" int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { char *p, *q; int ch, common, n, nwords; diff --git a/games/boggle/mkindex/mkindex.c b/games/boggle/mkindex/mkindex.c index f88a6faa5d6..bc1c66819a6 100644 --- a/games/boggle/mkindex/mkindex.c +++ b/games/boggle/mkindex/mkindex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mkindex.c,v 1.6 2003/07/10 00:03:01 david Exp $ */ +/* $OpenBSD: mkindex.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $ */ /* $NetBSD: mkindex.c,v 1.2 1995/03/21 12:14:52 cgd Exp $ */ /*- @@ -43,7 +43,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)mkindex.c 8.1 (Berkeley) 6/11/93"; #else -static char rcsid[] = "$OpenBSD: mkindex.c,v 1.6 2003/07/10 00:03:01 david Exp $"; +static char rcsid[] = "$OpenBSD: mkindex.c,v 1.7 2004/07/10 07:26:22 deraadt Exp $"; #endif #endif /* not lint */ @@ -55,9 +55,7 @@ static char rcsid[] = "$OpenBSD: mkindex.c,v 1.6 2003/07/10 00:03:01 david Exp $ char *nextword(FILE *, char *, int *, int *); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int clen, rlen, prev; long off, start; @@ -85,10 +83,7 @@ main(argc, argv) * rlen to the strlen() of the real word */ char * -nextword(fp, buffer, clen, rlen) - FILE *fp; - char *buffer; - int *clen, *rlen; +nextword(FILE *fp, char *buffer, int *clen, int *rlen) { int ch, pcount; char *p, *q; -- cgit v1.2.3