From: Sascha Wildner Date: Thu, 4 Sep 2008 16:12:51 +0000 (+0000) Subject: Ansify (silence -Wold-style-definition) X-Git-Tag: v2.1.1~496 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/6beb426bf37d37432589d9700b0dba147f00d21b Ansify (silence -Wold-style-definition) --- diff --git a/games/hunt/hunt/connect.c b/games/hunt/hunt/connect.c index 74b1de7754..28b9f567fb 100644 --- a/games/hunt/hunt/connect.c +++ b/games/hunt/hunt/connect.c @@ -30,7 +30,7 @@ * * $OpenBSD: connect.c,v 1.6 2003/06/11 08:45:24 pjanzen Exp $ * $NetBSD: connect.c,v 1.3 1997/10/11 08:13:40 lukem Exp $ - * $DragonFly: src/games/hunt/hunt/connect.c,v 1.1 2008/09/02 21:50:20 dillon Exp $ + * $DragonFly: src/games/hunt/hunt/connect.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -43,10 +43,7 @@ #include "client.h" void -do_connect(name, team, enter_status) - char * name; - u_int8_t team; - u_int32_t enter_status; +do_connect(char *name, u_int8_t team, u_int32_t enter_status) { u_int32_t uid; u_int32_t mode; diff --git a/games/hunt/hunt/display.c b/games/hunt/hunt/display.c index 14a81df13e..8eb82d21d4 100644 --- a/games/hunt/hunt/display.c +++ b/games/hunt/hunt/display.c @@ -3,7 +3,7 @@ * David Leonard , 1999. Public domain. * * $OpenBSD: display.c,v 1.4 2002/02/19 19:39:36 millert Exp $ - * $DragonFly: src/games/hunt/hunt/display.c,v 1.1 2008/09/02 21:50:20 dillon Exp $ + * $DragonFly: src/games/hunt/hunt/display.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #define USE_CURSES @@ -34,8 +34,7 @@ int cur_row, cur_col; * Handle stop and start signals */ static void -tstp(dummy) - int dummy; +tstp(int dummy) { int y, x; @@ -65,7 +64,7 @@ tstp(dummy) * open the display */ void -display_open() +display_open(void) { char *term; @@ -89,7 +88,7 @@ display_open() * beep */ void -display_beep() +display_beep(void) { (void) putchar('\a'); } @@ -99,7 +98,7 @@ display_beep() * sync the display */ void -display_refresh() +display_refresh(void) { (void) fflush(stdout); } @@ -109,7 +108,7 @@ display_refresh() * clear to end of line, without moving cursor */ void -display_clear_eol() +display_clear_eol(void) { if (CE != NULL) tputs(CE, 1, __cputchar); @@ -131,8 +130,7 @@ display_clear_eol() * with wraparound */ void -display_put_ch(ch) - char ch; +display_put_ch(char ch) { if (!isprint(ch)) { fprintf(stderr, "r,c,ch: %d,%d,%d", cur_row, cur_col, ch); @@ -165,7 +163,7 @@ display_put_str(const char *s) * clear the screen; move cursor to top left */ void -display_clear_the_screen() +display_clear_the_screen(void) { int i; @@ -194,8 +192,7 @@ display_clear_the_screen() * move the cursor */ void -display_move(y, x) - int y, x; +display_move(int y, int x) { mvcur(cur_row, cur_col, y, x); cur_row = y; @@ -207,8 +204,7 @@ display_move(y, x) * locate the cursor */ void -display_getyx(yp, xp) - int *yp, *xp; +display_getyx(int *yp, int *xp) { *xp = cur_col; *yp = cur_row; @@ -219,7 +215,7 @@ display_getyx(yp, xp) * close the display */ void -display_end() +display_end(void) { tcsetattr(0, TCSADRAIN, &__orig_termios); _puts(VE); @@ -231,8 +227,7 @@ display_end() * return a character from the screen */ char -display_atyx(y, x) - int y, x; +display_atyx(int y, int x) { return screen[y][x]; } @@ -242,7 +237,7 @@ display_atyx(y, x) * redraw the screen */ void -display_redraw_screen() +display_redraw_screen(void) { int i; @@ -263,7 +258,7 @@ display_redraw_screen() #include "hunt.h" void -display_open() +display_open(void) { initscr(); (void) noecho(); @@ -271,26 +266,25 @@ display_open() } void -display_beep() +display_beep(void) { beep(); } void -display_refresh() +display_refresh(void) { refresh(); } void -display_clear_eol() +display_clear_eol(void) { clrtoeol(); } void -display_put_ch(c) - char c; +display_put_ch(char c) { addch(c); } @@ -302,7 +296,7 @@ display_put_str(const char *s) } void -display_clear_the_screen() +display_clear_the_screen(void) { clear(); move(0, 0); @@ -310,28 +304,25 @@ display_clear_the_screen() } void -display_move(y, x) - int y, x; +display_move(int y, int x) { move(y, x); } void -display_getyx(yp, xp) - int *yp, *xp; +display_getyx(int *yp, int *xp) { getyx(stdscr, *yp, *xp); } void -display_end() +display_end(void) { endwin(); } char -display_atyx(y, x) - int y, x; +display_atyx(int y, int x) { int oy, ox; char c; @@ -343,22 +334,20 @@ display_atyx(y, x) } void -display_redraw_screen() +display_redraw_screen(void) { clearok(stdscr, TRUE); touchwin(stdscr); } int -display_iserasechar(ch) - char ch; +display_iserasechar(char ch) { return ch == erasechar(); } int -display_iskillchar(ch) - char ch; +display_iskillchar(char ch) { return ch == killchar(); } diff --git a/games/hunt/hunt/hunt.c b/games/hunt/hunt/hunt.c index 6fb8bcc364..71a343145a 100644 --- a/games/hunt/hunt/hunt.c +++ b/games/hunt/hunt/hunt.c @@ -30,7 +30,7 @@ * * $OpenBSD: hunt.c,v 1.13 2008/03/17 09:17:56 sobrado Exp $ * $NetBSD: hunt.c,v 1.8 1998/09/13 15:27:28 hubertf Exp $ - * $DragonFly: src/games/hunt/hunt/hunt.c,v 1.1 2008/09/02 21:50:20 dillon Exp $ + * $DragonFly: src/games/hunt/hunt/hunt.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -271,7 +271,7 @@ main(int ac, char **av) * then we choose it. Otherwise we present a list of the found drivers. */ static int -find_driver() +find_driver(void) { int last_driver, numdrivers, waiting, is_current; struct driver *driver; @@ -369,7 +369,7 @@ find_driver() } static void -dump_scores() +dump_scores(void) { struct driver *driver; int s, cnt, i; @@ -413,7 +413,7 @@ dump_scores() * means the game is full. */ void -bad_con() +bad_con(void) { leave(1, "lost connection to huntd"); } @@ -423,7 +423,7 @@ bad_con() * version number mismatch. */ void -bad_ver() +bad_ver(void) { errno = 0; leave(1, "Version number mismatch. No go."); @@ -528,8 +528,7 @@ leave(int eval, const char *mesg) * initialise game parameters from the HUNT envvar */ static long -env_init(enter_status) - long enter_status; +env_init(long enter_status) { int i; char *envp, *envname, *s; @@ -641,7 +640,7 @@ env_init(enter_status) * quiz the user for the information they didn't provide earlier */ static void -fill_in_blanks() +fill_in_blanks(void) { int i; char *cp; diff --git a/games/hunt/hunt/list.c b/games/hunt/hunt/list.c index 6408bf5f71..ba2517dd66 100644 --- a/games/hunt/hunt/list.c +++ b/games/hunt/hunt/list.c @@ -5,7 +5,7 @@ * This software is provided ``as is'' without express or implied warranty. * * $OpenBSD: list.c,v 1.5 2007/09/04 22:39:31 hshoexer Exp $ - * $DragonFly: src/games/hunt/hunt/list.c,v 1.1 2008/09/02 21:50:20 dillon Exp $ + * $DragonFly: src/games/hunt/hunt/list.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -43,15 +43,14 @@ static int probe_sock[64]; static struct timeval probe_timeout; struct driver * -next_driver() +next_driver(void) { return next_driver_fd(-1); } struct driver * -next_driver_fd(fd) - int fd; +next_driver_fd(int fd) { fd_set r; int maxfd = -1; @@ -134,8 +133,7 @@ next_driver_fd(fd) /* Return the hostname for a driver. */ const char * -driver_name(driver) - struct driver *driver; +driver_name(struct driver *driver) { const char *name; static char buf[80]; @@ -197,7 +195,7 @@ start_probe(struct sockaddr *addr, u_int16_t req) } void -probe_cleanup() +probe_cleanup(void) { int i; @@ -211,9 +209,7 @@ probe_cleanup() * Otherwise, send the request message only to the preferred host. */ void -probe_drivers(req, preferred) - u_int16_t req; - char *preferred; +probe_drivers(u_int16_t req, char *preferred) { struct sockaddr_in *target; struct sockaddr_in localhost; diff --git a/games/hunt/hunt/otto.c b/games/hunt/hunt/otto.c index faaf96e2e5..1e50d74979 100644 --- a/games/hunt/hunt/otto.c +++ b/games/hunt/hunt/otto.c @@ -30,7 +30,7 @@ * * $OpenBSD: otto.c,v 1.9 2006/03/27 00:10:15 tedu Exp $ * $NetBSD: otto.c,v 1.2 1997/10/10 16:32:39 lukem Exp $ - * $DragonFly: src/games/hunt/hunt/otto.c,v 1.1 2008/09/02 21:50:20 dillon Exp $ + * $DragonFly: src/games/hunt/hunt/otto.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ /* @@ -138,11 +138,7 @@ static void wander(void); static void _panic(const char *, int, const char *); int -otto(y, x, face, buf, buflen) - int y, x; - char face; - char *buf; - size_t buflen; +otto(int y, int x, char face, char *buf, size_t buflen) { int i; @@ -197,11 +193,7 @@ done: } 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) { @@ -268,9 +260,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; @@ -370,7 +360,7 @@ ottolook(rel_dir, itemp) } static void -look_around() +look_around(void) { int i; @@ -384,8 +374,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; @@ -421,9 +410,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); @@ -449,8 +436,7 @@ attack(rel_dir, itemp) } static void -duck(rel_dir) - int rel_dir; +duck(int rel_dir) { int dir; @@ -499,8 +485,7 @@ duck(rel_dir) */ static int -go_for_ammo(mine) - char mine; +go_for_ammo(char mine) { int i, rel_dir, dist; @@ -526,7 +511,7 @@ go_for_ammo(mine) } static void -wander() +wander(void) { int i, j, rel_dir, dir_mask, dir_count; @@ -576,10 +561,7 @@ otto_quit(int old_status __unused) } static void -_panic(file, line, msg) - const char *file; - int line; - const char *msg; +_panic(const char *file, int line, const char *msg) { fprintf(stderr, "%s:%d: panic! %s\n", file, line, msg); diff --git a/games/hunt/hunt/playit.c b/games/hunt/hunt/playit.c index df9fa5face..f4f7492664 100644 --- a/games/hunt/hunt/playit.c +++ b/games/hunt/hunt/playit.c @@ -30,7 +30,7 @@ * * $OpenBSD: playit.c,v 1.8 2003/06/11 08:45:25 pjanzen Exp $ * $NetBSD: playit.c,v 1.4 1997/10/20 00:37:15 lukem Exp $ - * $DragonFly: src/games/hunt/hunt/playit.c,v 1.1 2008/09/02 21:50:20 dillon Exp $ + * $DragonFly: src/games/hunt/hunt/playit.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -74,7 +74,7 @@ static void send_stuff(void); * the driver. */ void -playit() +playit(void) { int ch; int y, x; @@ -187,7 +187,7 @@ out: * no characters in the input buffer. */ static unsigned char -getchr() +getchr(void) { fd_set readfds, s_readfds; int nfds, s_nfds; @@ -225,7 +225,7 @@ one_more_time: * Send standard input characters to the driver */ static void -send_stuff() +send_stuff(void) { int count; char *sp, *nsp; @@ -277,8 +277,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; @@ -398,7 +397,7 @@ get_message: * Send a message to the driver and return */ void -do_message() +do_message(void) { u_int32_t version; diff --git a/games/hunt/huntd/answer.c b/games/hunt/huntd/answer.c index 3c66f692ff..895b2bb309 100644 --- a/games/hunt/huntd/answer.c +++ b/games/hunt/huntd/answer.c @@ -30,7 +30,7 @@ * * $OpenBSD: answer.c,v 1.11 2007/11/06 10:22:29 chl Exp $ * $NetBSD: answer.c,v 1.3 1997/10/10 16:32:50 lukem Exp $ - * $DragonFly: src/games/hunt/huntd/answer.c,v 1.1 2008/09/02 21:50:21 dillon Exp $ + * $DragonFly: src/games/hunt/huntd/answer.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -64,7 +64,7 @@ static void stmonitor(PLAYER *); static IDENT * get_ident(struct sockaddr *, int, uid_t, char *, char); void -answer_first() +answer_first(void) { struct sockaddr sockstruct; int newsock; @@ -134,8 +134,7 @@ answer_first() } int -answer_next(sp) - struct spawn *sp; +answer_next(struct spawn *sp) { PLAYER *pp; char *cp1, *cp2; @@ -290,8 +289,7 @@ close_it: /* Start a monitor: */ static void -stmonitor(pp) - PLAYER *pp; +stmonitor(PLAYER *pp) { /* Monitors get to see the entire maze: */ @@ -312,9 +310,7 @@ stmonitor(pp) /* Start a player: */ static void -stplayer(newpp, enter_status) - PLAYER *newpp; - int enter_status; +stplayer(PLAYER *newpp, int enter_status) { int x, y; PLAYER *pp; @@ -438,7 +434,7 @@ stplayer(newpp, enter_status) * Return a random direction */ int -rand_dir() +rand_dir(void) { switch (rand_num(4)) { case 0: @@ -459,12 +455,8 @@ rand_dir() * Get the score structure of a player */ static IDENT * -get_ident(sa, salen, uid, name, team) - struct sockaddr *sa; - int salen __unused; - uid_t uid; - char *name; - char team; +get_ident(struct sockaddr *sa, int salen __unused, uid_t uid, char *name, + char team) { IDENT *ip; static IDENT punt; @@ -536,8 +528,7 @@ get_ident(sa, salen, uid, name, team) } void -answer_info(fp) - FILE *fp; +answer_info(FILE *fp) { struct spawn *sp; char buf[128]; diff --git a/games/hunt/huntd/conf.c b/games/hunt/huntd/conf.c index f309f8097c..1ce9b015d8 100644 --- a/games/hunt/huntd/conf.c +++ b/games/hunt/huntd/conf.c @@ -2,7 +2,7 @@ * David Leonard , 1999. Public domain. * * $OpenBSD: conf.c,v 1.7 2007/03/20 03:43:50 tedu Exp $ - * $DragonFly: src/games/hunt/huntd/conf.c,v 1.1 2008/09/02 21:50:21 dillon Exp $ + * $DragonFly: src/games/hunt/huntd/conf.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include #include @@ -277,7 +277,7 @@ load_config(FILE *f, char *fnm) * overwrite earlier values */ void -config() +config(void) { const char *home; char nm[MAXPATHLEN + 1]; @@ -309,8 +309,7 @@ config() * Parse a single configuration argument given on the command line */ void -config_arg(arg) - char *arg; +config_arg(char *arg) { int line = 0; diff --git a/games/hunt/huntd/draw.c b/games/hunt/huntd/draw.c index ce4cdf868b..4ec303ac34 100644 --- a/games/hunt/huntd/draw.c +++ b/games/hunt/huntd/draw.c @@ -30,7 +30,7 @@ * * $OpenBSD: draw.c,v 1.7 2003/06/11 08:45:33 pjanzen Exp $ * $NetBSD: draw.c,v 1.2 1997/10/10 16:33:04 lukem Exp $ - * $DragonFly: src/games/hunt/huntd/draw.c,v 1.1 2008/09/02 21:50:21 dillon Exp $ + * $DragonFly: src/games/hunt/huntd/draw.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -49,8 +49,7 @@ static void see(PLAYER *, int); * Draw the entire maze on a player's screen. */ void -drawmaze(pp) - PLAYER *pp; +drawmaze(PLAYER *pp) { int x; char *sp; @@ -87,8 +86,7 @@ drawmaze(pp) * size is 80x24 with the maze being 64x24) */ static void -drawstatus(pp) - PLAYER *pp; +drawstatus(PLAYER *pp) { int i; PLAYER *np; @@ -127,8 +125,7 @@ drawstatus(pp) * check and update the visible area around the player */ void -look(pp) - PLAYER *pp; +look(PLAYER *pp) { int x, y; @@ -186,9 +183,7 @@ look(pp) * is a simulation of visibility from the player's perspective. */ static void -see(pp, face) - PLAYER *pp; - int face; +see(PLAYER *pp, int face) { char *sp; int y, x; @@ -228,9 +223,7 @@ see(pp, face) * Ensure it is shown properly on their screen. */ void -check(pp, y, x) - PLAYER *pp; - int y, x; +check(PLAYER *pp, int y, int x) { int i; int ch; @@ -264,8 +257,7 @@ check(pp, y, x) * Update the status of a player on everyone's screen */ void -showstat(pp) - PLAYER *pp; +showstat(PLAYER *pp) { outyx(ALL_PLAYERS, @@ -281,9 +273,7 @@ showstat(pp) * be drawn instead of the player; effectively un-drawing the player. */ void -drawplayer(pp, draw) - PLAYER *pp; - FLAG draw; +drawplayer(PLAYER *pp, FLAG draw) { PLAYER *newp; int x, y; @@ -339,7 +329,7 @@ drawplayer(pp, draw) * Write a message at the bottom of the screen. */ void -message(PLAYER *pp, const char *s) +message(PLAYER *pp, const char *s) { cgoto(pp, HEIGHT, 0); outstr(pp, s, strlen(s)); @@ -352,8 +342,7 @@ message(PLAYER *pp, const char *s) * ie: {,},!,i becomes <,>,v,^ */ static char -translate(ch) - char ch; +translate(char ch) { switch (ch) { case LEFTS: @@ -376,9 +365,7 @@ translate(ch) * - teamed players see other players on their team, as a digit */ static int -player_sym(pp, y, x) - PLAYER *pp; - int y, x; +player_sym(PLAYER *pp, int y, int x) { PLAYER *npp; diff --git a/games/hunt/huntd/driver.c b/games/hunt/huntd/driver.c index 8043fbb33f..d8efe66972 100644 --- a/games/hunt/huntd/driver.c +++ b/games/hunt/huntd/driver.c @@ -30,7 +30,7 @@ * * $OpenBSD: driver.c,v 1.17 2007/04/02 14:55:16 jmc Exp $ * $NetBSD: driver.c,v 1.5 1997/10/20 00:37:16 lukem Exp $ - * $DragonFly: src/games/hunt/huntd/driver.c,v 1.1 2008/09/02 21:50:21 dillon Exp $ + * $DragonFly: src/games/hunt/huntd/driver.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -82,9 +82,7 @@ static void handle_wkport(int); * The main program. */ int -main(ac, av) - int ac; - char **av; +main(int ac, char **av) { PLAYER *pp; int had_char; @@ -322,7 +320,7 @@ again: * Initialize the global parameters. */ static void -init() +init(void) { int i; struct sockaddr_in test_port; @@ -489,7 +487,7 @@ init() * Put the boots in the maze */ static void -makeboots() +makeboots(void) { int x, y; PLAYER *pp; @@ -513,11 +511,8 @@ makeboots() * If the victim dies as a result, give points to 'credit', */ void -checkdam(victim, attacker, credit, damage, stype) - PLAYER *victim, *attacker; - IDENT *credit; - int damage; - char stype; +checkdam(PLAYER *victim, PLAYER *attacker, IDENT *credit, int damage, + char stype) { const char *cp; int y; @@ -673,9 +668,7 @@ checkdam(victim, attacker, credit, damage, stype) * a monitor and needs extra cleaning up. */ static void -zap(pp, was_player) - PLAYER *pp; - FLAG was_player; +zap(PLAYER *pp, FLAG was_player) { int len; BULLET *bp; @@ -909,8 +902,7 @@ zap(pp, was_player) * Return a random number in a given range. */ int -rand_num(range) - int range; +rand_num(int range) { if (range == 0) return 0; @@ -924,8 +916,7 @@ rand_num(range) * FALSE. */ static int -havechar(pp) - PLAYER *pp; +havechar(PLAYER *pp) { int ret; @@ -971,8 +962,7 @@ check_again: * Exit with the given value, cleaning up any droppings lying around */ void -cleanup(eval) - int eval; +cleanup(int eval) { PLAYER *pp; @@ -1002,7 +992,7 @@ cleanup(eval) * the stats. */ static void -send_stats() +send_stats(void) { FILE *fp; int s; @@ -1052,8 +1042,7 @@ send_stats() * emit the game statistics */ void -print_stats(fp) - FILE *fp; +print_stats(FILE *fp) { IDENT *ip; PLAYER *pp; @@ -1118,7 +1107,7 @@ siginfo(int sig __unused) * Clear the Scores list. */ static void -clear_scores() +clear_scores(void) { IDENT *ip, *nextip; @@ -1135,7 +1124,7 @@ clear_scores() * Publically announce the game */ static void -announce_game() +announce_game(void) { /* TODO: could use system() to do something user-configurable */ @@ -1145,8 +1134,7 @@ announce_game() * Handle a UDP packet sent to the well known port. */ static void -handle_wkport(fd) - int fd; +handle_wkport(int fd) { struct sockaddr fromaddr; socklen_t fromlen; diff --git a/games/hunt/huntd/execute.c b/games/hunt/huntd/execute.c index 1c74aa52a1..b9e338ab1f 100644 --- a/games/hunt/huntd/execute.c +++ b/games/hunt/huntd/execute.c @@ -30,7 +30,7 @@ * * $OpenBSD: execute.c,v 1.8 2004/01/16 00:13:19 espie Exp $ * $NetBSD: execute.c,v 1.2 1997/10/10 16:33:13 lukem Exp $ - * $DragonFly: src/games/hunt/huntd/execute.c,v 1.1 2008/09/02 21:50:21 dillon Exp $ + * $DragonFly: src/games/hunt/huntd/execute.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -54,8 +54,7 @@ static void scan(PLAYER *); * Execute a single monitor command */ void -mon_execute(pp) - PLAYER *pp; +mon_execute(PLAYER *pp) { char ch; @@ -81,8 +80,7 @@ mon_execute(pp) * Execute a single command from a player */ void -execute(pp) - PLAYER *pp; +execute(PLAYER *pp) { char ch; @@ -197,9 +195,7 @@ execute(pp) * Try to move player 'pp' in direction 'dir'. */ static void -move_player(pp, dir) - PLAYER *pp; - int dir; +move_player(PLAYER *pp, int dir) { PLAYER *newp; int x, y; @@ -343,9 +339,7 @@ move_player(pp, dir) * Change the direction the player is facing */ static void -face(pp, dir) - PLAYER *pp; - int dir; +face(PLAYER *pp, int dir) { if (pp->p_face != dir) { pp->p_face = dir; @@ -358,9 +352,7 @@ face(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; @@ -404,9 +396,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; @@ -454,14 +444,8 @@ fire_slime(pp, req_index) * Create a shot with the given properties */ void -add_shot(type, y, x, wface, charge, owner, expl, over) - int type; - int y, x; - char wface; - int charge; - PLAYER *owner; - int expl; - char over; +add_shot(int type, int y, int x, char wface, int charge, PLAYER *owner, + int expl, char over) { BULLET *bp; int size; @@ -505,16 +489,8 @@ add_shot(type, y, x, wface, charge, owner, expl, over) * initialize and return it */ BULLET * -create_shot(type, y, x, wface, charge, size, owner, score, expl, over) - int type; - int y, x; - char wface; - int charge; - int size; - PLAYER *owner; - IDENT *score; - int expl; - char over; +create_shot(int type, int y, int x, char wface, int charge, int size, + PLAYER *owner, IDENT *score, int expl, char over) { BULLET *bp; @@ -546,8 +522,7 @@ create_shot(type, y, x, wface, charge, size, owner, score, expl, over) * Turn on or increase length of a cloak */ static void -cloak(pp) - PLAYER *pp; +cloak(PLAYER *pp) { /* Check configuration: */ if (!conf_cloak) @@ -585,8 +560,7 @@ cloak(pp) * Turn on or increase length of a scan */ static void -scan(pp) - PLAYER *pp; +scan(PLAYER *pp) { /* Check configuration: */ if (!conf_scan) @@ -618,11 +592,7 @@ scan(pp) * pick up a mine or grenade, with some probability of it exploding */ static 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; @@ -654,8 +624,7 @@ pickup(pp, y, x, prob, obj) } void -ammo_update(pp) - PLAYER *pp; +ammo_update(PLAYER *pp) { outyx(pp, STAT_AMMO_ROW, STAT_VALUE_COL - 1, "%4d", pp->p_ammo); } diff --git a/games/hunt/huntd/expl.c b/games/hunt/huntd/expl.c index f2ab0b7ab7..e1758c4e79 100644 --- a/games/hunt/huntd/expl.c +++ b/games/hunt/huntd/expl.c @@ -30,7 +30,7 @@ * * $OpenBSD: expl.c,v 1.9 2007/09/04 22:39:31 hshoexer Exp $ * $NetBSD: expl.c,v 1.2 1997/10/10 16:33:18 lukem Exp $ - * $DragonFly: src/games/hunt/huntd/expl.c,v 1.1 2008/09/02 21:50:21 dillon Exp $ + * $DragonFly: src/games/hunt/huntd/expl.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -49,9 +49,7 @@ static void init_removed(void); * 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; @@ -107,7 +105,7 @@ showexpl(y, x, type) * top */ void -rollexpl() +rollexpl(void) { EXPL *ep; PLAYER *pp; @@ -140,7 +138,7 @@ rollexpl() } int -can_rollexpl() +can_rollexpl(void) { int i; @@ -154,7 +152,7 @@ static REGEN *removed = NULL; static REGEN *rem_index = NULL; static void -init_removed() +init_removed(void) { rem_index = removed = calloc(conf_maxremove, sizeof(REGEN)); if (rem_index == NULL) { @@ -169,8 +167,7 @@ init_removed() * the location currently pointed at. */ static void -remove_wall(y, x) - int y, x; +remove_wall(int y, int x) { REGEN *r; PLAYER *pp; @@ -243,7 +240,7 @@ found: * Clear out the walls array */ void -clearwalls() +clearwalls(void) { REGEN *rp; diff --git a/games/hunt/huntd/makemaze.c b/games/hunt/huntd/makemaze.c index 5f9dd00eb6..06ef40a943 100644 --- a/games/hunt/huntd/makemaze.c +++ b/games/hunt/huntd/makemaze.c @@ -30,7 +30,7 @@ * * $OpenBSD: makemaze.c,v 1.6 2003/06/11 08:45:33 pjanzen Exp $ * $NetBSD: makemaze.c,v 1.2 1997/10/10 16:33:43 lukem Exp $ - * $DragonFly: src/games/hunt/huntd/makemaze.c,v 1.1 2008/09/02 21:50:21 dillon Exp $ + * $DragonFly: src/games/hunt/huntd/makemaze.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -48,7 +48,7 @@ static void dig_maze(int, int); static void remap(void); void -makemaze() +makemaze(void) { char *sp; int y, x; @@ -83,8 +83,7 @@ int incr[NDIR][2] = { }; static void -dig(y, x) - int y, x; +dig(int y, int x) { int *dp; int *ip; @@ -108,8 +107,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; @@ -139,8 +137,7 @@ candig(y, x) } static void -dig_maze(x, y) - int x, y; +dig_maze(int x, int y) { int tx, ty; int i, j; @@ -187,7 +184,7 @@ dig_maze(x, y) } static void -remap() +remap(void) { int y, x; char *sp; diff --git a/games/hunt/huntd/shots.c b/games/hunt/huntd/shots.c index 1448dac827..32eeb571a0 100644 --- a/games/hunt/huntd/shots.c +++ b/games/hunt/huntd/shots.c @@ -30,7 +30,7 @@ * * $OpenBSD: shots.c,v 1.9 2006/03/27 00:10:15 tedu Exp $ * $NetBSD: shots.c,v 1.3 1997/10/11 08:13:50 lukem Exp $ - * $DragonFly: src/games/hunt/huntd/shots.c,v 1.1 2008/09/02 21:50:21 dillon Exp $ + * $DragonFly: src/games/hunt/huntd/shots.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -60,7 +60,7 @@ static void zapshot(BULLET *, BULLET *); /* Return true if there is pending activity */ int -can_moveshots() +can_moveshots(void) { PLAYER *pp; @@ -89,7 +89,7 @@ can_moveshots() * Move the shots already in the air, taking explosions into account */ void -moveshots() +moveshots(void) { BULLET *bp, *next; PLAYER *pp; @@ -224,8 +224,7 @@ no_bullets: * Returns false if the bullet no longer needs tracking. */ static int -move_normal_shot(bp) - BULLET *bp; +move_normal_shot(BULLET *bp) { int i, x, y; PLAYER *pp; @@ -452,8 +451,7 @@ move_normal_shot(bp) * Returns FALSE if the drone need no longer be tracked. */ static int -move_drone(bp) - BULLET *bp; +move_drone(BULLET *bp) { int mask, count; int n, dir = -1; @@ -593,8 +591,7 @@ drone_move: * Put a bullet back onto the bullet list */ static void -save_bullet(bp) - BULLET *bp; +save_bullet(BULLET *bp) { /* Save what the bullet will be flying over: */ @@ -645,8 +642,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; @@ -752,9 +748,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; @@ -845,9 +839,7 @@ chkshot(bp, next) * handle slime shot exploding */ static void -chkslime(bp, next) - BULLET *bp; - BULLET *next; +chkslime(BULLET *bp, BULLET *next) { BULLET *nbp; @@ -895,10 +887,7 @@ chkslime(bp, next) * it hasn't fizzled yet */ static 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; @@ -1056,8 +1045,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; @@ -1080,8 +1068,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; @@ -1102,9 +1089,7 @@ zapshot(blist, obp) * Make all shots at this location blow up */ static void -explshot(blist, y, x) - BULLET *blist; - int y, x; +explshot(BULLET *blist, int y, int x) { BULLET *bp; @@ -1121,8 +1106,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; @@ -1141,9 +1125,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: @@ -1165,8 +1147,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; @@ -1182,9 +1163,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; @@ -1199,8 +1178,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; @@ -1216,8 +1194,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; @@ -1233,8 +1210,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/games/hunt/huntd/terminal.c b/games/hunt/huntd/terminal.c index f75a042a6e..e00a4a277d 100644 --- a/games/hunt/huntd/terminal.c +++ b/games/hunt/huntd/terminal.c @@ -30,7 +30,7 @@ * * $OpenBSD: terminal.c,v 1.10 2008/06/20 13:08:44 ragge Exp $ * $NetBSD: terminal.c,v 1.2 1997/10/10 16:34:05 lukem Exp $ - * $DragonFly: src/games/hunt/huntd/terminal.c,v 1.1 2008/09/02 21:50:21 dillon Exp $ + * $DragonFly: src/games/hunt/huntd/terminal.c,v 1.2 2008/09/04 16:12:51 swildner Exp $ */ #include @@ -50,9 +50,7 @@ * terminal. */ void -cgoto(pp, y, x) - PLAYER *pp; - int y, x; +cgoto(PLAYER *pp, int y, int x) { if (pp == ALL_PLAYERS) { @@ -76,9 +74,7 @@ cgoto(pp, y, x) * Put out a single character. */ void -outch(pp, ch) - PLAYER *pp; - char ch; +outch(PLAYER *pp, char ch) { if (pp == ALL_PLAYERS) { @@ -148,8 +144,7 @@ outyx(PLAYER *pp, int y, int x, const char *fmt, ...) * Clear the screen, and reset the current position on the screen. */ void -clrscr(pp) - PLAYER *pp; +clrscr(PLAYER *pp) { if (pp == ALL_PLAYERS) { @@ -170,8 +165,7 @@ clrscr(pp) * Clear to the end of the line */ void -ce(pp) - PLAYER *pp; +ce(PLAYER *pp) { sendcom(pp, CLRTOEOL); } @@ -217,8 +211,7 @@ sendcom(PLAYER *pp, int command, ...) * Flush the output buffer to the player */ void -flush(pp) - PLAYER *pp; +flush(PLAYER *pp) { if (pp == ALL_PLAYERS) { for (pp = Player; pp < End_player; pp++)