Module Name: src Committed By: dholland Date: Sat Jul 4 01:58:57 UTC 2009
Modified Files: src/games/hunt/hunt: connect.c hunt.c otto.c playit.c Log Message: ANSIfy function declarations. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/games/hunt/hunt/connect.c cvs rdiff -u -r1.30 -r1.31 src/games/hunt/hunt/hunt.c cvs rdiff -u -r1.11 -r1.12 src/games/hunt/hunt/otto.c cvs rdiff -u -r1.10 -r1.11 src/games/hunt/hunt/playit.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/hunt/hunt/connect.c diff -u src/games/hunt/hunt/connect.c:1.6 src/games/hunt/hunt/connect.c:1.7 --- src/games/hunt/hunt/connect.c:1.6 Sat Jul 4 01:23:55 2009 +++ src/games/hunt/hunt/connect.c Sat Jul 4 01:58:57 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: connect.c,v 1.6 2009/07/04 01:23:55 dholland Exp $ */ +/* $NetBSD: connect.c,v 1.7 2009/07/04 01:58:57 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: connect.c,v 1.6 2009/07/04 01:23:55 dholland Exp $"); +__RCSID("$NetBSD: connect.c,v 1.7 2009/07/04 01:58:57 dholland Exp $"); #endif /* not lint */ # include "hunt.h" @@ -40,10 +40,7 @@ # include <unistd.h> void -do_connect(name, team, enter_status) - char *name; - char team; - long enter_status; +do_connect(char *name, char team, long enter_status) { static int32_t uid; static int32_t mode; Index: src/games/hunt/hunt/hunt.c diff -u src/games/hunt/hunt/hunt.c:1.30 src/games/hunt/hunt/hunt.c:1.31 --- src/games/hunt/hunt/hunt.c:1.30 Sat Jul 4 01:44:28 2009 +++ src/games/hunt/hunt/hunt.c Sat Jul 4 01:58:57 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: hunt.c,v 1.30 2009/07/04 01:44:28 dholland Exp $ */ +/* $NetBSD: hunt.c,v 1.31 2009/07/04 01:58:57 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: hunt.c,v 1.30 2009/07/04 01:44:28 dholland Exp $"); +__RCSID("$NetBSD: hunt.c,v 1.31 2009/07/04 01:58:57 dholland Exp $"); #endif /* not lint */ # include <sys/param.h> @@ -125,9 +125,7 @@ * Main program for local process */ int -main(ac, av) - int ac; - char **av; +main(int ac, char **av) { char *term; int c; @@ -373,9 +371,7 @@ # ifdef INTERNET # ifdef BROADCAST int -broadcast_vec(s, vector) - int s; /* socket */ - struct sockaddr **vector; +broadcast_vec(int s /*socket*/, struct sockaddr **vector) { int vec_cnt; struct ifaddrs *ifp, *ip; @@ -406,7 +402,7 @@ # endif SOCKET * -list_drivers() +list_drivers(void) { int option; u_short msg; @@ -572,8 +568,7 @@ } void -find_driver(do_startup) - FLAG do_startup; +find_driver(FLAG do_startup) { SOCKET *hosts; @@ -641,8 +636,7 @@ } void -dump_scores(host) - SOCKET host; +dump_scores(SOCKET host) { struct hostent *hp; int s; @@ -667,7 +661,7 @@ # endif void -start_driver() +start_driver(void) { int procid; @@ -731,7 +725,7 @@ * means the game is full. */ void -bad_con() +bad_con(void) { leavex(1, "The game is full. Sorry."); /* NOTREACHED */ @@ -742,7 +736,7 @@ * version number mismatch. */ void -bad_ver() +bad_ver(void) { leavex(1, "Version number mismatch. No go."); /* NOTREACHED */ @@ -753,8 +747,7 @@ * Handle a terminate signal */ SIGNAL_TYPE -sigterm(dummy) - int dummy __unused; +sigterm(int dummy __unused) { leavex(0, NULL); /* NOTREACHED */ @@ -766,8 +759,7 @@ * Handle a usr1 signal */ SIGNAL_TYPE -sigusr1(dummy) - int dummy __unused; +sigusr1(int dummy __unused) { leavex(1, "Unable to start driver. Try again."); /* NOTREACHED */ @@ -779,8 +771,7 @@ * Handle an alarm signal */ SIGNAL_TYPE -sigalrm(dummy) - int dummy __unused; +sigalrm(int dummy __unused) { return; } @@ -791,8 +782,7 @@ * Remove a '\n' at the end of a string if there is one */ void -rmnl(s) - char *s; +rmnl(char *s) { char *cp; @@ -806,8 +796,7 @@ * Handle a interrupt signal */ SIGNAL_TYPE -intr(dummy) - int dummy __unused; +intr(int dummy __unused) { int ch; int explained; @@ -861,7 +850,8 @@ } } -void fincurs() +void +fincurs(void) { if (in_visual) { # ifdef USE_CURSES @@ -914,8 +904,7 @@ * Handle stop and start signals */ SIGNAL_TYPE -tstp(dummy) - int dummy; +tstp(int dummy __unused) { # if BSD_RELEASE < 44 static struct sgttyb tty; @@ -958,8 +947,7 @@ # if defined(BSD_RELEASE) && BSD_RELEASE < 43 char * -strpbrk(s, brk) - char *s, *brk; +strpbrk(char *s, char *brk) { char *p; c; @@ -975,8 +963,7 @@ # endif long -env_init(enter_status) - long enter_status; +env_init(long enter_status) { int i; char *envp, *envname, *s; @@ -1085,7 +1072,7 @@ } void -fill_in_blanks() +fill_in_blanks(void) { int i; char *cp; Index: src/games/hunt/hunt/otto.c diff -u src/games/hunt/hunt/otto.c:1.11 src/games/hunt/hunt/otto.c:1.12 --- src/games/hunt/hunt/otto.c:1.11 Sat Dec 15 19:44:41 2007 +++ src/games/hunt/hunt/otto.c Sat Jul 4 01:58:57 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: otto.c,v 1.11 2007/12/15 19:44:41 perry Exp $ */ +/* $NetBSD: otto.c,v 1.12 2009/07/04 01:58:57 dholland Exp $ */ # ifdef OTTO /* * Copyright (c) 1983-2003, Regents of the University of California. @@ -45,7 +45,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: otto.c,v 1.11 2007/12/15 19:44:41 perry Exp $"); +__RCSID("$NetBSD: otto.c,v 1.12 2009/07/04 01:58:57 dholland Exp $"); #endif /* not lint */ # include <sys/time.h> @@ -155,15 +155,12 @@ extern int Otto_count; STATIC SIGNAL_TYPE -nothing(dummy) - int dummy __unused; +nothing(int dummy __unused) { } void -otto(y, x, face) - int y, x; - char face; +otto(int y, int x, char face) { int i; int old_mask; @@ -232,11 +229,7 @@ # define direction(abs,rel) (((abs) + (rel)) % NUMDIRECTIONS) STATIC int -stop_look(itemp, c, dist, side) - struct item *itemp; - char c; - int dist; - int side; +stop_look(struct item *itemp, char c, int dist, int side) { switch (c) { @@ -307,9 +300,7 @@ } STATIC void -ottolook(rel_dir, itemp) - int rel_dir; - struct item *itemp; +ottolook(int rel_dir, struct item *itemp) { int r, c; char ch; @@ -409,7 +400,7 @@ } STATIC void -look_around() +look_around(void) { int i; @@ -427,8 +418,7 @@ */ STATIC void -face_and_move_direction(rel_dir, distance) - int rel_dir, distance; +face_and_move_direction(int rel_dir, int distance) { int old_facing; char cmd; @@ -464,9 +454,7 @@ } STATIC void -attack(rel_dir, itemp) - int rel_dir; - struct item *itemp; +attack(int rel_dir, struct item *itemp) { if (!(itemp->flags & ON_SIDE)) { face_and_move_direction(rel_dir, 0); @@ -492,8 +480,7 @@ } STATIC void -duck(rel_dir) - int rel_dir; +duck(int rel_dir) { int dir; @@ -542,8 +529,7 @@ */ STATIC int -go_for_ammo(mine) - char mine; +go_for_ammo(char mine) { int i, rel_dir, dist; @@ -569,7 +555,7 @@ } STATIC void -wander() +wander(void) { int i, j, rel_dir, dir_mask, dir_count; Index: src/games/hunt/hunt/playit.c diff -u src/games/hunt/hunt/playit.c:1.10 src/games/hunt/hunt/playit.c:1.11 --- src/games/hunt/hunt/playit.c:1.10 Sat Jul 4 01:23:55 2009 +++ src/games/hunt/hunt/playit.c Sat Jul 4 01:58:57 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: playit.c,v 1.10 2009/07/04 01:23:55 dholland Exp $ */ +/* $NetBSD: playit.c,v 1.11 2009/07/04 01:58:57 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: playit.c,v 1.10 2009/07/04 01:23:55 dholland Exp $"); +__RCSID("$NetBSD: playit.c,v 1.11 2009/07/04 01:58:57 dholland Exp $"); #endif /* not lint */ # include <sys/file.h> @@ -103,7 +103,7 @@ * the driver. */ void -playit() +playit(void) { int ch; int y, x; @@ -241,7 +241,7 @@ * no characters in the input buffer. */ static unsigned char -getchr() +getchr(void) { struct pollfd set[2]; int nfds; @@ -278,7 +278,7 @@ * Send standard input characters to the driver */ static void -send_stuff() +send_stuff(void) { int count; char *sp, *nsp; @@ -321,8 +321,7 @@ * Handle the end of the game when the player dies */ int -quit(old_status) - int old_status; +quit(int old_status) { int explain, ch; @@ -499,8 +498,7 @@ # ifndef USE_CURSES void -put_ch(ch) - char ch; +put_ch(char ch) { if (!isprint(ch)) { fprintf(stderr, "r,c,ch: %d,%d,%d", cur_row, cur_col, ch); @@ -518,8 +516,7 @@ } void -put_str(s) - char *s; +put_str(char *s) { while (*s) put_ch(*s++); @@ -527,7 +524,7 @@ # endif void -clear_the_screen() +clear_the_screen(void) { # ifdef USE_CURSES clear(); @@ -563,7 +560,7 @@ #ifndef USE_CURSES void -clear_eol() +clear_eol(void) { if (CE != NULL) #if !defined(BSD_RELEASE) || BSD_RELEASE < 44 @@ -585,7 +582,7 @@ # endif void -redraw_screen() +redraw_screen(void) { # ifdef USE_CURSES clearok(stdscr, TRUE); @@ -640,7 +637,7 @@ * Send a message to the driver and return */ void -do_message() +do_message(void) { u_int32_t version;