From 6f8367e238e03f94d7cad37b751809e6c86c5fd0 Mon Sep 17 00:00:00 2001 From: dholland Date: Sat, 4 Jul 2009 01:58:57 +0000 Subject: ANSIfy function declarations. --- hunt/hunt/connect.c | 9 +++---- hunt/hunt/hunt.c | 55 ++++++++++++++++------------------------ hunt/hunt/otto.c | 38 +++++++++------------------- hunt/hunt/playit.c | 27 +++++++++----------- hunt/huntd/answer.c | 21 ++++++---------- hunt/huntd/ctl.c | 6 ++--- hunt/huntd/ctl_transact.c | 10 +++----- hunt/huntd/draw.c | 39 +++++++++-------------------- hunt/huntd/driver.c | 38 ++++++++++------------------ hunt/huntd/execute.c | 60 +++++++++++--------------------------------- hunt/huntd/expl.c | 15 +++++------ hunt/huntd/faketalk.c | 14 +++++------ hunt/huntd/get_names.c | 10 +++----- hunt/huntd/makemaze.c | 17 ++++++------- hunt/huntd/shots.c | 64 +++++++++++++++-------------------------------- hunt/huntd/terminal.c | 26 ++++++------------- 16 files changed, 152 insertions(+), 297 deletions(-) (limited to 'hunt') diff --git a/hunt/hunt/connect.c b/hunt/hunt/connect.c index faead11b..b922f18d 100644 --- a/hunt/hunt/connect.c +++ b/hunt/hunt/connect.c @@ -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 #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 @@ __RCSID("$NetBSD: connect.c,v 1.6 2009/07/04 01:23:55 dholland Exp $"); # include 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; diff --git a/hunt/hunt/hunt.c b/hunt/hunt/hunt.c index 4a887795..d343c5ab 100644 --- a/hunt/hunt/hunt.c +++ b/hunt/hunt/hunt.c @@ -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 #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 @@ -125,9 +125,7 @@ extern int Otto_mode; * 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 @@ main(ac, av) # 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 @@ broadcast_vec(s, vector) # endif SOCKET * -list_drivers() +list_drivers(void) { int option; u_short msg; @@ -572,8 +568,7 @@ test_one_host: } void -find_driver(do_startup) - FLAG do_startup; +find_driver(FLAG do_startup) { SOCKET *hosts; @@ -641,8 +636,7 @@ find_driver(do_startup) } void -dump_scores(host) - SOCKET host; +dump_scores(SOCKET host) { struct hostent *hp; int s; @@ -667,7 +661,7 @@ dump_scores(host) # endif void -start_driver() +start_driver(void) { int procid; @@ -731,7 +725,7 @@ start_driver() * means the game is full. */ void -bad_con() +bad_con(void) { leavex(1, "The game is full. Sorry."); /* NOTREACHED */ @@ -742,7 +736,7 @@ bad_con() * version number mismatch. */ void -bad_ver() +bad_ver(void) { leavex(1, "Version number mismatch. No go."); /* NOTREACHED */ @@ -753,8 +747,7 @@ bad_ver() * Handle a terminate signal */ SIGNAL_TYPE -sigterm(dummy) - int dummy __unused; +sigterm(int dummy __unused) { leavex(0, NULL); /* NOTREACHED */ @@ -766,8 +759,7 @@ sigterm(dummy) * 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 @@ sigusr1(dummy) * Handle an alarm signal */ SIGNAL_TYPE -sigalrm(dummy) - int dummy __unused; +sigalrm(int dummy __unused) { return; } @@ -791,8 +782,7 @@ sigalrm(dummy) * 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 @@ rmnl(s) * Handle a interrupt signal */ SIGNAL_TYPE -intr(dummy) - int dummy __unused; +intr(int dummy __unused) { int ch; int explained; @@ -861,7 +850,8 @@ intr(dummy) } } -void fincurs() +void +fincurs(void) { if (in_visual) { # ifdef USE_CURSES @@ -914,8 +904,7 @@ leavex(int eval, const char *mesg) * 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 @@ tstp(dummy) # 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 @@ strpbrk(s, brk) # endif long -env_init(enter_status) - long enter_status; +env_init(long enter_status) { int i; char *envp, *envname, *s; @@ -1085,7 +1072,7 @@ env_init(enter_status) } void -fill_in_blanks() +fill_in_blanks(void) { int i; char *cp; diff --git a/hunt/hunt/otto.c b/hunt/hunt/otto.c index e83d7c86..7eb9d49b 100644 --- a/hunt/hunt/otto.c +++ b/hunt/hunt/otto.c @@ -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 #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 @@ -155,15 +155,12 @@ STATIC void wander(void); 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 @@ done: # 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 @@ stop_look(itemp, c, dist, side) } 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 @@ ottolook(rel_dir, itemp) } STATIC void -look_around() +look_around(void) { int i; @@ -427,8 +418,7 @@ look_around() */ 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 @@ face_and_move_direction(rel_dir, distance) } 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 @@ attack(rel_dir, itemp) } STATIC void -duck(rel_dir) - int rel_dir; +duck(int rel_dir) { int dir; @@ -542,8 +529,7 @@ duck(rel_dir) */ STATIC int -go_for_ammo(mine) - char mine; +go_for_ammo(char mine) { int i, rel_dir, dist; @@ -569,7 +555,7 @@ go_for_ammo(mine) } STATIC void -wander() +wander(void) { int i, j, rel_dir, dir_mask, dir_count; diff --git a/hunt/hunt/playit.c b/hunt/hunt/playit.c index 7583e334..6ab174a2 100644 --- a/hunt/hunt/playit.c +++ b/hunt/hunt/playit.c @@ -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 #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 @@ -103,7 +103,7 @@ static void send_stuff(void); * the driver. */ void -playit() +playit(void) { int ch; int y, x; @@ -241,7 +241,7 @@ out: * no characters in the input buffer. */ static unsigned char -getchr() +getchr(void) { struct pollfd set[2]; int nfds; @@ -278,7 +278,7 @@ one_more_time: * Send standard input characters to the driver */ static void -send_stuff() +send_stuff(void) { int count; char *sp, *nsp; @@ -321,8 +321,7 @@ send_stuff() * 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 @@ get_message: # 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 @@ put_ch(ch) } void -put_str(s) - char *s; +put_str(char *s) { while (*s) put_ch(*s++); @@ -527,7 +524,7 @@ put_str(s) # endif void -clear_the_screen() +clear_the_screen(void) { # ifdef USE_CURSES clear(); @@ -563,7 +560,7 @@ clear_the_screen() #ifndef USE_CURSES void -clear_eol() +clear_eol(void) { if (CE != NULL) #if !defined(BSD_RELEASE) || BSD_RELEASE < 44 @@ -585,7 +582,7 @@ clear_eol() # endif void -redraw_screen() +redraw_screen(void) { # ifdef USE_CURSES clearok(stdscr, TRUE); @@ -640,7 +637,7 @@ redraw_screen() * Send a message to the driver and return */ void -do_message() +do_message(void) { u_int32_t version; diff --git a/hunt/huntd/answer.c b/hunt/huntd/answer.c index c7c45767..df355151 100644 --- a/hunt/huntd/answer.c +++ b/hunt/huntd/answer.c @@ -1,4 +1,4 @@ -/* $NetBSD: answer.c,v 1.12 2009/07/04 01:01:18 dholland Exp $ */ +/* $NetBSD: answer.c,v 1.13 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: answer.c,v 1.12 2009/07/04 01:01:18 dholland Exp $"); +__RCSID("$NetBSD: answer.c,v 1.13 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ # include @@ -47,7 +47,7 @@ __RCSID("$NetBSD: answer.c,v 1.12 2009/07/04 01:01:18 dholland Exp $"); static char Ttyname[NAMELEN]; int -answer() +answer(void) { PLAYER *pp; int newsock; @@ -204,8 +204,7 @@ answer() # ifdef MONITOR void -stmonitor(pp) - PLAYER *pp; +stmonitor(PLAYER *pp) { int line; PLAYER *npp; @@ -234,9 +233,7 @@ stmonitor(pp) # endif void -stplayer(newpp, enter_status) - PLAYER *newpp; - int enter_status; +stplayer(PLAYER *newpp, int enter_status) { int x, y; PLAYER *pp; @@ -363,7 +360,7 @@ stplayer(newpp, enter_status) * Return a random direction */ int -rand_dir() +rand_dir(void) { switch (rand_num(4)) { case 0: @@ -384,11 +381,7 @@ rand_dir() * Get the score structure of a player */ IDENT * -get_ident(machine, uid, name, team) - uint32_t machine; - uint32_t uid; - char *name; - char team; +get_ident(uint32_t machine, uint32_t uid, char *name, char team) { IDENT *ip; static IDENT punt; diff --git a/hunt/huntd/ctl.c b/hunt/huntd/ctl.c index 74fa1bc3..9e44eda3 100644 --- a/hunt/huntd/ctl.c +++ b/hunt/huntd/ctl.c @@ -1,4 +1,4 @@ -/* $NetBSD: ctl.c,v 1.3 2003/06/11 12:00:22 wiz Exp $ */ +/* $NetBSD: ctl.c,v 1.4 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)ctl.c 5.2 (Berkeley) 3/13/86"; #else -__RCSID("$NetBSD: ctl.c,v 1.3 2003/06/11 12:00:22 wiz Exp $"); +__RCSID("$NetBSD: ctl.c,v 1.4 2009/07/04 02:37:20 dholland Exp $"); #endif #endif /* not lint */ @@ -67,7 +67,7 @@ CTL_MSG msg; /* open the ctl socket */ void -open_ctl() +open_ctl(void) { int length; diff --git a/hunt/huntd/ctl_transact.c b/hunt/huntd/ctl_transact.c index 3e905923..9c3c1954 100644 --- a/hunt/huntd/ctl_transact.c +++ b/hunt/huntd/ctl_transact.c @@ -1,4 +1,4 @@ -/* $NetBSD: ctl_transact.c,v 1.7 2009/07/04 01:01:18 dholland Exp $ */ +/* $NetBSD: ctl_transact.c,v 1.8 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -39,7 +39,7 @@ #if 0 static char sccsid[] = "@(#)ctl_transact.c 5.2 (Berkeley) 3/13/86"; #else -__RCSID("$NetBSD: ctl_transact.c,v 1.7 2009/07/04 01:01:18 dholland Exp $"); +__RCSID("$NetBSD: ctl_transact.c,v 1.8 2009/07/04 02:37:20 dholland Exp $"); #endif #endif /* not lint */ @@ -57,11 +57,7 @@ __RCSID("$NetBSD: ctl_transact.c,v 1.7 2009/07/04 01:01:18 dholland Exp $"); * of time */ void -ctl_transact(target, msg, type, rp) - struct in_addr target; - CTL_MSG msg; - int type; - CTL_RESPONSE *rp; +ctl_transact(struct in_addr target, CTL_MSG msg, int type, CTL_RESPONSE *rp) { struct pollfd set[1]; int nready, cc, retries; diff --git a/hunt/huntd/draw.c b/hunt/huntd/draw.c index 3c2405e0..2d63274d 100644 --- a/hunt/huntd/draw.c +++ b/hunt/huntd/draw.c @@ -1,4 +1,4 @@ -/* $NetBSD: draw.c,v 1.5 2009/06/28 21:12:35 dholland Exp $ */ +/* $NetBSD: draw.c,v 1.6 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,14 +32,13 @@ #include #ifndef lint -__RCSID("$NetBSD: draw.c,v 1.5 2009/06/28 21:12:35 dholland Exp $"); +__RCSID("$NetBSD: draw.c,v 1.6 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ # include "hunt.h" void -drawmaze(pp) - PLAYER *pp; +drawmaze(PLAYER *pp) { int x; char *sp; @@ -71,8 +70,7 @@ drawmaze(pp) * size is 80x24 with the maze being 64x24) */ void -drawstatus(pp) - PLAYER *pp; +drawstatus(PLAYER *pp) { int i; PLAYER *np; @@ -125,8 +123,7 @@ drawstatus(pp) } void -look(pp) - PLAYER *pp; +look(PLAYER *pp) { int x, y; @@ -173,9 +170,7 @@ look(pp) } void -see(pp, face) - PLAYER *pp; - int face; +see(PLAYER *pp, int face) { char *sp; int y, x, i, cnt; @@ -260,9 +255,7 @@ see(pp, face) } void -check(pp, y, x) - PLAYER *pp; - int y, x; +check(PLAYER *pp, int y, int x) { int indx; int ch; @@ -288,8 +281,7 @@ check(pp, y, x) * Update the status of players */ void -showstat(pp) - PLAYER *pp; +showstat(PLAYER *pp) { PLAYER *np; int y; @@ -315,9 +307,7 @@ showstat(pp) * unless he is cloaked. */ void -drawplayer(pp, draw) - PLAYER *pp; - FLAG draw; +drawplayer(PLAYER *pp, FLAG draw) { PLAYER *newp; int x, y; @@ -353,9 +343,7 @@ drawplayer(pp, draw) } void -message(pp, s) - PLAYER *pp; - const char *s; +message(PLAYER *pp, const char *s) { cgoto(pp, HEIGHT, 0); outstr(pp, s, strlen(s)); @@ -368,8 +356,7 @@ message(pp, s) * looking at the current player. */ char -translate(ch) - char ch; +translate(char ch) { switch (ch) { case LEFTS: @@ -389,9 +376,7 @@ translate(ch) * Return the player symbol */ int -player_sym(pp, y, x) - PLAYER *pp; - int y, x; +player_sym(PLAYER *pp, int y, int x) { PLAYER *npp; diff --git a/hunt/huntd/driver.c b/hunt/huntd/driver.c index 5fcc9b20..d06c22dc 100644 --- a/hunt/huntd/driver.c +++ b/hunt/huntd/driver.c @@ -1,4 +1,4 @@ -/* $NetBSD: driver.c,v 1.15 2009/07/04 01:01:18 dholland Exp $ */ +/* $NetBSD: driver.c,v 1.16 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: driver.c,v 1.15 2009/07/04 01:01:18 dholland Exp $"); +__RCSID("$NetBSD: driver.c,v 1.16 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ # include @@ -82,9 +82,7 @@ static void zap(PLAYER *, FLAG, int); * The main program. */ int -main(ac, av, ep) - int ac; - char **av, **ep; +main(int ac, char **av, char **ep) { PLAYER *pp; # ifdef INTERNET @@ -255,7 +253,7 @@ again: * Initialize the global parameters. */ static void -init() +init(void) { int i; # ifdef INTERNET @@ -443,7 +441,7 @@ init() * Put the boots in the maze */ static void -makeboots() +makeboots(void) { int x, y; PLAYER *pp; @@ -464,11 +462,8 @@ makeboots() * Check the damage to the given player, and see if s/he is killed */ void -checkdam(ouch, gotcha, credit, amt, this_shot_type) - PLAYER *ouch, *gotcha; - IDENT *credit; - int amt; - char this_shot_type; +checkdam(PLAYER *ouch, PLAYER *gotcha, IDENT *credit, int amt, + char this_shot_type) { const char *cp; @@ -602,10 +597,7 @@ checkdam(ouch, gotcha, credit, amt, this_shot_type) * Kill off a player and take him out of the game. */ static void -zap(pp, was_player, i) - PLAYER *pp; - FLAG was_player; - int i; +zap(PLAYER *pp, FLAG was_player, int i) { int n, len; BULLET *bp; @@ -824,8 +816,7 @@ zap(pp, was_player, i) * Return a random number in a given range. */ int -rand_num(range) - int range; +rand_num(int range) { return (range == 0 ? 0 : RN % range); } @@ -837,9 +828,7 @@ rand_num(range) * FALSE. */ static int -havechar(pp, i) - PLAYER *pp; - int i; +havechar(PLAYER *pp, int i) { if (pp->p_ncount < pp->p_nchar) @@ -863,8 +852,7 @@ check_again: * Exit with the given value, cleaning up any droppings lying around */ SIGNAL_TYPE -cleanup(eval) - int eval; +cleanup(int eval) { PLAYER *pp; @@ -895,7 +883,7 @@ cleanup(eval) * Print stats to requestor */ static void -send_stats() +send_stats(void) { IDENT *ip; FILE *fp; @@ -971,7 +959,7 @@ send_stats() * Clear out the scores so the next session start clean */ static void -clear_scores() +clear_scores(void) { IDENT *ip, *nextip; diff --git a/hunt/huntd/execute.c b/hunt/huntd/execute.c index dd887670..2e524e5c 100644 --- a/hunt/huntd/execute.c +++ b/hunt/huntd/execute.c @@ -1,4 +1,4 @@ -/* $NetBSD: execute.c,v 1.7 2009/07/04 01:01:18 dholland Exp $ */ +/* $NetBSD: execute.c,v 1.8 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: execute.c,v 1.7 2009/07/04 01:01:18 dholland Exp $"); +__RCSID("$NetBSD: execute.c,v 1.8 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ # include @@ -53,8 +53,7 @@ static void scan(PLAYER *); * Execute a single monitor command */ void -mon_execute(pp) - PLAYER *pp; +mon_execute(PLAYER *pp) { char ch; @@ -75,8 +74,7 @@ mon_execute(pp) * Execute a single command */ void -execute(pp) - PLAYER *pp; +execute(PLAYER *pp) { char ch; @@ -192,9 +190,7 @@ execute(pp) * Execute a move in the given direction */ static void -move_player(pp, dir) - PLAYER *pp; - int dir; +move_player(PLAYER *pp, int dir) { PLAYER *newp; int x, y; @@ -328,9 +324,7 @@ move_player(pp, dir) * Change the direction the player is facing */ static void -turn_player(pp, dir) - PLAYER *pp; - int dir; +turn_player(PLAYER *pp, int dir) { if (pp->p_face != dir) { pp->p_face = dir; @@ -343,9 +337,7 @@ turn_player(pp, dir) * Fire a shot of the given type in the given direction */ static void -fire(pp, req_index) - PLAYER *pp; - int req_index; +fire(PLAYER *pp, int req_index) { if (pp == NULL) return; @@ -392,9 +384,7 @@ fire(pp, req_index) * Fire a slime shot in the given direction */ static void -fire_slime(pp, req_index) - PLAYER *pp; - int req_index; +fire_slime(PLAYER *pp, int req_index) { if (pp == NULL) return; @@ -441,14 +431,8 @@ fire_slime(pp, req_index) * Create a shot with the given properties */ void -add_shot(type, y, x, face, charge, owner, expl, over) -int type; -int y, x; -char face; -int charge; -PLAYER *owner; -int expl; -char over; +add_shot(int type, int y, int x, char face, int charge, + PLAYER *owner, int expl, char over) { BULLET *bp; int size; @@ -483,16 +467,8 @@ char over; } BULLET * -create_shot(type, y, x, face, charge, size, owner, score, expl, over) - int type; - int y, x; - char face; - int charge; - int size; - PLAYER *owner; - IDENT *score; - int expl; - char over; +create_shot(int type, int y, int x, char face, int charge, + int size, PLAYER *owner, IDENT *score, int expl, char over) { BULLET *bp; @@ -523,8 +499,7 @@ create_shot(type, y, x, face, charge, size, owner, score, expl, over) * Turn on or increase length of a cloak */ static void -cloak(pp) - PLAYER *pp; +cloak(PLAYER *pp) { if (pp->p_ammo <= 0) { message(pp, "No more charges"); @@ -553,8 +528,7 @@ cloak(pp) * Turn on or increase length of a scan */ static void -scan(pp) - PLAYER *pp; +scan(PLAYER *pp) { if (pp->p_ammo <= 0) { message(pp, "No more charges"); @@ -577,11 +551,7 @@ scan(pp) * check whether the object blew up or whether he picked it up */ void -pickup(pp, y, x, prob, obj) - PLAYER *pp; - int y, x; - int prob; - int obj; +pickup(PLAYER *pp, int y, int x, int prob, int obj) { int req; diff --git a/hunt/huntd/expl.c b/hunt/huntd/expl.c index ff2c7463..659d3507 100644 --- a/hunt/huntd/expl.c +++ b/hunt/huntd/expl.c @@ -1,4 +1,4 @@ -/* $NetBSD: expl.c,v 1.5 2009/07/04 01:01:18 dholland Exp $ */ +/* $NetBSD: expl.c,v 1.6 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: expl.c,v 1.5 2009/07/04 01:01:18 dholland Exp $"); +__RCSID("$NetBSD: expl.c,v 1.6 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ # include @@ -46,9 +46,7 @@ static void remove_wall(int, int); * Show the explosions as they currently are */ void -showexpl(y, x, type) - int y, x; - char type; +showexpl(int y, int x, char type) { PLAYER *pp; EXPL *ep; @@ -106,7 +104,7 @@ showexpl(y, x, type) * top */ void -rollexpl() +rollexpl(void) { EXPL *ep; PLAYER *pp; @@ -152,8 +150,7 @@ static REGEN *rem_index = removed; * the location currently pointed at. */ static void -remove_wall(y, x) - int y, x; +remove_wall(int y, int x) { REGEN *r; # if defined(MONITOR) || defined(FLY) @@ -240,7 +237,7 @@ found: * Clear out the walls array */ void -clearwalls() +clearwalls(void) { REGEN *rp; diff --git a/hunt/huntd/faketalk.c b/hunt/huntd/faketalk.c index 54e125bb..72ed4dcd 100644 --- a/hunt/huntd/faketalk.c +++ b/hunt/huntd/faketalk.c @@ -1,4 +1,4 @@ -/* $NetBSD: faketalk.c,v 1.13 2009/07/04 01:01:18 dholland Exp $ */ +/* $NetBSD: faketalk.c,v 1.14 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: faketalk.c,v 1.13 2009/07/04 01:01:18 dholland Exp $"); +__RCSID("$NetBSD: faketalk.c,v 1.14 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ #include "bsd.h" @@ -73,8 +73,7 @@ SIGNAL_TYPE exorcise(int); */ SIGNAL_TYPE -exorcise(dummy) - int dummy __unused; +exorcise(int dummy __unused) { (void) wait(0); } @@ -85,7 +84,7 @@ exorcise(dummy) */ void -faketalk() +faketalk(void) { struct servent *sp; char buf[BUFSIZ]; @@ -207,8 +206,7 @@ faketalk() */ static void -do_announce(s) - char *s; +do_announce(char *s) { CTL_RESPONSE response; @@ -246,7 +244,7 @@ do_announce(s) } #else void -faketalk() +faketalk(void) { return; } diff --git a/hunt/huntd/get_names.c b/hunt/huntd/get_names.c index 7acda59e..9c6c7ecf 100644 --- a/hunt/huntd/get_names.c +++ b/hunt/huntd/get_names.c @@ -1,4 +1,4 @@ -/* $NetBSD: get_names.c,v 1.8 2009/07/04 01:01:18 dholland Exp $ */ +/* $NetBSD: get_names.c,v 1.9 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: get_names.c,v 1.8 2009/07/04 01:01:18 dholland Exp $"); +__RCSID("$NetBSD: get_names.c,v 1.9 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ #include "bsd.h" @@ -55,8 +55,7 @@ char *my_machine_name; * Determine the local user and machine */ void -get_local_name(my_name) - char *my_name; +get_local_name(char *my_name) { struct hostent *hp; struct servent *sp; @@ -112,8 +111,7 @@ get_local_name(my_name) * Determine the remote user and machine */ int -get_remote_name(his_address) - char *his_address; +get_remote_name(char *his_address) { char *his_name; char *his_machine_name; diff --git a/hunt/huntd/makemaze.c b/hunt/huntd/makemaze.c index 4b58f92f..8beee4ff 100644 --- a/hunt/huntd/makemaze.c +++ b/hunt/huntd/makemaze.c @@ -1,4 +1,4 @@ -/* $NetBSD: makemaze.c,v 1.4 2004/01/27 20:30:29 jsm Exp $ */ +/* $NetBSD: makemaze.c,v 1.5 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: makemaze.c,v 1.4 2004/01/27 20:30:29 jsm Exp $"); +__RCSID("$NetBSD: makemaze.c,v 1.5 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ # include "hunt.h" @@ -46,7 +46,7 @@ static void dig_maze(int, int); static void remap(void); void -makemaze() +makemaze(void) { char *sp; int y, x; @@ -81,8 +81,7 @@ int incr[NDIR][2] = { }; static void -dig(y, x) - int y, x; +dig(int y, int x) { int *dp; int *ip; @@ -106,8 +105,7 @@ dig(y, x) * Is it legal to clear this spot? */ static int -candig(y, x) - int y, x; +candig(int y, int x) { int i; @@ -137,8 +135,7 @@ candig(y, x) } void -dig_maze(x, y) - int x, y; +dig_maze(int x, int y) { int tx, ty; int i, j; @@ -185,7 +182,7 @@ dig_maze(x, y) } void -remap() +remap(void) { int y, x; char *sp; diff --git a/hunt/huntd/shots.c b/hunt/huntd/shots.c index ecc08a48..4c524d3d 100644 --- a/hunt/huntd/shots.c +++ b/hunt/huntd/shots.c @@ -1,4 +1,4 @@ -/* $NetBSD: shots.c,v 1.8 2009/07/04 01:01:18 dholland Exp $ */ +/* $NetBSD: shots.c,v 1.9 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: shots.c,v 1.8 2009/07/04 01:01:18 dholland Exp $"); +__RCSID("$NetBSD: shots.c,v 1.9 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ # include @@ -64,7 +64,7 @@ static void zapshot(BULLET *, BULLET *); * Move the shots already in the air, taking explosions into account */ void -moveshots() +moveshots(void) { BULLET *bp, *next; PLAYER *pp; @@ -183,8 +183,7 @@ ret: * Move a normal shot along its trajectory */ static int -move_normal_shot(bp) - BULLET *bp; +move_normal_shot(BULLET *bp) { int i, x, y; PLAYER *pp; @@ -371,8 +370,7 @@ move_normal_shot(bp) * Move the drone to the next square */ static void -move_drone(bp) - BULLET *bp; +move_drone(BULLET *bp) { int mask, count; int n, dir; @@ -515,8 +513,7 @@ drone_move: * Put this bullet back onto the bullet list */ static void -save_bullet(bp) - BULLET *bp; +save_bullet(BULLET *bp) { bp->b_over = Maze[bp->b_y][bp->b_x]; switch (bp->b_over) { @@ -567,8 +564,7 @@ save_bullet(bp) * Update the position of a player in flight */ static void -move_flyer(pp) - PLAYER *pp; +move_flyer(PLAYER *pp) { int x, y; @@ -658,9 +654,7 @@ again: * Handle explosions */ static void -chkshot(bp, next) - BULLET *bp; - BULLET *next; +chkshot(BULLET *bp, BULLET *next) { int y, x; int dy, dx, absdy; @@ -752,9 +746,7 @@ chkshot(bp, next) * handle slime shot exploding */ static void -chkslime(bp, next) - BULLET *bp; - BULLET *next; +chkslime(BULLET *bp, BULLET *next) { BULLET *nbp; @@ -800,10 +792,7 @@ chkslime(bp, next) * it hasn't fizzled yet */ void -move_slime(bp, speed, next) - BULLET *bp; - int speed; - BULLET *next; +move_slime(BULLET *bp, int speed, BULLET *next) { int i, j, dirmask, count; PLAYER *pp; @@ -960,8 +949,7 @@ move_slime(bp, speed, next) * returns whether the given location is a wall */ static int -iswall(y, x) - int y, x; +iswall(int y, int x) { if (y < 0 || x < 0 || y >= HEIGHT || x >= WIDTH) return TRUE; @@ -993,8 +981,7 @@ iswall(y, x) * Take a shot out of the air. */ static void -zapshot(blist, obp) - BULLET *blist, *obp; +zapshot(BULLET *blist, BULLET *obp) { BULLET *bp; FLAG explode; @@ -1018,9 +1005,7 @@ zapshot(blist, obp) * Make all shots at this location blow up */ void -explshot(blist, y, x) - BULLET *blist; - int y, x; +explshot(BULLET *blist, int y, int x) { BULLET *bp; @@ -1037,8 +1022,7 @@ explshot(blist, y, x) * Return a pointer to the player at the given location */ PLAYER * -play_at(y, x) - int y, x; +play_at(int y, int x) { PLAYER *pp; @@ -1055,9 +1039,7 @@ play_at(y, x) * of the player in the maze */ int -opposite(face, dir) - int face; - char dir; +opposite(int face, char dir) { switch (face) { case LEFTS: @@ -1079,8 +1061,7 @@ opposite(face, dir) * a pointer to the bullet, otherwise return NULL */ BULLET * -is_bullet(y, x) - int y, x; +is_bullet(int y, int x) { BULLET *bp; @@ -1096,9 +1077,7 @@ is_bullet(y, x) * to the given character. */ void -fixshots(y, x, over) - int y, x; - char over; +fixshots(int y, int x, char over) { BULLET *bp; @@ -1113,8 +1092,7 @@ fixshots(y, x, over) * on another bullet. */ static void -find_under(blist, bp) - BULLET *blist, *bp; +find_under(BULLET *blist, BULLET *bp) { BULLET *nbp; @@ -1130,8 +1108,7 @@ find_under(blist, bp) * mark a player as under a shot */ static void -mark_player(bp) - BULLET *bp; +mark_player(BULLET *bp) { PLAYER *pp; @@ -1148,8 +1125,7 @@ mark_player(bp) * mark a boot as under a shot */ static void -mark_boot(bp) - BULLET *bp; +mark_boot(BULLET *bp) { PLAYER *pp; diff --git a/hunt/huntd/terminal.c b/hunt/huntd/terminal.c index a54d61b1..a3e0c7d5 100644 --- a/hunt/huntd/terminal.c +++ b/hunt/huntd/terminal.c @@ -1,4 +1,4 @@ -/* $NetBSD: terminal.c,v 1.5 2008/01/28 03:23:29 dholland Exp $ */ +/* $NetBSD: terminal.c,v 1.6 2009/07/04 02:37:20 dholland Exp $ */ /* * Copyright (c) 1983-2003, Regents of the University of California. * All rights reserved. @@ -32,7 +32,7 @@ #include #ifndef lint -__RCSID("$NetBSD: terminal.c,v 1.5 2008/01/28 03:23:29 dholland Exp $"); +__RCSID("$NetBSD: terminal.c,v 1.6 2009/07/04 02:37:20 dholland Exp $"); #endif /* not lint */ #include @@ -45,9 +45,7 @@ __RCSID("$NetBSD: terminal.c,v 1.5 2008/01/28 03:23:29 dholland Exp $"); * terminal. */ void -cgoto(pp, y, x) - PLAYER *pp; - int y, x; +cgoto(PLAYER *pp, int y, int x) { if (x == pp->p_curx && y == pp->p_cury) return; @@ -61,9 +59,7 @@ cgoto(pp, y, x) * Put out a single character. */ void -outch(pp, ch) - PLAYER *pp; - char ch; +outch(PLAYER *pp, int ch) { if (++pp->p_curx >= TERM_WIDTH) { pp->p_curx = 0; @@ -77,10 +73,7 @@ outch(pp, ch) * Put out a string of the given length. */ void -outstr(pp, str, len) - PLAYER *pp; - const char *str; - int len; +outstr(PLAYER *pp, const char *str, int len) { pp->p_curx += len; pp->p_cury += (pp->p_curx / TERM_WIDTH); @@ -94,8 +87,7 @@ outstr(pp, str, len) * Clear the screen, and reset the current position on the screen. */ void -clrscr(pp) - PLAYER *pp; +clrscr(PLAYER *pp) { sendcom(pp, CLEAR); pp->p_cury = 0; @@ -107,8 +99,7 @@ clrscr(pp) * Clear to the end of the line */ void -ce(pp) - PLAYER *pp; +ce(PLAYER *pp) { sendcom(pp, CLRTOEOL); } @@ -119,8 +110,7 @@ ce(pp) * Refresh the screen */ void -ref(pp) - PLAYER *pp; +ref(PLAYER *pp) { sendcom(pp, REFRESH); } -- cgit v1.2.3-56-ge451