summaryrefslogtreecommitdiff
path: root/games
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2006-03-08 09:44:37 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2006-03-08 09:44:37 +0000
commitffe3d5088be596482f473b82a7de28ed9f7872ad (patch)
tree16a906fec7a488c302c2ab7c3017323bc157b3eb /games
parent35d5d821cd7b3264484f856765723e464b003f49 (diff)
Ansify; from Alexey Dobriyan; hope the license gets cleared up, so we
can include this in the build again.
Diffstat (limited to 'games')
-rw-r--r--games/rogue/hit.c52
-rw-r--r--games/rogue/init.c40
-rw-r--r--games/rogue/inventory.c59
-rw-r--r--games/rogue/level.c72
-rw-r--r--games/rogue/machdep.c48
-rw-r--r--games/rogue/main.c8
-rw-r--r--games/rogue/message.c39
-rw-r--r--games/rogue/monster.c86
-rw-r--r--games/rogue/move.c44
-rw-r--r--games/rogue/object.c74
-rw-r--r--games/rogue/pack.c62
-rw-r--r--games/rogue/play.c6
-rw-r--r--games/rogue/random.c17
-rw-r--r--games/rogue/ring.c24
-rw-r--r--games/rogue/room.c59
-rw-r--r--games/rogue/save.c57
-rw-r--r--games/rogue/score.c61
-rw-r--r--games/rogue/spec_hit.c60
-rw-r--r--games/rogue/throw.c21
-rw-r--r--games/rogue/trap.c20
-rw-r--r--games/rogue/use.c44
-rw-r--r--games/rogue/zap.c25
22 files changed, 342 insertions, 636 deletions
diff --git a/games/rogue/hit.c b/games/rogue/hit.c
index aa95886d0d7..b1e49d06bf1 100644
--- a/games/rogue/hit.c
+++ b/games/rogue/hit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hit.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: hit.c,v 1.7 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: hit.c,v 1.3 1995/04/22 10:27:30 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)hit.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: hit.c,v 1.6 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: hit.c,v 1.7 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -59,8 +59,7 @@ object *fight_monster = 0;
char hit_message[HIT_MESSAGE_LEN] = "";
void
-mon_hit(monster)
- object *monster;
+mon_hit(object *monster)
{
short damage, hit_chance;
const char *mn;
@@ -119,9 +118,7 @@ mon_hit(monster)
}
void
-rogue_hit(monster, force_hit)
- object *monster;
- boolean force_hit;
+rogue_hit(object *monster, boolean force_hit)
{
short damage, hit_chance;
@@ -160,10 +157,7 @@ RET: check_gold_seeker(monster);
}
void
-rogue_damage(d, monster, other)
- short d;
- object *monster;
- short other;
+rogue_damage(short d, object *monster, short other)
{
if (d >= rogue.hp_current) {
rogue.hp_current = 0;
@@ -177,9 +171,7 @@ rogue_damage(d, monster, other)
}
int
-get_damage(ds, r)
- const char *ds;
- boolean r;
+get_damage(const char *ds, boolean r)
{
int i = 0, j, n, d, total = 0;
@@ -207,8 +199,7 @@ get_damage(ds, r)
}
int
-get_w_damage(obj)
- const object *obj;
+get_w_damage(const object *obj)
{
char new_damage[32];
int tmp_to_hit, tmp_damage;
@@ -230,8 +221,7 @@ get_w_damage(obj)
}
int
-get_number(s)
- const char *s;
+get_number(const char *s)
{
int i = 0;
int total = 0;
@@ -244,8 +234,7 @@ get_number(s)
}
int
-to_hit(obj)
- object *obj;
+to_hit(object *obj)
{
if (!obj) {
return(1);
@@ -254,7 +243,7 @@ to_hit(obj)
}
int
-damage_for_strength()
+damage_for_strength(void)
{
short strength;
@@ -285,9 +274,7 @@ damage_for_strength()
}
int
-mon_damage(monster, damage)
- object *monster;
- short damage;
+mon_damage(object *monster, short damage)
{
const char *mn;
short row, col;
@@ -318,8 +305,7 @@ mon_damage(monster, damage)
}
void
-fight(to_the_death)
- boolean to_the_death;
+fight(boolean to_the_death)
{
short ch, c, d;
short row, col;
@@ -370,10 +356,7 @@ fight(to_the_death)
}
void
-get_dir_rc(dir, row, col, allow_off_screen)
- short dir;
- short *row, *col;
- short allow_off_screen;
+get_dir_rc(short dir, short *row, short *col, short allow_off_screen)
{
switch(dir) {
case LEFT:
@@ -424,8 +407,7 @@ get_dir_rc(dir, row, col, allow_off_screen)
}
int
-get_hit_chance(weapon)
- object *weapon;
+get_hit_chance(object *weapon)
{
short hit_chance;
@@ -436,8 +418,7 @@ get_hit_chance(weapon)
}
int
-get_weapon_damage(weapon)
- object *weapon;
+get_weapon_damage(object *weapon)
{
short damage;
@@ -448,8 +429,7 @@ get_weapon_damage(weapon)
}
void
-s_con_mon(monster)
- object *monster;
+s_con_mon(object *monster)
{
if (con_mon) {
monster->m_flags |= CONFUSED;
diff --git a/games/rogue/init.c b/games/rogue/init.c
index 139dee30eb3..ebada22b573 100644
--- a/games/rogue/init.c
+++ b/games/rogue/init.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init.c,v 1.10 2006/03/06 04:41:18 deraadt Exp $ */
+/* $OpenBSD: init.c,v 1.11 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: init.c,v 1.4 1995/04/28 23:49:19 mycroft Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)init.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: init.c,v 1.10 2006/03/06 04:41:18 deraadt Exp $";
+static const char rcsid[] = "$OpenBSD: init.c,v 1.11 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -72,9 +72,7 @@ const char *byebye_string = "Okay, bye bye!";
gid_t gid, egid;
int
-init(argc, argv)
- int argc;
- char *argv[];
+init(int argc, char *argv[])
{
char *pn;
int seed;
@@ -130,7 +128,7 @@ init(argc, argv)
}
void
-player_init()
+player_init(void)
{
object *obj;
@@ -179,8 +177,7 @@ player_init()
}
void
-clean_up(estr)
- const char *estr;
+clean_up(const char *estr)
{
if (save_is_interactive) {
if (init_curses) {
@@ -194,7 +191,7 @@ clean_up(estr)
}
void
-start_window()
+start_window(void)
{
cbreak();
noecho();
@@ -204,14 +201,13 @@ start_window()
}
void
-stop_window()
+stop_window(void)
{
endwin();
}
void
-byebye(dummy)
- int dummy;
+byebye(int dummy)
{
md_ignore_signals();
if (ask_quit) {
@@ -223,8 +219,7 @@ byebye(dummy)
}
void
-onintr(dummy)
- int dummy;
+onintr(int dummy)
{
md_ignore_signals();
if (cant_int) {
@@ -237,8 +232,7 @@ onintr(dummy)
}
void
-error_save(dummy)
- int dummy;
+error_save(int dummy)
{
save_is_interactive = 0;
save_into_file(error_file);
@@ -246,9 +240,7 @@ error_save(dummy)
}
void
-do_args(argc, argv)
- int argc;
- char *argv[];
+do_args(int argc, char *argv[])
{
int i, j;
@@ -268,7 +260,7 @@ do_args(argc, argv)
}
void
-do_opts()
+do_opts(void)
{
char *eptr;
@@ -315,9 +307,7 @@ do_opts()
}
void
-env_get_value(s, e, add_blank)
- char **s, *e;
- boolean add_blank;
+env_get_value(char **s, char *e, boolean add_blank)
{
short i = 0;
char *t;
@@ -340,9 +330,7 @@ env_get_value(s, e, add_blank)
}
void
-init_str(str, dflt)
- char **str;
- const char *dflt;
+init_str(char **str, const char *dflt)
{
if (!(*str)) {
/* room.c:edit_opts() depends on length MAX_OPT_LEN + 2 */
diff --git a/games/rogue/inventory.c b/games/rogue/inventory.c
index 151fe5216d7..027a9e35eb6 100644
--- a/games/rogue/inventory.c
+++ b/games/rogue/inventory.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: inventory.c,v 1.8 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: inventory.c,v 1.9 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: inventory.c,v 1.3 1995/04/22 10:27:35 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)inventory.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: inventory.c,v 1.8 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: inventory.c,v 1.9 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -212,9 +212,7 @@ struct id_com_s com_id_tab[COMS] = {
};
void
-inventory(pack, mask)
- object *pack;
- unsigned short mask;
+inventory(object *pack, unsigned short mask)
{
object *obj;
short i = 0, j;
@@ -282,7 +280,7 @@ inventory(pack, mask)
}
void
-id_com()
+id_com(void)
{
int ch = 0;
short i, j, k;
@@ -359,8 +357,7 @@ MORE:
}
int
-pr_com_id(ch)
- int ch;
+pr_com_id(int ch)
{
int i;
@@ -373,9 +370,7 @@ pr_com_id(ch)
}
int
-get_com_id(indexp, ch)
- int *indexp;
- short ch;
+get_com_id(int *indexp, short ch)
{
short i;
@@ -389,8 +384,7 @@ get_com_id(indexp, ch)
}
int
-pr_motion_char(ch)
- int ch;
+pr_motion_char(int ch)
{
if ( (ch == 'J') ||
(ch == 'K') ||
@@ -428,7 +422,7 @@ pr_motion_char(ch)
}
void
-mix_colors()
+mix_colors(void)
{
short i, j, k;
char t[MAX_TITLE_LENGTH];
@@ -444,7 +438,7 @@ mix_colors()
}
void
-make_scroll_titles()
+make_scroll_titles(void)
{
short i, j, n;
short sylls, s;
@@ -478,10 +472,7 @@ static void desc_count(struct sbuf *s, int n);
static void desc_called(struct sbuf *s, const object *);
static void
-sbuf_init(s, buf, maxlen)
- struct sbuf *s;
- char *buf;
- size_t maxlen;
+sbuf_init(struct sbuf *s, char *buf, size_t maxlen)
{
s->buf = buf;
s->maxlen = maxlen;
@@ -489,9 +480,7 @@ sbuf_init(s, buf, maxlen)
}
static void
-sbuf_addstr(s, str)
- struct sbuf *s;
- const char *str;
+sbuf_addstr(struct sbuf *s, const char *str)
{
strlcat(s->buf, str, s->maxlen);
}
@@ -509,9 +498,7 @@ sbuf_addf(struct sbuf *s, const char *fmt, ...)
}
static void
-desc_count(s, n)
- struct sbuf *s;
- int n;
+desc_count(struct sbuf *s, int n)
{
if (n == 1) {
sbuf_addstr(s, "an ");
@@ -521,9 +508,7 @@ desc_count(s, n)
}
static void
-desc_called(s, obj)
- struct sbuf *s;
- const object *obj;
+desc_called(struct sbuf *s, const object *obj)
{
struct id *id_table;
@@ -534,10 +519,7 @@ desc_called(s, obj)
}
void
-get_desc(obj, desc, desclen)
- const object *obj;
- char *desc;
- size_t desclen;
+get_desc(const object *obj, char *desc, size_t desclen)
{
const char *item_name;
struct id *id_table;
@@ -680,7 +662,7 @@ get_desc(obj, desc, desclen)
}
void
-get_wand_and_ring_materials()
+get_wand_and_ring_materials(void)
{
short i, j;
boolean used[WAND_MATERIALS];
@@ -711,8 +693,7 @@ get_wand_and_ring_materials()
}
void
-single_inv(ichar)
- short ichar;
+single_inv(short ichar)
{
short ch, ch2;
char desc[DCOLS];
@@ -733,8 +714,7 @@ single_inv(ichar)
}
struct id *
-get_id_table(obj)
- const object *obj;
+get_id_table(const object *obj)
{
switch(obj->what_is) {
case SCROL:
@@ -754,8 +734,7 @@ get_id_table(obj)
}
void
-inv_armor_weapon(is_weapon)
- boolean is_weapon;
+inv_armor_weapon(boolean is_weapon)
{
if (is_weapon) {
if (rogue.weapon) {
@@ -773,7 +752,7 @@ inv_armor_weapon(is_weapon)
}
void
-id_type()
+id_type(void)
{
const char *id;
int ch;
diff --git a/games/rogue/level.c b/games/rogue/level.c
index a4fb3841778..bff445d19c7 100644
--- a/games/rogue/level.c
+++ b/games/rogue/level.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: level.c,v 1.7 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: level.c,v 1.8 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: level.c,v 1.3 1995/04/22 10:27:37 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)level.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: level.c,v 1.7 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: level.c,v 1.8 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -91,7 +91,7 @@ long level_points[MAX_EXP_LEVEL] = {
short random_rooms[MAXROOMS] = {3, 7, 5, 2, 0, 6, 1, 4, 8};
void
-make_level()
+make_level(void)
{
short i, j;
short must_1, must_2, must_3;
@@ -189,8 +189,7 @@ make_level()
}
void
-make_room(rn, r1, r2, r3)
- short rn, r1, r2, r3;
+make_room(short rn, short r1, short r2, short r3)
{
short left_col, right_col, top_row, bottom_row;
short width, height;
@@ -302,8 +301,7 @@ END:
}
int
-connect_rooms(room1, room2)
- short room1, room2;
+connect_rooms(short room1, short room2)
{
short row1, col1, row2, col2, dir;
@@ -350,7 +348,7 @@ connect_rooms(room1, room2)
}
void
-clear_level()
+clear_level(void)
{
short i, j;
@@ -377,10 +375,7 @@ clear_level()
}
void
-put_door(rm, dir, row, col)
- room *rm;
- short dir;
- short *row, *col;
+put_door(room *rm, short dir, short *row, short *col)
{
short wall_width;
@@ -415,8 +410,7 @@ put_door(rm, dir, row, col)
}
void
-draw_simple_passage(row1, col1, row2, col2, dir)
- short row1, col1, row2, col2, dir;
+draw_simple_passage(short row1, short col1, short row2, short col2, short dir)
{
short i, middle, t;
@@ -457,21 +451,19 @@ draw_simple_passage(row1, col1, row2, col2, dir)
}
int
-same_row(room1, room2)
- int room1, room2;
+same_row(int room1, int room2)
{
return((room1 / 3) == (room2 / 3));
}
int
-same_col(room1, room2)
- int room1, room2;
+same_col(int room1, int room2)
{
return((room1 % 3) == (room2 % 3));
}
void
-add_mazes()
+add_mazes(void)
{
short i, j;
short start;
@@ -503,7 +495,7 @@ add_mazes()
}
void
-fill_out_level()
+fill_out_level(void)
{
short i, rn;
@@ -524,9 +516,7 @@ fill_out_level()
}
void
-fill_it(rn, do_rec_de)
- int rn;
- boolean do_rec_de;
+fill_it(int rn, boolean do_rec_de)
{
short i, tunnel_dir, door_dir, drow, dcol;
short target_room, rooms_found = 0;
@@ -586,10 +576,7 @@ fill_it(rn, do_rec_de)
}
void
-recursive_deadend(rn, offsets, srow, scol)
- short rn;
- short *offsets;
- short srow, scol;
+recursive_deadend(short rn, short *offsets, short srow, short scol)
{
short i, de;
short drow, dcol, tunnel_dir;
@@ -622,10 +609,7 @@ recursive_deadend(rn, offsets, srow, scol)
}
boolean
-mask_room(rn, row, col, mask)
- short rn;
- short *row, *col;
- unsigned short mask;
+mask_room(short rn, short *row, short *col, unsigned short mask)
{
short i, j;
@@ -642,8 +626,7 @@ mask_room(rn, row, col, mask)
}
void
-make_maze(r, c, tr, br, lc, rc)
- short r, c, tr, br, lc, rc;
+make_maze(short r, short c, short tr, short br, short lc, short rc)
{
char dirs[4];
short i, t;
@@ -708,8 +691,7 @@ make_maze(r, c, tr, br, lc, rc)
}
void
-hide_boxed_passage(row1, col1, row2, col2, n)
- short row1, col1, row2, col2, n;
+hide_boxed_passage(short row1, short col1, short row2, short col2, short n)
{
short i, j, t;
short row, col, row_cut, col_cut;
@@ -744,8 +726,7 @@ hide_boxed_passage(row1, col1, row2, col2, n)
}
void
-put_player(nr)
- short nr; /* try not to put in this room */
+put_player(short nr) /* try not to put in this room */
{
short rn = nr, misses;
short row, col;
@@ -777,7 +758,7 @@ put_player(nr)
}
int
-drop_check()
+drop_check(void)
{
if (wizard) {
return(1);
@@ -794,7 +775,7 @@ drop_check()
}
int
-check_up()
+check_up(void)
{
if (!wizard) {
if (!(dungeon[rogue.row][rogue.col] & STAIRS)) {
@@ -817,9 +798,7 @@ check_up()
}
void
-add_exp(e, promotion)
- int e;
- boolean promotion;
+add_exp(int e, boolean promotion)
{
short new_exp;
short i, hp;
@@ -847,8 +826,7 @@ add_exp(e, promotion)
}
int
-get_exp_level(e)
- long e;
+get_exp_level(long e)
{
short i;
@@ -861,7 +839,7 @@ get_exp_level(e)
}
int
-hp_raise()
+hp_raise(void)
{
int hp;
@@ -870,7 +848,7 @@ hp_raise()
}
void
-show_average_hp()
+show_average_hp(void)
{
float real_average;
float effective_average;
@@ -888,7 +866,7 @@ show_average_hp()
}
void
-mix_random_rooms()
+mix_random_rooms(void)
{
short i, t;
short x, y;
diff --git a/games/rogue/machdep.c b/games/rogue/machdep.c
index 757b2d0f44f..90cfc59f09c 100644
--- a/games/rogue/machdep.c
+++ b/games/rogue/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.10 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: machdep.c,v 1.11 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: machdep.c,v 1.5 1995/04/28 23:49:22 mycroft Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)machdep.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: machdep.c,v 1.10 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: machdep.c,v 1.11 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -82,7 +82,7 @@ static const char rcsid[] = "$OpenBSD: machdep.c,v 1.10 2004/01/21 19:12:13 espi
*/
void
-md_slurp()
+md_slurp(void)
{
(void)fpurge(stdin);
}
@@ -104,7 +104,7 @@ md_slurp()
*/
void
-md_heed_signals()
+md_heed_signals(void)
{
signal(SIGINT, onintr);
signal(SIGQUIT, byebye);
@@ -124,7 +124,7 @@ md_heed_signals()
*/
void
-md_ignore_signals()
+md_ignore_signals(void)
{
signal(SIGQUIT, SIG_IGN);
signal(SIGINT, SIG_IGN);
@@ -141,8 +141,7 @@ md_ignore_signals()
*/
int
-md_get_file_id(fname)
- const char *fname;
+md_get_file_id(const char *fname)
{
struct stat sbuf;
@@ -161,8 +160,7 @@ md_get_file_id(fname)
*/
int
-md_link_count(fname)
- char *fname;
+md_link_count(char *fname)
{
struct stat sbuf;
@@ -185,8 +183,7 @@ md_link_count(fname)
*/
void
-md_gct(rt_buf)
- struct rogue_time *rt_buf;
+md_gct(struct rogue_time *rt_buf)
{
struct tm *t;
time_t seconds;
@@ -219,9 +216,7 @@ md_gct(rt_buf)
*/
void
-md_gfmt(fname, rt_buf)
- char *fname;
- struct rogue_time *rt_buf;
+md_gfmt(char *fname, struct rogue_time *rt_buf)
{
struct stat sbuf;
time_t seconds;
@@ -251,8 +246,7 @@ md_gfmt(fname, rt_buf)
*/
boolean
-md_df(fname)
- const char *fname;
+md_df(const char *fname)
{
if (unlink(fname)) {
return(0);
@@ -270,7 +264,7 @@ md_df(fname)
*/
char *
-md_gln()
+md_gln(void)
{
struct passwd *p;
@@ -289,8 +283,7 @@ md_gln()
*/
void
-md_sleep(nsecs)
- int nsecs;
+md_sleep(int nsecs)
{
(void) sleep(nsecs);
}
@@ -318,8 +311,7 @@ md_sleep(nsecs)
*/
char *
-md_getenv(name)
- const char *name;
+md_getenv(const char *name)
{
char *value;
@@ -337,8 +329,7 @@ md_getenv(name)
*/
char *
-md_malloc(n)
- int n;
+md_malloc(int n)
{
char *t;
@@ -365,7 +356,7 @@ md_malloc(n)
*/
int
-md_gseed()
+md_gseed(void)
{
return(getpid());
}
@@ -378,8 +369,7 @@ md_gseed()
*/
void
-md_exit(status)
- int status;
+md_exit(int status)
{
exit(status);
}
@@ -396,8 +386,7 @@ md_exit(status)
*/
void
-md_lock(l)
- boolean l;
+md_lock(boolean l)
{
extern gid_t gid, egid;
static int fd;
@@ -433,8 +422,7 @@ md_lock(l)
*/
void
-md_shell(shell)
- const char *shell;
+md_shell(const char *shell)
{
int w;
pid_t pid;
diff --git a/games/rogue/main.c b/games/rogue/main.c
index d7512b836c9..944230708a8 100644
--- a/games/rogue/main.c
+++ b/games/rogue/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.5 2003/06/03 03:01:41 millert Exp $ */
+/* $OpenBSD: main.c,v 1.6 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: main.c,v 1.3 1995/04/22 10:27:41 cgd Exp $ */
/*
@@ -43,7 +43,7 @@ static const char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: main.c,v 1.5 2003/06/03 03:01:41 millert Exp $";
+static const char rcsid[] = "$OpenBSD: main.c,v 1.6 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -62,9 +62,7 @@ static const char rcsid[] = "$OpenBSD: main.c,v 1.5 2003/06/03 03:01:41 millert
#include "rogue.h"
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
if (init(argc, argv)) { /* restored game */
goto PL;
diff --git a/games/rogue/message.c b/games/rogue/message.c
index d15f4859448..5d5691afaef 100644
--- a/games/rogue/message.c
+++ b/games/rogue/message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: message.c,v 1.11 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: message.c,v 1.12 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: message.c,v 1.5 1995/04/22 10:27:43 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)message.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: message.c,v 1.11 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: message.c,v 1.12 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -67,9 +67,7 @@ const char *more = "-more-";
static void message(const char *, boolean);
static void
-message(msg, intrpt)
- const char *msg;
- boolean intrpt;
+message(const char *msg, boolean intrpt)
{
cant_int = 1;
@@ -119,8 +117,7 @@ messagef(boolean intrpt, const char *fmt, ...)
}
void
-remessage(c)
- short c;
+remessage(short c)
{
if (imsg != -1) {
check_message();
@@ -136,7 +133,7 @@ remessage(c)
}
void
-check_message()
+check_message(void)
{
if (msg_cleared) {
return;
@@ -148,14 +145,9 @@ check_message()
}
int
-get_input_line(prompt, insert, buf, buflen, if_cancelled, add_blank, do_echo)
- const char *prompt;
- const char *insert;
- char *buf;
- size_t buflen;
- const char *if_cancelled;
- boolean add_blank;
- boolean do_echo;
+get_input_line(const char *prompt, const char *insert, char *buf,
+ size_t buflen, const char *if_cancelled, boolean add_blank,
+ boolean do_echo)
{
int ch;
int i = 0, n;
@@ -210,7 +202,7 @@ get_input_line(prompt, insert, buf, buflen, if_cancelled, add_blank, do_echo)
}
int
-rgetchar()
+rgetchar(void)
{
int ch;
@@ -239,8 +231,7 @@ Level: 99 Gold: 999999 Hp: 999(999) Str: 99(99) Arm: 99 Exp: 21/10000000 Hungry
*/
void
-print_stats(stat_mask)
- int stat_mask;
+print_stats(int stat_mask)
{
char buf[16];
boolean label;
@@ -319,7 +310,7 @@ print_stats(stat_mask)
}
void
-save_screen()
+save_screen(void)
{
FILE *fp;
short i, j;
@@ -343,17 +334,13 @@ save_screen()
}
boolean
-is_digit(ch)
- short ch;
+is_digit(short ch)
{
return((ch >= '0') && (ch <= '9'));
}
int
-r_index(str, ch, last)
- const char *str;
- int ch;
- boolean last;
+r_index(const char *str, int ch, boolean last)
{
int i = 0;
diff --git a/games/rogue/monster.c b/games/rogue/monster.c
index 33ffab12a42..eab29297b60 100644
--- a/games/rogue/monster.c
+++ b/games/rogue/monster.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: monster.c,v 1.7 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: monster.c,v 1.8 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: monster.c,v 1.3 1995/04/22 10:27:45 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)monster.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: monster.c,v 1.7 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: monster.c,v 1.8 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -143,7 +143,7 @@ object mon_tab[MONSTERS] = {
};
void
-put_mons()
+put_mons(void)
{
short i;
short n;
@@ -163,9 +163,7 @@ put_mons()
}
object *
-gr_monster(monster, mn)
- object *monster;
- int mn;
+gr_monster(object *monster, int mn)
{
if (!monster) {
monster = alloc_object();
@@ -190,7 +188,7 @@ gr_monster(monster, mn)
}
void
-mv_mons()
+mv_mons(void)
{
object *monster, *next_monster;
boolean flew;
@@ -236,8 +234,7 @@ NM: monster = next_monster;
}
void
-party_monsters(rn, n)
- int rn, n;
+party_monsters(int rn, int n)
{
short i, j;
short row, col;
@@ -277,8 +274,7 @@ party_monsters(rn, n)
}
char
-gmc_row_col(row, col)
- short row, col;
+gmc_row_col(short row, short col)
{
object *monster;
@@ -297,8 +293,7 @@ gmc_row_col(row, col)
}
char
-gmc(monster)
- object *monster;
+gmc(object *monster)
{
if ((!(detect_monster || see_invisible || r_see_invisible) &&
(monster->m_flags & INVISIBLE))
@@ -312,9 +307,7 @@ gmc(monster)
}
void
-mv_1_monster(monster, row, col)
- object *monster;
- short row, col;
+mv_1_monster(object *monster, short row, short col)
{
short i, n;
boolean tried[6];
@@ -452,9 +445,7 @@ O:
}
int
-mtry(monster, row, col)
- object *monster;
- short row, col;
+mtry(object *monster, short row, short col)
{
if (mon_can_go(monster, row, col)) {
move_mon_to(monster, row, col);
@@ -464,9 +455,7 @@ mtry(monster, row, col)
}
void
-move_mon_to(monster, row, col)
- object *monster;
- short row, col;
+move_mon_to(object *monster, short row, short col)
{
short c;
short mrow, mcol;
@@ -515,9 +504,7 @@ move_mon_to(monster, row, col)
}
int
-mon_can_go(monster, row, col)
- object *monster;
- short row, col;
+mon_can_go(object *monster, short row, short col)
{
object *obj;
short dr, dc;
@@ -557,8 +544,7 @@ mon_can_go(monster, row, col)
}
void
-wake_up(monster)
- object *monster;
+wake_up(object *monster)
{
if (!(monster->m_flags & NAPPING)) {
monster->m_flags &= (~(ASLEEP | IMITATES | WAKENS));
@@ -566,10 +552,7 @@ wake_up(monster)
}
void
-wake_room(rn, entering, row, col)
- short rn;
- boolean entering;
- short row, col;
+wake_room(short rn, boolean entering, short row, short col)
{
object *monster;
short wake_percent;
@@ -603,8 +586,7 @@ wake_room(rn, entering, row, col)
}
const char *
-mon_name(monster)
- object *monster;
+mon_name(object *monster)
{
short ch;
@@ -621,8 +603,7 @@ mon_name(monster)
}
int
-rogue_is_around(row, col)
- short row, col;
+rogue_is_around(short row, short col)
{
short rdif, cdif, retval;
@@ -634,7 +615,7 @@ rogue_is_around(row, col)
}
void
-wanderer()
+wanderer(void)
{
object *monster;
short row, col, i;
@@ -665,7 +646,7 @@ wanderer()
}
void
-show_monsters()
+show_monsters(void)
{
object *monster;
@@ -687,7 +668,7 @@ show_monsters()
}
void
-create_monster()
+create_monster(void)
{
short row, col;
short i;
@@ -723,9 +704,7 @@ create_monster()
}
void
-put_m_at(row, col, monster)
- short row, col;
- object *monster;
+put_m_at(short row, short col, object *monster)
{
monster->row = row;
monster->col = col;
@@ -736,8 +715,7 @@ put_m_at(row, col, monster)
}
void
-aim_monster(monster)
- object *monster;
+aim_monster(object *monster)
{
short i, rn, d, r;
@@ -755,8 +733,7 @@ aim_monster(monster)
}
int
-rogue_can_see(row, col)
- short row, col;
+rogue_can_see(short row, short col)
{
int retval;
@@ -769,8 +746,7 @@ rogue_can_see(row, col)
}
int
-move_confused(monster)
- object *monster;
+move_confused(object *monster)
{
short i, row, col;
@@ -800,8 +776,7 @@ move_confused(monster)
}
int
-flit(monster)
- object *monster;
+flit(object *monster)
{
short i, row, col;
@@ -827,7 +802,7 @@ flit(monster)
}
char
-gr_obj_char()
+gr_obj_char(void)
{
short r;
const char *rs = "%!?]=/):*";
@@ -838,8 +813,7 @@ gr_obj_char()
}
int
-no_room_for_monster(rn)
- int rn;
+no_room_for_monster(int rn)
{
short i, j;
@@ -854,7 +828,7 @@ no_room_for_monster(rn)
}
void
-aggravate()
+aggravate(void)
{
object *monster;
@@ -873,9 +847,7 @@ aggravate()
}
boolean
-mon_sees(monster, row, col)
- object *monster;
- short row, col;
+mon_sees(object *monster, short row, short col)
{
short rn, rdif, cdif, retval;
@@ -894,7 +866,7 @@ mon_sees(monster, row, col)
}
void
-mv_aquatars()
+mv_aquatars(void)
{
object *monster;
diff --git a/games/rogue/move.c b/games/rogue/move.c
index ba205444d84..1d1fad677cb 100644
--- a/games/rogue/move.c
+++ b/games/rogue/move.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: move.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: move.c,v 1.7 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: move.c,v 1.3 1995/04/22 10:27:47 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: move.c,v 1.6 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: move.c,v 1.7 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -60,8 +60,7 @@ boolean jump = 0;
const char *you_can_move_again = "you can move again";
int
-one_move_rogue(dirch, pickup)
- short dirch, pickup;
+one_move_rogue(short dirch, short pickup)
{
short row, col;
object *obj;
@@ -170,8 +169,7 @@ MVED: if (reg_move()) { /* fainted from hunger */
}
void
-multiple_move_rogue(dirch)
- short dirch;
+multiple_move_rogue(short dirch)
{
short row, col;
short m;
@@ -218,8 +216,7 @@ multiple_move_rogue(dirch)
}
boolean
-is_passable(row, col)
- short row, col;
+is_passable(short row, short col)
{
if ((row < MIN_ROW) || (row > (DROWS - 2)) || (col < 0) ||
(col > (DCOLS-1))) {
@@ -232,8 +229,7 @@ is_passable(row, col)
}
boolean
-next_to_something(drow, dcol)
- short drow, dcol;
+next_to_something(short drow, short dcol)
{
short i, j, i_end, j_end, row, col;
short pass_count = 0;
@@ -294,8 +290,7 @@ next_to_something(drow, dcol)
}
boolean
-can_move(row1, col1, row2, col2)
- short row1, col1, row2, col2;
+can_move(short row1, short col1, short row2, short col2)
{
if (!is_passable(row2, col2)) {
return(0);
@@ -312,7 +307,7 @@ can_move(row1, col1, row2, col2)
}
void
-move_onto()
+move_onto(void)
{
short ch, d;
boolean first_miss = 1;
@@ -331,9 +326,7 @@ move_onto()
}
boolean
-is_direction(c, d)
- short c;
- short *d;
+is_direction(short c, short *d)
{
switch(c) {
case 'h':
@@ -369,8 +362,7 @@ is_direction(c, d)
}
boolean
-check_hunger(msg_only)
- boolean msg_only;
+check_hunger(boolean msg_only)
{
short i, n;
boolean fainted = 0;
@@ -438,7 +430,7 @@ check_hunger(msg_only)
}
boolean
-reg_move()
+reg_move(void)
{
boolean fainted;
@@ -495,8 +487,7 @@ reg_move()
}
void
-rest(count)
- int count;
+rest(int count)
{
int i;
@@ -511,7 +502,7 @@ rest(count)
}
char
-gr_dir()
+gr_dir(void)
{
short d;
@@ -547,7 +538,7 @@ gr_dir()
}
void
-heal()
+heal(void)
{
static short heal_exp = -1, n, c = 0;
static boolean alt;
@@ -612,8 +603,7 @@ heal()
}
boolean
-can_turn(nrow, ncol)
- short nrow, ncol;
+can_turn(short nrow, short ncol)
{
if ((dungeon[nrow][ncol] & TUNNEL) && is_passable(nrow, ncol)) {
return(1);
@@ -622,9 +612,7 @@ can_turn(nrow, ncol)
}
void
-turn_passage(dir, fast)
- short dir;
- boolean fast;
+turn_passage(short dir, boolean fast)
{
short crow = rogue.row, ccol = rogue.col, turns = 0;
short ndir = 0;
diff --git a/games/rogue/object.c b/games/rogue/object.c
index 53aa464d9a0..f6d7c8ede94 100644
--- a/games/rogue/object.c
+++ b/games/rogue/object.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: object.c,v 1.9 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: object.c,v 1.10 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: object.c,v 1.3 1995/04/22 10:27:50 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)object.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: object.c,v 1.9 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: object.c,v 1.10 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -162,7 +162,7 @@ struct id id_rings[RINGS] = {
};
void
-put_objects()
+put_objects(void)
{
short i, n;
object *obj;
@@ -185,7 +185,7 @@ put_objects()
}
void
-put_gold()
+put_gold(void)
{
short i, j;
short row,col;
@@ -215,9 +215,7 @@ put_gold()
}
void
-plant_gold(row, col, is_maze)
- short row, col;
- boolean is_maze;
+plant_gold(short row, short col, boolean is_maze)
{
object *obj;
@@ -233,9 +231,7 @@ plant_gold(row, col, is_maze)
}
void
-place_at(obj, row, col)
- object *obj;
- short row, col;
+place_at(object *obj, short row, short col)
{
obj->row = row;
obj->col = col;
@@ -244,9 +240,7 @@ place_at(obj, row, col)
}
object *
-object_at(pack, row, col)
- object *pack;
- short row, col;
+object_at(object *pack, short row, short col)
{
object *obj = (object *) 0;
@@ -264,8 +258,7 @@ object_at(pack, row, col)
}
object *
-get_letter_object(ch)
- int ch;
+get_letter_object(int ch)
{
object *obj;
@@ -278,8 +271,7 @@ get_letter_object(ch)
}
void
-free_stuff(objlist)
- object *objlist;
+free_stuff(object *objlist)
{
object *obj;
@@ -292,8 +284,7 @@ free_stuff(objlist)
}
const char *
-name_of(obj)
- const object *obj;
+name_of(const object *obj)
{
const char *retstring;
@@ -349,7 +340,7 @@ name_of(obj)
}
object *
-gr_object()
+gr_object(void)
{
object *obj;
@@ -388,7 +379,7 @@ gr_object()
}
unsigned short
-gr_what_is()
+gr_what_is(void)
{
short percent;
unsigned short what_is;
@@ -414,8 +405,7 @@ gr_what_is()
}
void
-gr_scroll(obj)
- object *obj;
+gr_scroll(object *obj)
{
short percent;
@@ -453,8 +443,7 @@ gr_scroll(obj)
}
void
-gr_potion(obj)
- object *obj;
+gr_potion(object *obj)
{
short percent;
@@ -494,9 +483,7 @@ gr_potion(obj)
}
void
-gr_weapon(obj, assign_wk)
- object *obj;
- int assign_wk;
+gr_weapon(object *obj, int assign_wk)
{
short percent;
short i;
@@ -560,8 +547,7 @@ gr_weapon(obj, assign_wk)
}
void
-gr_armor(obj)
- object *obj;
+gr_armor(object *obj)
{
short percent;
short blessing;
@@ -587,8 +573,7 @@ gr_armor(obj)
}
void
-gr_wand(obj)
- object *obj;
+gr_wand(object *obj)
{
obj->what_is = WAND;
obj->which_kind = get_rand(0, (WANDS - 1));
@@ -596,9 +581,7 @@ gr_wand(obj)
}
void
-get_food(obj, force_ration)
- object *obj;
- boolean force_ration;
+get_food(object *obj, boolean force_ration)
{
obj->what_is = FOOD;
@@ -610,7 +593,7 @@ get_food(obj, force_ration)
}
void
-put_stairs()
+put_stairs(void)
{
short row, col;
@@ -619,8 +602,7 @@ put_stairs()
}
int
-get_armor_class(obj)
- const object *obj;
+get_armor_class(const object *obj)
{
if (obj) {
return(obj->class + obj->d_enchant);
@@ -629,7 +611,7 @@ get_armor_class(obj)
}
object *
-alloc_object()
+alloc_object(void)
{
object *obj;
@@ -650,15 +632,14 @@ alloc_object()
}
void
-free_object(obj)
- object *obj;
+free_object(object *obj)
{
obj->next_object = free_list;
free_list = obj;
}
void
-make_party()
+make_party(void)
{
short n;
@@ -671,7 +652,7 @@ make_party()
}
void
-show_objects()
+show_objects(void)
{
object *obj;
short mc, rc, row, col;
@@ -710,7 +691,7 @@ show_objects()
}
void
-put_amulet()
+put_amulet(void)
{
object *obj;
@@ -720,8 +701,7 @@ put_amulet()
}
void
-rand_place(obj)
- object *obj;
+rand_place(object *obj)
{
short row, col;
@@ -730,7 +710,7 @@ rand_place(obj)
}
void
-c_object_for_wizard()
+c_object_for_wizard(void)
{
short ch, max, wk;
object *obj;
diff --git a/games/rogue/pack.c b/games/rogue/pack.c
index 56c9314bab4..d4d39fe3c71 100644
--- a/games/rogue/pack.c
+++ b/games/rogue/pack.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pack.c,v 1.10 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: pack.c,v 1.11 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: pack.c,v 1.3 1995/04/22 10:27:54 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)pack.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: pack.c,v 1.10 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: pack.c,v 1.11 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -58,9 +58,7 @@ static const char rcsid[] = "$OpenBSD: pack.c,v 1.10 2004/01/21 19:12:13 espie E
const char *curse_message = "you can't, it appears to be cursed";
object *
-add_to_pack(obj, pack, condense)
- object *obj, *pack;
- int condense;
+add_to_pack(object *obj, object *pack, int condense)
{
object *op;
@@ -87,8 +85,7 @@ add_to_pack(obj, pack, condense)
}
void
-take_from_pack(obj, pack)
- object *obj, *pack;
+take_from_pack(object *obj, object *pack)
{
while (pack->next_object != obj) {
pack = pack->next_object;
@@ -101,8 +98,7 @@ take_from_pack(obj, pack)
*/
object *
-pick_up(row, col, status)
- short row, col, *status;
+pick_up(short row, short col, short *status)
{
object *obj;
@@ -148,7 +144,7 @@ pick_up(row, col, status)
}
void
-drop()
+drop(void)
{
object *obj, *new;
short ch;
@@ -210,8 +206,7 @@ drop()
}
object *
-check_duplicate(obj, pack)
- object *obj, *pack;
+check_duplicate(object *obj, object *pack)
{
object *op;
@@ -244,7 +239,7 @@ check_duplicate(obj, pack)
}
short
-next_avail_ichar()
+next_avail_ichar(void)
{
object *obj;
int i;
@@ -270,15 +265,13 @@ next_avail_ichar()
}
void
-wait_for_ack()
+wait_for_ack(void)
{
while (rgetchar() != ' ') ;
}
short
-pack_letter(prompt, mask)
- const char *prompt;
- unsigned short mask;
+pack_letter(const char *prompt, unsigned short mask)
{
short ch;
unsigned short tmask = mask;
@@ -314,7 +307,7 @@ pack_letter(prompt, mask)
}
void
-take_off()
+take_off(void)
{
char desc[DCOLS];
object *obj;
@@ -337,7 +330,7 @@ take_off()
}
void
-wear()
+wear(void)
{
short ch;
object *obj;
@@ -370,8 +363,7 @@ wear()
}
void
-unwear(obj)
- object *obj;
+unwear(object *obj)
{
if (obj) {
obj->in_use_flags &= (~BEING_WORN);
@@ -380,8 +372,7 @@ unwear(obj)
}
void
-do_wear(obj)
- object *obj;
+do_wear(object *obj)
{
rogue.armor = obj;
obj->in_use_flags |= BEING_WORN;
@@ -389,7 +380,7 @@ do_wear(obj)
}
void
-wield()
+wield(void)
{
short ch;
object *obj;
@@ -425,16 +416,14 @@ wield()
}
void
-do_wield(obj)
- object *obj;
+do_wield(object *obj)
{
rogue.weapon = obj;
obj->in_use_flags |= BEING_WIELDED;
}
void
-unwield(obj)
- object *obj;
+unwield(object *obj)
{
if (obj) {
obj->in_use_flags &= (~BEING_WIELDED);
@@ -443,7 +432,7 @@ unwield(obj)
}
void
-call_it()
+call_it(void)
{
short ch;
object *obj;
@@ -474,8 +463,7 @@ call_it()
}
short
-pack_count(new_obj)
- object *new_obj;
+pack_count(object *new_obj)
{
object *obj;
short count = 0;
@@ -502,9 +490,7 @@ pack_count(new_obj)
}
boolean
-mask_pack(pack, mask)
- object *pack;
- unsigned short mask;
+mask_pack(object *pack, unsigned short mask)
{
while (pack->next_object) {
pack = pack->next_object;
@@ -516,9 +502,7 @@ mask_pack(pack, mask)
}
boolean
-is_pack_letter(c, mask)
- short *c;
- unsigned short *mask;
+is_pack_letter(short *c, unsigned short *mask)
{
if (((*c == '?') || (*c == '!') || (*c == ':') || (*c == '=') ||
(*c == ')') || (*c == ']') || (*c == '/') || (*c == ','))) {
@@ -555,13 +539,13 @@ is_pack_letter(c, mask)
}
boolean
-has_amulet()
+has_amulet(void)
{
return(mask_pack(&rogue.pack, AMULET));
}
void
-kick_into_pack()
+kick_into_pack(void)
{
object *obj;
char desc[DCOLS];
diff --git a/games/rogue/play.c b/games/rogue/play.c
index 6f7cfecf90e..450e7d98c1a 100644
--- a/games/rogue/play.c
+++ b/games/rogue/play.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: play.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: play.c,v 1.7 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: play.c,v 1.3 1995/04/22 10:28:04 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)play.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: play.c,v 1.6 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: play.c,v 1.7 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -59,7 +59,7 @@ boolean interrupted = 0;
const char *unknown_command = "unknown command";
void
-play_level()
+play_level(void)
{
short ch;
int count;
diff --git a/games/rogue/random.c b/games/rogue/random.c
index dd1bc7dd1eb..f35b2ccc1e7 100644
--- a/games/rogue/random.c
+++ b/games/rogue/random.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: random.c,v 1.5 2003/06/03 03:01:41 millert Exp $ */
+/* $OpenBSD: random.c,v 1.6 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: random.c,v 1.3 1995/04/22 10:28:06 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)random.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: random.c,v 1.5 2003/06/03 03:01:41 millert Exp $";
+static const char rcsid[] = "$OpenBSD: random.c,v 1.6 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -74,8 +74,7 @@ static int rand_sep = 3;
static long *end_ptr = &rntb[32];
void
-srrandom(x)
- int x;
+srrandom(int x)
{
int i;
@@ -93,7 +92,7 @@ srrandom(x)
}
long
-rrandom()
+rrandom(void)
{
long i;
@@ -115,8 +114,7 @@ rrandom()
}
int
-get_rand(x, y)
- int x, y;
+get_rand(int x, int y)
{
int r, t;
long lr;
@@ -134,14 +132,13 @@ get_rand(x, y)
}
int
-rand_percent(percentage)
- int percentage;
+rand_percent(int percentage)
{
return(get_rand(1, 100) <= percentage);
}
int
-coin_toss()
+coin_toss(void)
{
return(((rrandom() & 01) ? 1 : 0));
}
diff --git a/games/rogue/ring.c b/games/rogue/ring.c
index 0f8ea99f1a3..f76813e3b2c 100644
--- a/games/rogue/ring.c
+++ b/games/rogue/ring.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ring.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: ring.c,v 1.7 2006/03/08 09:44:35 otto Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -36,7 +36,7 @@
#if 0
static char sccsid[] = "@(#)ring.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: ring.c,v 1.6 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: ring.c,v 1.7 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -69,7 +69,7 @@ boolean sustain_strength;
boolean maintain_armor;
void
-put_on_ring()
+put_on_ring(void)
{
short ch;
char desc[DCOLS];
@@ -130,9 +130,7 @@ put_on_ring()
*/
void
-do_put_on(ring, on_left)
- object *ring;
- boolean on_left;
+do_put_on(object *ring, boolean on_left)
{
if (on_left) {
ring->in_use_flags |= ON_LEFT_HAND;
@@ -144,7 +142,7 @@ do_put_on(ring, on_left)
}
void
-remove_ring()
+remove_ring(void)
{
boolean left = 0, right = 0;
short ch;
@@ -194,8 +192,7 @@ remove_ring()
}
void
-un_put_on(ring)
- object *ring;
+un_put_on(object *ring)
{
if (ring && (ring->in_use_flags & ON_LEFT_HAND)) {
ring->in_use_flags &= (~ON_LEFT_HAND);
@@ -208,9 +205,7 @@ un_put_on(ring)
}
void
-gr_ring(ring, assign_wk)
- object *ring;
- boolean assign_wk;
+gr_ring(object *ring, boolean assign_wk)
{
ring->what_is = RING;
if (assign_wk) {
@@ -250,7 +245,7 @@ gr_ring(ring, assign_wk)
}
void
-inv_rings()
+inv_rings(void)
{
char buf[DCOLS];
@@ -275,8 +270,7 @@ inv_rings()
}
void
-ring_stats(pr)
- boolean pr;
+ring_stats(boolean pr)
{
short i;
object *ring;
diff --git a/games/rogue/room.c b/games/rogue/room.c
index 44382a78b85..7a8f439e8c8 100644
--- a/games/rogue/room.c
+++ b/games/rogue/room.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: room.c,v 1.8 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: room.c,v 1.9 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: room.c,v 1.3 1995/04/22 10:28:17 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)room.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: room.c,v 1.8 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: room.c,v 1.9 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -97,8 +97,7 @@ const struct option {
};
void
-light_up_room(rn)
- int rn;
+light_up_room(int rn)
{
short i, j;
@@ -125,8 +124,7 @@ light_up_room(rn)
}
void
-light_passage(row, col)
- short row, col;
+light_passage(short row, short col)
{
short i, j, i_end, j_end;
@@ -146,8 +144,7 @@ light_passage(row, col)
}
void
-darken_room(rn)
- short rn;
+darken_room(short rn)
{
short i, j;
@@ -171,8 +168,7 @@ darken_room(rn)
}
char
-get_dungeon_char(row, col)
- short row, col;
+get_dungeon_char(short row, short col)
{
unsigned short mask = dungeon[row][col];
@@ -220,8 +216,7 @@ get_dungeon_char(row, col)
}
char
-get_mask_char(mask)
- unsigned short mask;
+get_mask_char(unsigned short mask)
{
switch(mask) {
case SCROL:
@@ -248,9 +243,7 @@ get_mask_char(mask)
}
void
-gr_row_col(row, col, mask)
- short *row, *col;
- unsigned short mask;
+gr_row_col(short *row, short *col, unsigned short mask)
{
short rn;
short r, c;
@@ -270,7 +263,7 @@ gr_row_col(row, col, mask)
}
short
-gr_room()
+gr_room(void)
{
short i;
@@ -282,8 +275,7 @@ gr_room()
}
short
-party_objects(rn)
- int rn;
+party_objects(int rn)
{
short i, j, nf = 0;
object *obj;
@@ -316,8 +308,7 @@ party_objects(rn)
}
short
-get_room_number(row, col)
- short row, col;
+get_room_number(short row, short col)
{
short i;
@@ -331,7 +322,7 @@ get_room_number(row, col)
}
boolean
-is_all_connected()
+is_all_connected(void)
{
short i, starting_room;
@@ -354,8 +345,7 @@ is_all_connected()
}
void
-visit_rooms(rn)
- int rn;
+visit_rooms(int rn)
{
short i;
short oth_rn;
@@ -371,7 +361,7 @@ visit_rooms(rn)
}
void
-draw_magic_map()
+draw_magic_map(void)
{
short i, j, ch, och;
unsigned short mask = (HORWALL | VERTWALL | DOOR | TUNNEL | TRAP | STAIRS |
@@ -419,10 +409,7 @@ draw_magic_map()
}
void
-dr_course(monster, entering, row, col)
- object *monster;
- boolean entering;
- short row, col;
+dr_course(object *monster, boolean entering, short row, short col)
{
short i, j, k, rn;
short r, rr;
@@ -494,8 +481,7 @@ dr_course(monster, entering, row, col)
}
boolean
-get_oth_room(rn, row, col)
- short rn, *row, *col;
+get_oth_room(short rn, short *row, short *col)
{
short d = -1;
@@ -517,7 +503,7 @@ get_oth_room(rn, row, col)
}
void
-edit_opts()
+edit_opts(void)
{
char save[NOPTS+1][DCOLS];
short i, j;
@@ -622,8 +608,7 @@ CH:
}
void
-opt_show(i)
- int i;
+opt_show(int i)
{
const char *s;
const struct option *opt = &options[i];
@@ -639,8 +624,7 @@ opt_show(i)
}
void
-opt_erase(i)
- int i;
+opt_erase(int i)
{
const struct option *opt = &options[i];
@@ -649,14 +633,13 @@ opt_erase(i)
}
void
-opt_go(i)
- int i;
+opt_go(int i)
{
move(i, strlen(options[i].prompt));
}
void
-do_shell()
+do_shell(void)
{
const char *sh;
diff --git a/games/rogue/save.c b/games/rogue/save.c
index b179417c566..1dd64a2afc7 100644
--- a/games/rogue/save.c
+++ b/games/rogue/save.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: save.c,v 1.11 2006/03/06 17:28:58 henning Exp $ */
+/* $OpenBSD: save.c,v 1.12 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: save.c,v 1.3 1995/04/22 10:28:21 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)save.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: save.c,v 1.11 2006/03/06 17:28:58 henning Exp $";
+static const char rcsid[] = "$OpenBSD: save.c,v 1.12 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -77,7 +77,7 @@ static boolean has_been_touched(struct rogue_time *, struct rogue_time *);
void
-save_game()
+save_game(void)
{
char fname[MAXPATHLEN];
@@ -91,8 +91,7 @@ save_game()
}
void
-save_into_file(sfile)
- const char *sfile;
+save_into_file(const char *sfile)
{
int fp;
int file_id;
@@ -170,8 +169,7 @@ save_into_file(sfile)
}
void
-restore(fname)
- char *fname;
+restore(char *fname)
{
int fp;
struct rogue_time saved_time, mod_time;
@@ -252,9 +250,7 @@ restore(fname)
}
static void
-write_pack(pack, fp)
- object *pack;
- int fp;
+write_pack(object *pack, int fp)
{
object t;
@@ -266,10 +262,7 @@ write_pack(pack, fp)
}
static void
-read_pack(pack, fp, is_rogue)
- object *pack;
- int fp;
- boolean is_rogue;
+read_pack(object *pack, int fp, boolean is_rogue)
{
object read_obj, *new_obj;
@@ -297,9 +290,7 @@ read_pack(pack, fp, is_rogue)
}
static void
-rw_dungeon(fp, rw)
- int fp;
- boolean rw;
+rw_dungeon(int fp, boolean rw)
{
short i, j;
char buf[DCOLS];
@@ -322,11 +313,7 @@ rw_dungeon(fp, rw)
}
static void
-rw_id(id_table, fp, n, wr)
- struct id id_table[];
- int fp;
- int n;
- boolean wr;
+rw_id(struct id id_table[], int fp, int n, boolean wr)
{
short i;
@@ -347,9 +334,7 @@ rw_id(id_table, fp, n, wr)
}
static void
-write_string(s, fp)
- char *s;
- int fp;
+write_string(char *s, int fp)
{
short n;
@@ -360,10 +345,7 @@ write_string(s, fp)
}
static void
-read_string(s, maxlen, fp)
- char *s;
- size_t maxlen;
- int fp;
+read_string(char *s, size_t maxlen, int fp)
{
short n;
@@ -377,9 +359,7 @@ read_string(s, maxlen, fp)
}
static void
-rw_rooms(fp, rw)
- int fp;
- boolean rw;
+rw_rooms(int fp, boolean rw)
{
short i;
@@ -390,10 +370,7 @@ rw_rooms(fp, rw)
}
static void
-r_read(fp, buf, n)
- int fp;
- char *buf;
- size_t n;
+r_read(int fp, char *buf, size_t n)
{
if (read(fp, buf, n) != n) {
clean_up("read() failed, don't know why");
@@ -401,10 +378,7 @@ r_read(fp, buf, n)
}
static void
-r_write(fp, buf, n)
- int fp;
- char *buf;
- size_t n;
+r_write(int fp, char *buf, size_t n)
{
if (!write_failed) {
if (write(fp, buf, n) != n) {
@@ -416,8 +390,7 @@ r_write(fp, buf, n)
}
static boolean
-has_been_touched(saved_time, mod_time)
- struct rogue_time *saved_time, *mod_time;
+has_been_touched(struct rogue_time *saved_time, struct rogue_time *mod_time)
{
if (saved_time->year < mod_time->year) {
return(1);
diff --git a/games/rogue/score.c b/games/rogue/score.c
index 5fbbbe418cc..7bb31b274da 100644
--- a/games/rogue/score.c
+++ b/games/rogue/score.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: score.c,v 1.10 2003/06/03 03:01:41 millert Exp $ */
+/* $OpenBSD: score.c,v 1.11 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: score.c,v 1.5 1995/04/22 10:28:26 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)score.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: score.c,v 1.10 2003/06/03 03:01:41 millert Exp $";
+static const char rcsid[] = "$OpenBSD: score.c,v 1.11 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -59,9 +59,7 @@ static const char rcsid[] = "$OpenBSD: score.c,v 1.10 2003/06/03 03:01:41 miller
#include "pathnames.h"
void
-killed_by(monster, other)
- const object *monster;
- short other;
+killed_by(const object *monster, short other)
{
const char *mechanism = "killed by something unknown (?)";
char mechanism_buf[128];
@@ -132,7 +130,7 @@ killed_by(monster, other)
}
void
-win()
+win(void)
{
unwield(rogue.weapon); /* disarm and relax */
unwear(rogue.armor);
@@ -156,8 +154,7 @@ win()
}
void
-quit(from_intrpt)
- boolean from_intrpt;
+quit(boolean from_intrpt)
{
char buf[DCOLS];
short i, orow, ocol;
@@ -233,9 +230,7 @@ static void make_score(struct score_entry *, const object *, int);
static void
-pad_spaces(str, len)
- char *str;
- size_t len;
+pad_spaces(char *str, size_t len)
{
size_t x;
@@ -246,8 +241,7 @@ pad_spaces(str, len)
}
static void
-unpad_spaces(str)
- char *str;
+unpad_spaces(char *str)
{
size_t x;
@@ -257,9 +251,7 @@ unpad_spaces(str)
}
static int
-read_score_entry(se, fp)
- struct score_entry *se;
- FILE *fp;
+read_score_entry(struct score_entry *se, FILE *fp)
{
char score_block[80];
char nickname_block[30];
@@ -312,10 +304,7 @@ read_score_entry(se, fp)
}
static void
-write_score_entry(se, rank, fp)
- const struct score_entry *se;
- int rank;
- FILE *fp;
+write_score_entry(const struct score_entry *se, int rank, FILE *fp)
{
char score_block[80];
char nickname_block[30];
@@ -340,9 +329,7 @@ write_score_entry(se, rank, fp)
}
void
-put_scores(monster, other)
- const object *monster;
- short other;
+put_scores(const object *monster, short other)
{
short i, rank = -1, found_player = -1, numscores = 0;
struct score_entry scores[NUM_SCORE_ENTRIES];
@@ -449,10 +436,7 @@ put_scores(monster, other)
}
static void
-make_score(se, monster, other)
- struct score_entry *se;
- const object *monster;
- int other;
+make_score(struct score_entry *se, const object *monster, int other)
{
const char *death = "bolts from the blue (?)";
const char *hasamulet;
@@ -505,8 +489,7 @@ make_score(se, monster, other)
}
boolean
-is_vowel(ch)
- short ch;
+is_vowel(short ch)
{
return( (ch == 'a') ||
(ch == 'e') ||
@@ -516,7 +499,7 @@ is_vowel(ch)
}
void
-sell_pack()
+sell_pack(void)
{
object *obj;
short row = 2, val;
@@ -548,8 +531,7 @@ sell_pack()
}
int
-get_value(obj)
- object *obj;
+get_value(object *obj)
{
short wc;
int val;
@@ -597,7 +579,7 @@ get_value(obj)
}
void
-id_all()
+id_all(void)
{
short i;
@@ -619,9 +601,7 @@ id_all()
}
void
-xxxx(buf, n)
- char *buf;
- short n;
+xxxx(char *buf, short n)
{
short i;
unsigned char c;
@@ -636,8 +616,7 @@ xxxx(buf, n)
}
long
-xxx(st)
- boolean st;
+xxx(boolean st)
{
static long f, s;
long r;
@@ -654,9 +633,7 @@ xxx(st)
}
void
-center(row, buf)
- short row;
- const char *buf;
+center(short row, const char *buf)
{
short margin;
@@ -665,7 +642,7 @@ center(row, buf)
}
void
-sf_error()
+sf_error(void)
{
md_lock(0);
messagef(1, "");
diff --git a/games/rogue/spec_hit.c b/games/rogue/spec_hit.c
index 043ac3be963..3bd7be37a01 100644
--- a/games/rogue/spec_hit.c
+++ b/games/rogue/spec_hit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spec_hit.c,v 1.6 2003/06/03 03:01:41 millert Exp $ */
+/* $OpenBSD: spec_hit.c,v 1.7 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: spec_hit.c,v 1.3 1995/04/22 10:28:29 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)spec_hit.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: spec_hit.c,v 1.6 2003/06/03 03:01:41 millert Exp $";
+static const char rcsid[] = "$OpenBSD: spec_hit.c,v 1.7 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -59,8 +59,7 @@ short less_hp = 0;
boolean being_held;
void
-special_hit(monster)
- object *monster;
+special_hit(object *monster)
{
if ((monster->m_flags & CONFUSED) && rand_percent(66))
return;
@@ -85,8 +84,7 @@ special_hit(monster)
}
void
-rust(monster)
- object *monster;
+rust(object *monster)
{
if ((!rogue.armor) || (get_armor_class(rogue.armor) <= 1) ||
(rogue.armor->which_kind == LEATHER)) {
@@ -105,8 +103,7 @@ rust(monster)
}
void
-freeze(monster)
- object *monster;
+freeze(object *monster)
{
short freeze_percent = 99;
short i, n;
@@ -139,8 +136,7 @@ freeze(monster)
}
void
-steal_gold(monster)
- object *monster;
+steal_gold(object *monster)
{
int amount;
@@ -160,8 +156,7 @@ steal_gold(monster)
}
void
-steal_item(monster)
- object *monster;
+steal_item(object *monster)
{
object *obj;
short i, n, t = 0;
@@ -214,8 +209,7 @@ DSPR:
}
void
-disappear(monster)
- object *monster;
+disappear(object *monster)
{
short row, col;
@@ -232,8 +226,7 @@ disappear(monster)
}
void
-cough_up(monster)
- object *monster;
+cough_up(object *monster)
{
object *obj;
short row, col, i, n;
@@ -277,9 +270,7 @@ cough_up(monster)
}
boolean
-try_to_cough(row, col, obj)
- short row, col;
- object *obj;
+try_to_cough(short row, short col, object *obj)
{
if ((row < MIN_ROW) ||
(row > (DROWS-2)) || (col < 0) || (col>(DCOLS-1))) {
@@ -298,8 +289,7 @@ try_to_cough(row, col, obj)
}
boolean
-seek_gold(monster)
- object *monster;
+seek_gold(object *monster)
{
short i, j, rn, s;
@@ -331,8 +321,7 @@ seek_gold(monster)
}
boolean
-gold_at(row, col)
- short row, col;
+gold_at(short row, short col)
{
if (dungeon[row][col] & OBJECT) {
object *obj;
@@ -346,15 +335,13 @@ gold_at(row, col)
}
void
-check_gold_seeker(monster)
- object *monster;
+check_gold_seeker(object *monster)
{
monster->m_flags &= (~SEEKS_GOLD);
}
boolean
-check_imitator(monster)
- object *monster;
+check_imitator(object *monster)
{
if (monster->m_flags & IMITATES) {
wake_up(monster);
@@ -370,8 +357,7 @@ check_imitator(monster)
}
boolean
-imitating(row, col)
- short row, col;
+imitating(short row, short col)
{
if (dungeon[row][col] & MONSTER) {
object *monster;
@@ -386,8 +372,7 @@ imitating(row, col)
}
void
-sting(monster)
- object *monster;
+sting(object *monster)
{
short sting_chance = 35;
@@ -408,7 +393,7 @@ sting(monster)
}
void
-drop_level()
+drop_level(void)
{
int hp;
@@ -428,7 +413,7 @@ drop_level()
}
void
-drain_life()
+drain_life(void)
{
short n;
@@ -457,8 +442,7 @@ drain_life()
}
boolean
-m_confuse(monster)
- object *monster;
+m_confuse(object *monster)
{
if (!rogue_can_see(monster->row, monster->col)) {
return(0);
@@ -478,8 +462,7 @@ m_confuse(monster)
}
boolean
-flame_broil(monster)
- object *monster;
+flame_broil(object *monster)
{
short row, col, dir;
@@ -505,8 +488,7 @@ flame_broil(monster)
}
int
-get_dir(srow, scol, drow, dcol)
- short srow, scol, drow, dcol;
+get_dir(short srow, short scol, short drow, short dcol)
{
if (srow == drow) {
if (scol < dcol) {
diff --git a/games/rogue/throw.c b/games/rogue/throw.c
index 017a3d85333..4639716af9e 100644
--- a/games/rogue/throw.c
+++ b/games/rogue/throw.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: throw.c,v 1.7 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: throw.c,v 1.8 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: throw.c,v 1.3 1995/04/22 10:28:32 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)throw.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: throw.c,v 1.7 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: throw.c,v 1.8 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -56,7 +56,7 @@ static const char rcsid[] = "$OpenBSD: throw.c,v 1.7 2004/01/21 19:12:13 espie E
#include "rogue.h"
void
-throw()
+throw(void)
{
short wch, d;
boolean first_miss = 1;
@@ -120,8 +120,7 @@ throw()
}
boolean
-throw_at_monster(monster, weapon)
- object *monster, *weapon;
+throw_at_monster(object *monster, object *weapon)
{
short damage, hit_chance;
short t;
@@ -156,10 +155,7 @@ throw_at_monster(monster, weapon)
}
object *
-get_thrown_at_monster(obj, dir, row, col)
- object *obj;
- short dir;
- short *row, *col;
+get_thrown_at_monster(object *obj, short dir, short *row, short *col)
{
short orow, ocol;
short i, ch;
@@ -201,9 +197,7 @@ get_thrown_at_monster(obj, dir, row, col)
}
void
-flop_weapon(weapon, row, col)
- object *weapon;
- short row, col;
+flop_weapon(object *weapon, short row, short col)
{
object *new_weapon, *monster;
short i = 0;
@@ -259,8 +253,7 @@ flop_weapon(weapon, row, col)
}
void
-rand_around(i, r, c)
- short i, *r, *c;
+rand_around(short i, short *r, short *c)
{
static char pos[] = "\010\007\001\003\004\005\002\006\0";
static short row, col;
diff --git a/games/rogue/trap.c b/games/rogue/trap.c
index c14da8b9080..5f0f1353fe0 100644
--- a/games/rogue/trap.c
+++ b/games/rogue/trap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: trap.c,v 1.6 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: trap.c,v 1.7 2006/03/08 09:44:35 otto Exp $ */
/* $NetBSD: trap.c,v 1.3 1995/04/22 10:28:35 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)trap.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: trap.c,v 1.6 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: trap.c,v 1.7 2006/03/08 09:44:35 otto Exp $";
#endif
#endif /* not lint */
@@ -75,8 +75,7 @@ const char *trap_strings[TRAPS * 2] = {
};
short
-trap_at(row, col)
- short row, col;
+trap_at(short row, short col)
{
short i;
@@ -89,8 +88,7 @@ trap_at(row, col)
}
void
-trap_player(row, col)
- short row, col;
+trap_player(short row, short col)
{
short t;
@@ -142,7 +140,7 @@ trap_player(row, col)
}
void
-add_traps()
+add_traps(void)
{
short i, n, tries = 0;
short row, col;
@@ -187,7 +185,7 @@ add_traps()
}
void
-id_trap()
+id_trap(void)
{
short dir, row, col, d, t;
@@ -215,7 +213,7 @@ id_trap()
}
void
-show_traps()
+show_traps(void)
{
short i, j;
@@ -229,9 +227,7 @@ show_traps()
}
void
-search(n, is_auto)
- short n;
- boolean is_auto;
+search(short n, boolean is_auto)
{
short s, i, j, row, col, t;
short shown = 0, found = 0;
diff --git a/games/rogue/use.c b/games/rogue/use.c
index af359630ea7..09c04411c29 100644
--- a/games/rogue/use.c
+++ b/games/rogue/use.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: use.c,v 1.7 2004/01/21 19:12:13 espie Exp $ */
+/* $OpenBSD: use.c,v 1.8 2006/03/08 09:44:36 otto Exp $ */
/* $NetBSD: use.c,v 1.3 1995/04/22 10:28:38 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)use.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: use.c,v 1.7 2004/01/21 19:12:13 espie Exp $";
+static const char rcsid[] = "$OpenBSD: use.c,v 1.8 2006/03/08 09:44:36 otto Exp $";
#endif
#endif /* not lint */
@@ -67,7 +67,7 @@ boolean con_mon = 0;
const char *strange_feeling = "you have a strange feeling for a moment, then it passes";
void
-quaff()
+quaff(void)
{
short ch;
object *obj;
@@ -178,7 +178,7 @@ quaff()
}
void
-read_scroll()
+read_scroll(void)
{
short ch;
object *obj;
@@ -286,10 +286,7 @@ read_scroll()
*/
void
-vanish(obj, rm, pack)
- object *obj;
- short rm;
- object *pack;
+vanish(object *obj, short rm, object *pack)
{
if (obj->quantity > 1) {
obj->quantity--;
@@ -310,8 +307,7 @@ vanish(obj, rm, pack)
}
void
-potion_heal(extra)
- int extra;
+potion_heal(int extra)
{
float ratio;
short add;
@@ -357,7 +353,7 @@ potion_heal(extra)
}
void
-idntfy()
+idntfy(void)
{
short ch;
object *obj;
@@ -385,7 +381,7 @@ AGAIN:
}
void
-eat()
+eat(void)
{
short ch;
short moves;
@@ -425,7 +421,7 @@ eat()
}
void
-hold_monster()
+hold_monster(void)
{
short i, j;
short mcount = 0;
@@ -458,7 +454,7 @@ hold_monster()
}
void
-tele()
+tele(void)
{
mvaddch(rogue.row, rogue.col, get_dungeon_char(rogue.row, rogue.col));
@@ -471,7 +467,7 @@ tele()
}
void
-hallucinate()
+hallucinate(void)
{
object *obj, *monster;
short ch;
@@ -501,7 +497,7 @@ hallucinate()
}
void
-unhallucinate()
+unhallucinate(void)
{
halluc = 0;
relight();
@@ -509,7 +505,7 @@ unhallucinate()
}
void
-unblind()
+unblind(void)
{
blind = 0;
messagef(1, "the veil of darkness lifts");
@@ -523,7 +519,7 @@ unblind()
}
void
-relight()
+relight(void)
{
if (cur_room == PASSAGE) {
light_passage(rogue.row, rogue.col);
@@ -534,7 +530,7 @@ relight()
}
void
-take_a_nap()
+take_a_nap(void)
{
short i;
@@ -549,7 +545,7 @@ take_a_nap()
}
void
-go_blind()
+go_blind(void)
{
short i, j;
@@ -581,7 +577,7 @@ go_blind()
}
const char *
-get_ench_color()
+get_ench_color(void)
{
if (halluc) {
return(id_potions[get_rand(0, POTIONS-1)].title);
@@ -592,20 +588,20 @@ get_ench_color()
}
void
-cnfs()
+cnfs(void)
{
confused += get_rand(12, 22);
}
void
-unconfuse()
+unconfuse(void)
{
confused = 0;
messagef(1, "you feel less %s now", (halluc ? "trippy" : "confused"));
}
void
-uncurse_all()
+uncurse_all(void)
{
object *obj;
diff --git a/games/rogue/zap.c b/games/rogue/zap.c
index d5472ff7b41..e7f014806fd 100644
--- a/games/rogue/zap.c
+++ b/games/rogue/zap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zap.c,v 1.6 2003/06/03 03:01:41 millert Exp $ */
+/* $OpenBSD: zap.c,v 1.7 2006/03/08 09:44:36 otto Exp $ */
/* $NetBSD: zap.c,v 1.3 1995/04/22 10:28:41 cgd Exp $ */
/*
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)zap.c 8.1 (Berkeley) 5/31/93";
#else
-static const char rcsid[] = "$OpenBSD: zap.c,v 1.6 2003/06/03 03:01:41 millert Exp $";
+static const char rcsid[] = "$OpenBSD: zap.c,v 1.7 2006/03/08 09:44:36 otto Exp $";
#endif
#endif /* not lint */
@@ -58,7 +58,7 @@ static const char rcsid[] = "$OpenBSD: zap.c,v 1.6 2003/06/03 03:01:41 millert E
boolean wizard = 0;
void
-zapp()
+zapp(void)
{
short wch;
boolean first_miss = 1;
@@ -113,9 +113,7 @@ zapp()
}
object *
-get_zapped_monster(dir, row, col)
- short dir;
- short *row, *col;
+get_zapped_monster(short dir, short *row, short *col)
{
short orow, ocol;
@@ -136,9 +134,7 @@ get_zapped_monster(dir, row, col)
}
void
-zap_monster(monster, kind)
- object *monster;
- unsigned short kind;
+zap_monster(object *monster, unsigned short kind)
{
short row, col;
object *nm;
@@ -204,8 +200,7 @@ zap_monster(monster, kind)
}
void
-tele_away(monster)
- object *monster;
+tele_away(object *monster)
{
short row, col;
@@ -224,7 +219,7 @@ tele_away(monster)
}
void
-wizardize()
+wizardize(void)
{
char buf[10];
@@ -248,8 +243,7 @@ wizardize()
}
void
-wdrain_life(monster)
- object *monster;
+wdrain_life(object *monster)
{
short hp;
object *lmon, *nm;
@@ -278,8 +272,7 @@ wdrain_life(monster)
}
void
-bounce(ball, dir, row, col, r)
- short ball, dir, row, col, r;
+bounce(short ball, short dir, short row, short col, short r)
{
short orow, ocol;
const char *s;