rogue4: fix most GCC5 warnings.

Converting all function definitions to ANSI style accounts for most of
the change.  This has exposed other problems, such as daemons not
actually being their stated type, that will require more careful
solutions.
This commit is contained in:
John "Elwin" Edwards 2016-01-27 19:41:05 -05:00
parent 384386d71c
commit c1d6a6af6a
32 changed files with 625 additions and 394 deletions

View file

@ -16,7 +16,8 @@
* wear: * wear:
* The player wants to wear something, so let him/her put it on. * The player wants to wear something, so let him/her put it on.
*/ */
wear() void
wear(void)
{ {
register THING *obj; register THING *obj;
register char *sp; register char *sp;
@ -50,7 +51,8 @@ wear()
* take_off: * take_off:
* Get the armor off of the players back * Get the armor off of the players back
*/ */
take_off() void
take_off(void)
{ {
register THING *obj; register THING *obj;
@ -77,7 +79,8 @@ take_off()
* waste_time: * waste_time:
* Do nothing but let other things happen * Do nothing but let other things happen
*/ */
waste_time() void
waste_time(void)
{ {
do_daemons(BEFORE); do_daemons(BEFORE);
do_fuses(BEFORE); do_fuses(BEFORE);

View file

@ -10,6 +10,7 @@
* See the file LICENSE.TXT for full copyright and licensing information. * See the file LICENSE.TXT for full copyright and licensing information.
*/ */
#include <stdlib.h>
#include <curses.h> #include <curses.h>
#include "rogue.h" #include "rogue.h"
@ -17,11 +18,16 @@
coord ch_ret; /* Where chasing takes you */ coord ch_ret; /* Where chasing takes you */
bool chase(THING *tp, coord *ee);
int do_chase(THING *th);
coord *find_dest(THING *tp);
/* /*
* runners: * runners:
* Make all the running monsters move. * Make all the running monsters move.
*/ */
runners() void
runners(void)
{ {
register THING *tp; register THING *tp;
register THING *ntp; register THING *ntp;
@ -46,8 +52,8 @@ runners()
* do_chase: * do_chase:
* Make one thing chase another. * Make one thing chase another.
*/ */
do_chase(th) int
register THING *th; do_chase(THING *th)
{ {
register struct room *rer, *ree; /* room of chaser, room of chasee */ register struct room *rer, *ree; /* room of chaser, room of chasee */
register int mindist = 32767, i, dist; register int mindist = 32767, i, dist;
@ -184,8 +190,8 @@ over:
* see_monst: * see_monst:
* Return TRUE if the hero can see the monster * Return TRUE if the hero can see the monster
*/ */
see_monst(mp) bool
register THING *mp; see_monst(THING *mp)
{ {
if (on(player, ISBLIND)) if (on(player, ISBLIND))
return FALSE; return FALSE;
@ -203,9 +209,8 @@ register THING *mp;
* Set a mosnter running after something or stop it from running * Set a mosnter running after something or stop it from running
* (for when it dies) * (for when it dies)
*/ */
runto(runner, spot) void
register coord *runner; runto(coord *runner, coord *spot)
coord *spot;
{ {
register THING *tp; register THING *tp;
@ -234,9 +239,8 @@ coord *spot;
* chasee(ee). Returns TRUE if we want to keep on chasing later * chasee(ee). Returns TRUE if we want to keep on chasing later
* FALSE if we reach the goal. * FALSE if we reach the goal.
*/ */
chase(tp, ee) bool
THING *tp; chase(THING *tp, coord *ee)
coord *ee;
{ {
register int x, y; register int x, y;
register int dist, thisdist; register int dist, thisdist;
@ -339,8 +343,7 @@ coord *ee;
* in any room. * in any room.
*/ */
struct room * struct room *
roomin(cp) roomin(coord *cp)
register coord *cp;
{ {
register struct room *rp; register struct room *rp;
register char *fp; register char *fp;
@ -360,8 +363,8 @@ register coord *cp;
* diag_ok: * diag_ok:
* Check to see if the move is legal if it is diagonal * Check to see if the move is legal if it is diagonal
*/ */
diag_ok(sp, ep) bool
register coord *sp, *ep; diag_ok(coord *sp, coord *ep)
{ {
if (ep->x == sp->x || ep->y == sp->y) if (ep->x == sp->x || ep->y == sp->y)
return TRUE; return TRUE;
@ -372,8 +375,8 @@ register coord *sp, *ep;
* cansee: * cansee:
* Returns true if the hero can see a certain coordinate. * Returns true if the hero can see a certain coordinate.
*/ */
cansee(y, x) bool
register int y, x; cansee(int y, int x)
{ {
register struct room *rer; register struct room *rer;
coord tp; coord tp;
@ -396,8 +399,7 @@ register int y, x;
* find the proper destination for the monster * find the proper destination for the monster
*/ */
coord * coord *
find_dest(tp) find_dest(THING *tp)
register THING *tp;
{ {
register THING *obj; register THING *obj;
register int prob; register int prob;

View file

@ -19,15 +19,30 @@
char countch, direction, newcount = FALSE; char countch, direction, newcount = FALSE;
void call(void);
void d_level(void);
void help(void);
void identify(void);
void illcom(char ch);
void search(void);
void u_level(void);
#ifdef WIZARD
extern void add_pass(void);
extern void create_obj(void);
extern bool passwd(void);
extern void show_map(void);
#endif
/* /*
* command: * command:
* Process the user commands * Process the user commands
*/ */
command() void
command(void)
{ {
register char ch; register char ch;
register int ntimes = 1; /* Number of player moves */ register int ntimes = 1; /* Number of player moves */
char *unctrol();
if (on(player, ISHASTE)) if (on(player, ISHASTE))
ntimes++; ntimes++;
@ -344,8 +359,8 @@ command()
* illcom: * illcom:
* What to do with an illegal command * What to do with an illegal command
*/ */
illcom(ch) void
char ch; illcom(char ch)
{ {
save_msg = FALSE; save_msg = FALSE;
count = 0; count = 0;
@ -357,7 +372,8 @@ char ch;
* search: * search:
* Player gropes about him to find hidden things. * Player gropes about him to find hidden things.
*/ */
search() void
search(void)
{ {
register int y, x; register int y, x;
register char *fp; register char *fp;
@ -400,7 +416,8 @@ search()
* help: * help:
* Give single character help, or the whole mess if he wants it * Give single character help, or the whole mess if he wants it
*/ */
help() void
help(void)
{ {
register const struct h_list *strp = helpstr; register const struct h_list *strp = helpstr;
register char helpch; register char helpch;
@ -457,7 +474,8 @@ help()
* identify: * identify:
* Tell the player what a certain thing is. * Tell the player what a certain thing is.
*/ */
identify() void
identify(void)
{ {
register char ch; register char ch;
register const char *str; register const char *str;
@ -502,7 +520,8 @@ identify()
* d_level: * d_level:
* He wants to go down a level * He wants to go down a level
*/ */
d_level() void
d_level(void)
{ {
if (chat(hero.y, hero.x) != STAIRS) if (chat(hero.y, hero.x) != STAIRS)
msg("I see no way down"); msg("I see no way down");
@ -517,7 +536,8 @@ d_level()
* u_level: * u_level:
* He wants to go up a level * He wants to go up a level
*/ */
u_level() void
u_level(void)
{ {
if (chat(hero.y, hero.x) == STAIRS) if (chat(hero.y, hero.x) == STAIRS)
if (amulet) if (amulet)
@ -538,7 +558,8 @@ u_level()
* call: * call:
* Allow a user to call a potion, scroll, or ring something * Allow a user to call a potion, scroll, or ring something
*/ */
call() void
call(void)
{ {
register THING *obj; register THING *obj;
register char **guess; register char **guess;

View file

@ -29,7 +29,7 @@ struct delayed_action d_list[MAXDAEMONS] = {
* Find an empty slot in the daemon/fuse list * Find an empty slot in the daemon/fuse list
*/ */
struct delayed_action * struct delayed_action *
d_slot() d_slot(void)
{ {
register int i; register int i;
register struct delayed_action *dev; register struct delayed_action *dev;
@ -48,8 +48,7 @@ d_slot()
* Find a particular slot in the table * Find a particular slot in the table
*/ */
struct delayed_action * struct delayed_action *
find_slot(func) find_slot(int (*func)())
register int (*func)();
{ {
register int i; register int i;
register struct delayed_action *dev; register struct delayed_action *dev;
@ -64,8 +63,8 @@ register int (*func)();
* start_daemon: * start_daemon:
* Start a daemon, takes a function. * Start a daemon, takes a function.
*/ */
start_daemon(func, arg, type) void
int (*func)(), arg, type; start_daemon(int (*func)(), int arg, int type)
{ {
register struct delayed_action *dev; register struct delayed_action *dev;
@ -80,8 +79,8 @@ int (*func)(), arg, type;
* kill_daemon: * kill_daemon:
* Remove a daemon from the list * Remove a daemon from the list
*/ */
kill_daemon(func) void
int (*func)(); kill_daemon(int (*func)())
{ {
register struct delayed_action *dev; register struct delayed_action *dev;
@ -98,8 +97,8 @@ int (*func)();
* Run all the daemons that are active with the current flag, * Run all the daemons that are active with the current flag,
* passing the argument to the function. * passing the argument to the function.
*/ */
do_daemons(flag) void
register int flag; do_daemons(int flag)
{ {
register struct delayed_action *dev; register struct delayed_action *dev;
@ -118,8 +117,8 @@ register int flag;
* fuse: * fuse:
* Start a fuse to go off in a certain number of turns * Start a fuse to go off in a certain number of turns
*/ */
fuse(func, arg, time, type) void
int (*func)(), arg, time, type; fuse(int (*func)(), int arg, int time, int type)
{ {
register struct delayed_action *wire; register struct delayed_action *wire;
@ -134,9 +133,8 @@ int (*func)(), arg, time, type;
* lengthen: * lengthen:
* Increase the time until a fuse goes off * Increase the time until a fuse goes off
*/ */
lengthen(func, xtime) void
int (*func)(); lengthen(int (*func)(), int xtime)
int xtime;
{ {
register struct delayed_action *wire; register struct delayed_action *wire;
@ -149,8 +147,8 @@ int xtime;
* extinguish: * extinguish:
* Put out a fuse * Put out a fuse
*/ */
extinguish(func) void
int (*func)(); extinguish(int (*func)())
{ {
register struct delayed_action *wire; register struct delayed_action *wire;
@ -163,8 +161,8 @@ int (*func)();
* do_fuses: * do_fuses:
* Decrement counters and start needed fuses * Decrement counters and start needed fuses
*/ */
do_fuses(flag) void
register int flag; do_fuses(int flag)
{ {
register struct delayed_action *wire; register struct delayed_action *wire;

View file

@ -19,7 +19,8 @@ int between = 0;
* doctor: * doctor:
* A healing daemon that restors hit points after rest * A healing daemon that restors hit points after rest
*/ */
doctor() void
doctor(void)
{ {
register int lv, ohp; register int lv, ohp;
@ -50,7 +51,8 @@ doctor()
* Swander: * Swander:
* Called when it is time to start rolling for wandering monsters * Called when it is time to start rolling for wandering monsters
*/ */
swander() void
swander(void)
{ {
start_daemon(rollwand, 0, BEFORE); start_daemon(rollwand, 0, BEFORE);
} }
@ -59,7 +61,8 @@ swander()
* rollwand: * rollwand:
* Called to roll to see if a wandering monster starts up * Called to roll to see if a wandering monster starts up
*/ */
rollwand() void
rollwand(void)
{ {
if (++between >= 4) if (++between >= 4)
{ {
@ -77,7 +80,8 @@ rollwand()
* unconfuse: * unconfuse:
* Release the poor player from his confusion * Release the poor player from his confusion
*/ */
unconfuse() void
unconfuse(void)
{ {
player.t_flags &= ~ISHUH; player.t_flags &= ~ISHUH;
msg("you feel less confused now"); msg("you feel less confused now");
@ -87,7 +91,8 @@ unconfuse()
* unsee: * unsee:
* Turn off the ability to see invisible * Turn off the ability to see invisible
*/ */
unsee() void
unsee(void)
{ {
register THING *th; register THING *th;
@ -104,7 +109,8 @@ unsee()
* sight: * sight:
* He gets his sight back * He gets his sight back
*/ */
sight() void
sight(void)
{ {
if (on(player, ISBLIND)) if (on(player, ISBLIND))
{ {
@ -120,7 +126,8 @@ sight()
* nohaste: * nohaste:
* End the hasting * End the hasting
*/ */
nohaste() void
nohaste(void)
{ {
player.t_flags &= ~ISHASTE; player.t_flags &= ~ISHASTE;
msg("you feel yourself slowing down"); msg("you feel yourself slowing down");
@ -130,7 +137,8 @@ nohaste()
* stomach: * stomach:
* Digest the hero's food * Digest the hero's food
*/ */
stomach() void
stomach(void)
{ {
register int oldfood; register int oldfood;

View file

@ -52,17 +52,9 @@ extern WINDOW *hw;
* Function types * Function types
*/ */
char *charge_str(), *ctime(), *getenv(), *inv_name(), char *ctime(), *getenv();
*killname(), *nothing(), *num(), *ring_num(),
*tr_name(),
*unctrol(), *vowelstr();
void leave(int), quit(int), tstp(), auto_save(int), endit(int); void tstp(), endit(int);
int doctor(), nohaste(),
rollwand(), runners(), sight(), stomach(), swander(),
turn_see(), unconfuse(), unsee();
void checkout();
long lseek(); long lseek();

View file

@ -10,6 +10,7 @@
* See the file LICENSE.TXT for full copyright and licensing information. * See the file LICENSE.TXT for full copyright and licensing information.
*/ */
#include <stdlib.h>
#include <curses.h> #include <curses.h>
#include <ctype.h> #include <ctype.h>
#include <string.h> #include <string.h>
@ -20,15 +21,20 @@ long e_levels[] = {
40920L, 81920L, 163840L, 327680L, 655360L, 1310720L, 2621440L, 0L 40920L, 81920L, 163840L, 327680L, 655360L, 1310720L, 2621440L, 0L
}; };
bool roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl);
void hit(char *er, char *ee);
void miss(char *er, char *ee);
int str_plus(str_t str);
int add_dam(str_t str);
void thunk(THING *weap, const char *mname);
void bounce(THING *weap, const char *mname);
/* /*
* fight: * fight:
* The player attacks the monster. * The player attacks the monster.
*/ */
fight(mp, mn, weap, thrown) bool
register coord *mp; fight(coord *mp, char mn, THING *weap, bool thrown)
char mn;
register THING *weap;
bool thrown;
{ {
register THING *tp; register THING *tp;
register bool did_hit = TRUE; register bool did_hit = TRUE;
@ -96,8 +102,8 @@ bool thrown;
* attack: * attack:
* The monster attacks the player * The monster attacks the player
*/ */
attack(mp) int
register THING *mp; attack(THING *mp)
{ {
register const char *mname; register const char *mname;
@ -295,8 +301,8 @@ register THING *mp;
* swing: * swing:
* Returns true if the swing hits * Returns true if the swing hits
*/ */
swing(at_lvl, op_arm, wplus) bool
int at_lvl, op_arm, wplus; swing(int at_lvl, int op_arm, int wplus)
{ {
register int res = rnd(20); register int res = rnd(20);
register int need = (20 - at_lvl) - op_arm; register int need = (20 - at_lvl) - op_arm;
@ -308,7 +314,8 @@ int at_lvl, op_arm, wplus;
* check_level: * check_level:
* Check to see if the guy has gone up a level. * Check to see if the guy has gone up a level.
*/ */
check_level() void
check_level(void)
{ {
register int i, add, olevel; register int i, add, olevel;
@ -332,9 +339,8 @@ check_level()
* roll_em: * roll_em:
* Roll several attacks * Roll several attacks
*/ */
roll_em(thatt, thdef, weap, hurl) bool
THING *thatt, *thdef, *weap; roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl)
bool hurl;
{ {
register struct stats *att, *def; register struct stats *att, *def;
register char *cp; register char *cp;
@ -440,9 +446,7 @@ bool hurl;
* The print name of a combatant * The print name of a combatant
*/ */
char * char *
prname(who, upper) prname(char *who, bool upper)
register char *who;
bool upper;
{ {
static char tbuf[MAXSTR]; static char tbuf[MAXSTR];
@ -465,8 +469,8 @@ bool upper;
* hit: * hit:
* Print a message to indicate a succesful hit * Print a message to indicate a succesful hit
*/ */
hit(er, ee) void
register char *er, *ee; hit(char *er, char *ee)
{ {
register char *s = ""; register char *s = "";
@ -491,8 +495,8 @@ register char *er, *ee;
* miss: * miss:
* Print a message to indicate a poor swing * Print a message to indicate a poor swing
*/ */
miss(er, ee) void
register char *er, *ee; miss(char *er, char *ee)
{ {
register char *s = ""; register char *s = "";
@ -514,9 +518,8 @@ register char *er, *ee;
* save_throw: * save_throw:
* See if a creature save against something * See if a creature save against something
*/ */
save_throw(which, tp) bool
int which; save_throw(int which, THING *tp)
THING *tp;
{ {
register int need; register int need;
@ -528,8 +531,8 @@ THING *tp;
* save: * save:
* See if he saves against various nasty things * See if he saves against various nasty things
*/ */
save(which) bool
register int which; save(int which)
{ {
if (which == VS_MAGIC) if (which == VS_MAGIC)
{ {
@ -545,8 +548,8 @@ register int which;
* str_plus: * str_plus:
* Compute bonus/penalties for strength on the "to hit" roll * Compute bonus/penalties for strength on the "to hit" roll
*/ */
str_plus(str) int
register str_t str; str_plus(str_t str)
{ {
if (str == 31) if (str == 31)
return 3; return 3;
@ -563,8 +566,8 @@ register str_t str;
* add_dam: * add_dam:
* Compute additional damage done for exceptionally high or low strength * Compute additional damage done for exceptionally high or low strength
*/ */
add_dam(str) int
register str_t str; add_dam(str_t str)
{ {
if (str == 31) if (str == 31)
return 6; return 6;
@ -587,7 +590,8 @@ register str_t str;
* raise_level: * raise_level:
* The guy just magically went up a level. * The guy just magically went up a level.
*/ */
raise_level() void
raise_level(void)
{ {
pstats.s_exp = e_levels[pstats.s_lvl-1] + 1L; pstats.s_exp = e_levels[pstats.s_lvl-1] + 1L;
check_level(); check_level();
@ -597,9 +601,8 @@ raise_level()
* thunk: * thunk:
* A missile hits a monster * A missile hits a monster
*/ */
thunk(weap, mname) void
register THING *weap; thunk(THING *weap, const char *mname)
register const char *mname;
{ {
if (weap->o_type == WEAPON) if (weap->o_type == WEAPON)
addmsg("the %s hits ", w_names[weap->o_which]); addmsg("the %s hits ", w_names[weap->o_which]);
@ -615,9 +618,8 @@ register const char *mname;
* bounce: * bounce:
* A missile misses a monster * A missile misses a monster
*/ */
bounce(weap, mname) void
register THING *weap; bounce(THING *weap, const char *mname)
register const char *mname;
{ {
if (weap->o_type == WEAPON) if (weap->o_type == WEAPON)
addmsg("the %s misses ", w_names[weap->o_which]); addmsg("the %s misses ", w_names[weap->o_which]);
@ -633,10 +635,8 @@ register const char *mname;
* remove: * remove:
* Remove a monster from the screen * Remove a monster from the screen
*/ */
remove_monster(mp, tp, waskill) void
register coord *mp; remove_monster(coord *mp, THING *tp, bool waskill)
register THING *tp;
bool waskill;
{ {
register THING *obj, *nexti; register THING *obj, *nexti;
@ -660,8 +660,8 @@ bool waskill;
* is_magic: * is_magic:
* Returns true if an object radiates magic * Returns true if an object radiates magic
*/ */
is_magic(obj) bool
register THING *obj; is_magic(THING *obj)
{ {
switch (obj->o_type) switch (obj->o_type)
{ {
@ -683,9 +683,8 @@ register THING *obj;
* killed: * killed:
* Called to put a monster to death * Called to put a monster to death
*/ */
killed(tp, pr) void
register THING *tp; killed(THING *tp, bool pr)
bool pr;
{ {
pstats.s_exp += tp->t_stats.s_exp; pstats.s_exp += tp->t_stats.s_exp;
/* /*

View file

@ -16,11 +16,16 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
#ifdef WIZARD
void badcheck(char *name, struct magic_item *magic, int bound);
#endif
/* /*
* init_player: * init_player:
* Roll up the rogue * Roll up the rogue
*/ */
init_player() void
init_player(void)
{ {
register THING *obj; register THING *obj;
@ -236,7 +241,8 @@ const char *metal[NMETAL] = {
* init_things * init_things
* Initialize the probabilities for types of things * Initialize the probabilities for types of things
*/ */
init_things() void
init_things(void)
{ {
register struct magic_item *mp; register struct magic_item *mp;
@ -251,7 +257,8 @@ init_things()
* init_colors: * init_colors:
* Initialize the potion color scheme for this time * Initialize the potion color scheme for this time
*/ */
init_colors() void
init_colors(void)
{ {
register int i, j; register int i, j;
bool used[NCOLORS]; bool used[NCOLORS];
@ -281,7 +288,8 @@ init_colors()
*/ */
#define MAXNAME 40 /* Max number of characters in a name */ #define MAXNAME 40 /* Max number of characters in a name */
init_names() void
init_names(void)
{ {
register int nsyl; register int nsyl;
register char *cp; register char *cp;
@ -322,7 +330,8 @@ init_names()
* init_stones: * init_stones:
* Initialize the ring stone setting scheme for this time * Initialize the ring stone setting scheme for this time
*/ */
init_stones() void
init_stones(void)
{ {
register int i, j; register int i, j;
bool used[NSTONES]; bool used[NSTONES];
@ -351,7 +360,8 @@ init_stones()
* init_materials: * init_materials:
* Initialize the construction materials for wands and staffs * Initialize the construction materials for wands and staffs
*/ */
init_materials() void
init_materials(void)
{ {
register int i, j; register int i, j;
register const char *str; register const char *str;
@ -402,10 +412,8 @@ init_materials()
* badcheck: * badcheck:
* Check to see if a series of probabilities sums to 100 * Check to see if a series of probabilities sums to 100
*/ */
badcheck(name, magic, bound) void
char *name; badcheck(char *name, struct magic_item *magic, int bound)
register struct magic_item *magic;
register int bound;
{ {
register struct magic_item *end; register struct magic_item *end;

View file

@ -16,6 +16,8 @@
#include "rogue.h" #include "rogue.h"
#include <stdarg.h> #include <stdarg.h>
void doadd(char *fmt, va_list ap);
/* /*
* msg: * msg:
* Display a message at the top of the screen. * Display a message at the top of the screen.
@ -23,6 +25,7 @@
static char msgbuf[BUFSIZ]; static char msgbuf[BUFSIZ];
static int newpos = 0; static int newpos = 0;
void
msg(char *fmt, ...) msg(char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -50,6 +53,7 @@ msg(char *fmt, ...)
* Add things to the current message * Add things to the current message
*/ */
void
addmsg(char *fmt, ...) addmsg(char *fmt, ...)
{ {
va_list ap; va_list ap;
@ -65,7 +69,8 @@ addmsg(char *fmt, ...)
* if it is up there with the --More--) * if it is up there with the --More--)
*/ */
endmsg() void
endmsg(void)
{ {
if (save_msg) if (save_msg)
{ {
@ -99,6 +104,7 @@ endmsg()
* Perform an add onto the message buffer * Perform an add onto the message buffer
*/ */
void
doadd(char *fmt, va_list ap) doadd(char *fmt, va_list ap)
{ {
vsprintf(&msgbuf[newpos], fmt, ap); vsprintf(&msgbuf[newpos], fmt, ap);
@ -109,7 +115,8 @@ doadd(char *fmt, va_list ap)
* step_ok: * step_ok:
* Returns true if it is ok to step on ch * Returns true if it is ok to step on ch
*/ */
step_ok(ch) bool
step_ok(char ch)
{ {
switch (ch) switch (ch)
{ {
@ -127,8 +134,8 @@ step_ok(ch)
* Flushes stdout so that screen is up to date and then returns * Flushes stdout so that screen is up to date and then returns
* getchar(). * getchar().
*/ */
readcharw(win) int
WINDOW *win; readcharw(WINDOW *win)
{ {
int ch; int ch;
@ -143,14 +150,14 @@ WINDOW *win;
return(ch); return(ch);
} }
readchar() int
readchar(void)
{ {
return( readcharw(stdscr) ); return( readcharw(stdscr) );
} }
char * char *
unctrol(ch) unctrol(char ch)
char ch;
{ {
return( (char *) unctrl(ch) ); return( (char *) unctrl(ch) );
} }
@ -159,7 +166,8 @@ char ch;
* status: * status:
* Display the important stats line. Keep the cursor where it was. * Display the important stats line. Keep the cursor where it was.
*/ */
status() void
status(void)
{ {
register int oy, ox, temp; register int oy, ox, temp;
static int hpwidth = 0, s_hungry; static int hpwidth = 0, s_hungry;
@ -215,15 +223,14 @@ status()
wait_for(ch) void
register char ch; wait_for(char ch)
{ {
w_wait_for(stdscr, ch); w_wait_for(stdscr, ch);
} }
w_wait_for(win,ch) void
WINDOW *win; w_wait_for(WINDOW *win, char ch)
register char ch;
{ {
register char c; register char c;
@ -239,9 +246,8 @@ register char ch;
* show_win: * show_win:
* Function used to display a window and wait before returning * Function used to display a window and wait before returning
*/ */
show_win(scr, message) void
register WINDOW *scr; show_win(WINDOW *scr, char *message)
char *message;
{ {
mvwaddstr(scr, 0, 0, message); mvwaddstr(scr, 0, 0, message);
touchwin(scr); touchwin(scr);

View file

@ -18,8 +18,8 @@
* detach: * detach:
* Takes an item out of whatever linked list it might be in * Takes an item out of whatever linked list it might be in
*/ */
_detach(list, item) void
register THING **list, *item; _detach(THING **list, THING *item)
{ {
if (*list == item) if (*list == item)
*list = next(item); *list = next(item);
@ -33,8 +33,8 @@ register THING **list, *item;
* _attach: * _attach:
* add an item to the head of a list * add an item to the head of a list
*/ */
_attach(list, item) void
register THING **list, *item; _attach(THING **list, THING *item)
{ {
if (*list != NULL) if (*list != NULL)
{ {
@ -54,8 +54,8 @@ register THING **list, *item;
* _free_list: * _free_list:
* Throw the whole blamed thing away * Throw the whole blamed thing away
*/ */
_free_list(ptr) void
register THING **ptr; _free_list(THING **ptr)
{ {
register THING *item; register THING *item;
@ -71,8 +71,8 @@ register THING **ptr;
* discard: * discard:
* Free up an item * Free up an item
*/ */
discard(item) void
register THING *item; discard(THING *item)
{ {
total--; total--;
free((char *) item); free((char *) item);
@ -83,7 +83,7 @@ register THING *item;
* Get a new item with a specified size * Get a new item with a specified size
*/ */
THING * THING *
new_item() new_item(void)
{ {
register THING *item; register THING *item;

View file

@ -47,11 +47,17 @@ static char *lockfile = LOCKFILE;
#endif #endif
#endif #endif
int too_much(void);
bool author(void);
void checkout(int s);
void chmsg(char *fmt, int arg);
/* /*
* init_check: * init_check:
* Check out too see if it is proper to play the game now * Check out too see if it is proper to play the game now
*/ */
init_check() void
init_check(void)
{ {
if (too_much()) if (too_much())
{ {
@ -70,7 +76,8 @@ init_check()
* Open up the score file for future use, and then * Open up the score file for future use, and then
* setuid(getuid()) in case we are running setuid. * setuid(getuid()) in case we are running setuid.
*/ */
open_score() void
open_score(void)
{ {
#ifdef SCOREFILE #ifdef SCOREFILE
fd = open(SCOREFILE, O_RDWR | O_CREAT, 0666 ); fd = open(SCOREFILE, O_RDWR | O_CREAT, 0666 );
@ -82,7 +89,8 @@ open_score()
return; return;
} }
void open_log(void) void
open_log(void)
{ {
#ifdef LOGFILE #ifdef LOGFILE
lfd = open(LOGFILE, O_WRONLY | O_APPEND | O_CREAT, 0666); lfd = open(LOGFILE, O_WRONLY | O_APPEND | O_CREAT, 0666);
@ -96,12 +104,10 @@ void open_log(void)
* setup: * setup:
* Get starting setup for all games * Get starting setup for all games
*/ */
setup() void
setup(void)
{ {
void auto_save(), quit(), endit(), tstp(); void auto_save(), quit(), endit(), tstp();
#ifdef CHECKTIME
int checkout();
#endif
/* /*
* make sure that large terminals don't overflow the bounds * make sure that large terminals don't overflow the bounds
@ -158,7 +164,8 @@ setup()
* start_score: * start_score:
* Start the scoring sequence * Start the scoring sequence
*/ */
start_score() void
start_score(void)
{ {
#ifdef SIGALRM #ifdef SIGALRM
signal(SIGALRM, SIG_IGN); signal(SIGALRM, SIG_IGN);
@ -169,8 +176,8 @@ start_score()
* issymlink: * issymlink:
* See if the file has a symbolic link * See if the file has a symbolic link
*/ */
issymlink(sp) bool
char *sp; issymlink(char *sp)
{ {
#ifdef S_IFLNK #ifdef S_IFLNK
struct stat sbuf2; struct stat sbuf2;
@ -188,7 +195,8 @@ char *sp;
* too_much: * too_much:
* See if the system is being used too much for this game * See if the system is being used too much for this game
*/ */
too_much() int
too_much(void)
{ {
#ifdef MAXLOAD #ifdef MAXLOAD
double avec[3]; double avec[3];
@ -208,7 +216,8 @@ too_much()
* author: * author:
* See if a user is an author of the program * See if a user is an author of the program
*/ */
author() bool
author(void)
{ {
#ifdef WIZARD #ifdef WIZARD
if (wizard) if (wizard)
@ -246,7 +255,7 @@ checkout(int s)
if (author()) if (author())
{ {
num_checks = 1; num_checks = 1;
chmsg("The load is rather high, O exaulted one"); chmsg("The load is rather high, O exaulted one", 0);
} }
else if (num_checks++ == 3) else if (num_checks++ == 3)
fatal("Sorry. You took to long. You are dead\n"); fatal("Sorry. You took to long. You are dead\n");
@ -265,7 +274,7 @@ checkout(int s)
if (num_checks) if (num_checks)
{ {
num_checks = 0; num_checks = 0;
chmsg("The load has dropped back down. You have a reprieve"); chmsg("The load has dropped back down. You have a reprieve", 0);
} }
#ifdef CHECKTIME #ifdef CHECKTIME
#ifdef SIGALRM #ifdef SIGALRM
@ -280,9 +289,8 @@ checkout(int s)
* checkout()'s version of msg. If we are in the middle of a * checkout()'s version of msg. If we are in the middle of a
* shell, do a printf instead of a msg to avoid the refresh. * shell, do a printf instead of a msg to avoid the refresh.
*/ */
chmsg(fmt, arg) void
char *fmt; chmsg(char *fmt, int arg)
int arg;
{ {
if (in_shell) if (in_shell)
{ {
@ -299,7 +307,8 @@ int arg;
* lock the score file. If it takes too long, ask the user if * lock the score file. If it takes too long, ask the user if
* they care to wait. Return TRUE if the lock is successful. * they care to wait. Return TRUE if the lock is successful.
*/ */
lock_sc() bool
lock_sc(void)
{ {
#ifdef SCOREFILE #ifdef SCOREFILE
#ifdef LOCKFILE #ifdef LOCKFILE
@ -361,7 +370,8 @@ over:
* unlock_sc: * unlock_sc:
* Unlock the score file * Unlock the score file
*/ */
unlock_sc() void
unlock_sc(void)
{ {
#ifdef SCOREFILE #ifdef SCOREFILE
#ifdef LOCKFILE #ifdef LOCKFILE
@ -374,7 +384,8 @@ unlock_sc()
* flush_type: * flush_type:
* Flush typeahead for traps, etc. * Flush typeahead for traps, etc.
*/ */
flush_type() void
flush_type(void)
{ {
flushinp(); flushinp();
} }

View file

@ -18,15 +18,15 @@
#include <signal.h> #include <signal.h>
#include <limits.h> #include <limits.h>
#include <string.h> #include <string.h>
#include <time.h>
#include "rogue.h" #include "rogue.h"
/* /*
* main: * main:
* The main program, of course * The main program, of course
*/ */
main(argc, argv, envp) int
char **argv; main(int argc, char *argv[], char *envp[])
char **envp;
{ {
register char *env; register char *env;
int lowtime; int lowtime;
@ -113,7 +113,7 @@ char **envp;
if (argc == 2 && strcmp(argv[1], "-s") == 0) if (argc == 2 && strcmp(argv[1], "-s") == 0)
{ {
noscore = TRUE; noscore = TRUE;
score(0, -1); score(0, -1, 0);
exit(0); exit(0);
} }
init_check(); /* check for legal startup */ init_check(); /* check for legal startup */
@ -227,8 +227,8 @@ endit(int a)
* fatal: * fatal:
* Exit the program, printing a message. * Exit the program, printing a message.
*/ */
fatal(s) void
char *s; fatal(char *s)
{ {
clear(); clear();
move(LINES-2, 0); move(LINES-2, 0);
@ -242,8 +242,8 @@ char *s;
* rnd: * rnd:
* Pick a very random number. * Pick a very random number.
*/ */
rnd(range) int
register int range; rnd(int range)
{ {
return range == 0 ? 0 : abs((int) RN) % range; return range == 0 ? 0 : abs((int) RN) % range;
} }
@ -252,8 +252,8 @@ register int range;
* roll: * roll:
* Roll a number of dice * Roll a number of dice
*/ */
roll(number, sides) int
register int number, sides; roll(int number, int sides)
{ {
register int dtotal = 0; register int dtotal = 0;
@ -299,7 +299,8 @@ tstp(int a)
* The main loop of the program. Loop until the game is over, * The main loop of the program. Loop until the game is over,
* refreshing things and looking at the proper times. * refreshing things and looking at the proper times.
*/ */
playit() void
playit(void)
{ {
register char *opts; register char *opts;
@ -352,7 +353,7 @@ quit(int a)
move(LINES - 1, 0); move(LINES - 1, 0);
refresh(); refresh();
writelog(purse, 1, 0); writelog(purse, 1, 0);
score(purse, 1); score(purse, 1, 0);
printf("[Press return to exit]\n"); printf("[Press return to exit]\n");
fflush(NULL); fflush(NULL);
getchar(); getchar();
@ -391,7 +392,8 @@ leave(int sig)
* shell: * shell:
* Let him escape for a while * Let him escape for a while
*/ */
shell() void
shell(void)
{ {
/* /*
* Set the terminal back to original mode * Set the terminal back to original mode

View file

@ -59,6 +59,7 @@
char *strdup(const char *s); char *strdup(const char *s);
#endif #endif
#include <ctype.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <errno.h> #include <errno.h>
@ -465,7 +466,7 @@ md_getrealname(int uid)
#endif #endif
} }
extern char *xcrypt(char *key, char *salt); extern char *xcrypt(const char *key, const char *setting);
char * char *
md_crypt(char *key, char *salt) md_crypt(char *key, char *salt)
@ -1046,6 +1047,7 @@ md_readchar(WINDOW *win)
int mode2 = M_NORMAL; int mode2 = M_NORMAL;
int nodelayf = 0; int nodelayf = 0;
int count = 0; int count = 0;
extern void auto_save(int sig);
for(;;) for(;;)
{ {

View file

@ -21,8 +21,7 @@
* Print the name of a trap * Print the name of a trap
*/ */
char * char *
tr_name(type) tr_name(char type)
char type;
{ {
switch (type) switch (type)
{ {
@ -47,8 +46,8 @@ char type;
* look: * look:
* A quick glance all around the player * A quick glance all around the player
*/ */
look(wakeup) void
bool wakeup; look(bool wakeup)
{ {
register int x, y; register int x, y;
register unsigned char ch; register unsigned char ch;
@ -204,8 +203,7 @@ bool wakeup;
* Find the unclaimed object at y, x * Find the unclaimed object at y, x
*/ */
THING * THING *
find_obj(y, x) find_obj(int y, int x)
register int y, x;
{ {
register THING *op; register THING *op;
@ -225,7 +223,8 @@ register int y, x;
* eat: * eat:
* She wants to eat something, so let her try * She wants to eat something, so let her try
*/ */
eat() void
eat(void)
{ {
register THING *obj; register THING *obj;
@ -272,8 +271,8 @@ eat()
* Used to modify the playes strength. It keeps track of the * Used to modify the playes strength. It keeps track of the
* highest it has been, just in case * highest it has been, just in case
*/ */
chg_str(amt) void
register int amt; chg_str(int amt)
{ {
str_t comp; str_t comp;
@ -293,9 +292,8 @@ register int amt;
* add_str: * add_str:
* Perform the actual add, checking upper and lower bound limits * Perform the actual add, checking upper and lower bound limits
*/ */
add_str(sp, amt) void
register str_t *sp; add_str(str_t *sp, int amt)
int amt;
{ {
if ((*sp += amt) < 3) if ((*sp += amt) < 3)
*sp = 3; *sp = 3;
@ -307,8 +305,8 @@ int amt;
* add_haste: * add_haste:
* Add a haste to the player * Add a haste to the player
*/ */
add_haste(potion) bool
bool potion; add_haste(bool potion)
{ {
if (on(player, ISHASTE)) if (on(player, ISHASTE))
{ {
@ -332,7 +330,8 @@ bool potion;
* aggravate: * aggravate:
* Aggravate all the monsters on this level * Aggravate all the monsters on this level
*/ */
aggravate() void
aggravate(void)
{ {
register THING *mi; register THING *mi;
@ -346,8 +345,7 @@ aggravate()
* "an". * "an".
*/ */
char * char *
vowelstr(str) vowelstr(char *str)
register char *str;
{ {
switch (*str) switch (*str)
{ {
@ -366,8 +364,8 @@ register char *str;
* is_current: * is_current:
* See if the object is one of the currently used items * See if the object is one of the currently used items
*/ */
is_current(obj) bool
register THING *obj; is_current(THING *obj)
{ {
if (obj == NULL) if (obj == NULL)
return FALSE; return FALSE;
@ -387,7 +385,8 @@ register THING *obj;
* Set up the direction co_ordinate for use in varios "prefix" * Set up the direction co_ordinate for use in varios "prefix"
* commands * commands
*/ */
get_dir() bool
get_dir(void)
{ {
register char *prompt; register char *prompt;
register bool gotit; register bool gotit;
@ -430,8 +429,8 @@ get_dir()
* sign: * sign:
* Return the sign of the number * Return the sign of the number
*/ */
sign(nm) int
register int nm; sign(int nm)
{ {
if (nm < 0) if (nm < 0)
return -1; return -1;
@ -443,8 +442,8 @@ register int nm;
* spread: * spread:
* Give a spread around a given number (+/- 10%) * Give a spread around a given number (+/- 10%)
*/ */
spread(nm) int
register int nm; spread(int nm)
{ {
return nm - nm / 10 + rnd(nm / 5); return nm - nm / 10 + rnd(nm / 5);
} }
@ -453,9 +452,8 @@ register int nm;
* call_it: * call_it:
* Call an object something after use. * Call an object something after use.
*/ */
call_it(know, guess) void
register bool know; call_it(bool know, char **guess)
register char **guess;
{ {
if (know && *guess) if (know && *guess)
{ {

View file

@ -15,6 +15,8 @@
#include <ctype.h> #include <ctype.h>
#include "rogue.h" #include "rogue.h"
int exp_add(THING *tp);
/* /*
* List of monsters in rough order of vorpalness * List of monsters in rough order of vorpalness
* *
@ -39,8 +41,8 @@ char wand_mons[] = {
* Pick a monster to show up. The lower the level, * Pick a monster to show up. The lower the level,
* the meaner the monster. * the meaner the monster.
*/ */
randmonster(wander) char
bool wander; randmonster(bool wander)
{ {
register int d; register int d;
register char *mons; register char *mons;
@ -61,10 +63,8 @@ bool wander;
* new_monster: * new_monster:
* Pick a new monster and add it to the list * Pick a new monster and add it to the list
*/ */
new_monster(tp, type, cp) void
register THING *tp; new_monster(THING *tp, char type, coord *cp)
char type;
register coord *cp;
{ {
register struct monster *mp; register struct monster *mp;
register int lev_add; register int lev_add;
@ -109,8 +109,8 @@ register coord *cp;
* expadd: * expadd:
* Experience to add for this monster's level/hit points * Experience to add for this monster's level/hit points
*/ */
exp_add(tp) int
register THING *tp; exp_add(THING *tp)
{ {
register int mod; register int mod;
@ -129,7 +129,8 @@ register THING *tp;
* wanderer: * wanderer:
* Create a new wandering monster and aim it at the player * Create a new wandering monster and aim it at the player
*/ */
wanderer() void
wanderer(void)
{ {
register int i; register int i;
register struct room *rp; register struct room *rp;
@ -166,8 +167,7 @@ wanderer()
* What to do when the hero steps next to a monster * What to do when the hero steps next to a monster
*/ */
THING * THING *
wake_monster(y, x) wake_monster(int y, int x)
int y, x;
{ {
register THING *tp; register THING *tp;
register struct room *rp; register struct room *rp;
@ -226,7 +226,8 @@ int y, x;
* genocide: * genocide:
* Wipe one monster out of existence (for now...) * Wipe one monster out of existence (for now...)
*/ */
genocide() void
genocide(void)
{ {
register THING *mp; register THING *mp;
register char c; register char c;
@ -270,8 +271,8 @@ genocide()
* give_pack: * give_pack:
* Give a pack to a monster if it deserves one * Give a pack to a monster if it deserves one
*/ */
give_pack(tp) void
register THING *tp; give_pack(THING *tp)
{ {
if (rnd(100) < monsters[tp->t_type-'A'].m_carry) if (rnd(100) < monsters[tp->t_type-'A'].m_carry)
attach(tp->t_pack, new_thing()); attach(tp->t_pack, new_thing());

View file

@ -14,6 +14,9 @@
#include <ctype.h> #include <ctype.h>
#include "rogue.h" #include "rogue.h"
void turnref(void);
char be_trapped(coord *tc);
/* /*
* Used to hold the new hero position * Used to hold the new hero position
*/ */
@ -24,8 +27,8 @@ coord nh;
* do_run: * do_run:
* Start the hero running * Start the hero running
*/ */
do_run(ch) void
char ch; do_run(char ch)
{ {
running = TRUE; running = TRUE;
after = FALSE; after = FALSE;
@ -37,8 +40,8 @@ char ch;
* Check to see that a move is legal. If it is handle the * Check to see that a move is legal. If it is handle the
* consequences (fighting, picking up, etc.) * consequences (fighting, picking up, etc.)
*/ */
do_move(dy, dx) void
int dy, dx; do_move(int dy, int dx)
{ {
register char ch, fl; register char ch, fl;
@ -189,7 +192,8 @@ move_stuff:
* turnref: * turnref:
* Decide whether to refresh at a passage turning or not * Decide whether to refresh at a passage turning or not
*/ */
turnref() void
turnref(void)
{ {
register int index; register int index;
@ -211,8 +215,8 @@ turnref()
* Called to illuminate a room. If it is dark, remove anything * Called to illuminate a room. If it is dark, remove anything
* that might move. * that might move.
*/ */
door_open(rp) void
struct room *rp; door_open(struct room *rp)
{ {
register int j, k; register int j, k;
register char ch; register char ch;
@ -238,8 +242,8 @@ struct room *rp;
* be_trapped: * be_trapped:
* The guy stepped on a trap.... Make him pay. * The guy stepped on a trap.... Make him pay.
*/ */
be_trapped(tc) char
register coord *tc; be_trapped(coord *tc)
{ {
register char tr; register char tr;
register int index; register int index;
@ -316,8 +320,7 @@ register coord *tc;
* Move in a random direction if the monster/person is confused * Move in a random direction if the monster/person is confused
*/ */
coord * coord *
rndmove(who) rndmove(THING *who)
THING *who;
{ {
register int x, y; register int x, y;
register char ch; register char ch;

View file

@ -11,6 +11,7 @@
* See the file LICENSE.TXT for full copyright and licensing information. * See the file LICENSE.TXT for full copyright and licensing information.
*/ */
#include <stdlib.h>
#include <time.h> #include <time.h>
#include <curses.h> #include <curses.h>
#include <string.h> #include <string.h>
@ -20,7 +21,11 @@
#define MAXTREAS 10 /* maximum number of treasures in a treasure room */ #define MAXTREAS 10 /* maximum number of treasures in a treasure room */
#define MINTREAS 2 /* minimum number of treasures in a treasure room */ #define MINTREAS 2 /* minimum number of treasures in a treasure room */
new_level() void put_things(void);
void treas_room(void);
void
new_level(void)
{ {
register int rm, i; register int rm, i;
register THING *tp; register THING *tp;
@ -112,7 +117,8 @@ new_level()
* rnd_room: * rnd_room:
* Pick a room that is really there * Pick a room that is really there
*/ */
rnd_room() int
rnd_room(void)
{ {
register int rm; register int rm;
@ -127,7 +133,8 @@ rnd_room()
* put_things: * put_things:
* Put potions and scrolls on this level * Put potions and scrolls on this level
*/ */
put_things() void
put_things(void)
{ {
register int i; register int i;
register THING *cur; register THING *cur;
@ -197,7 +204,8 @@ put_things()
*/ */
#define MAXTRIES 10 /* max number of tries to put down a monster */ #define MAXTRIES 10 /* max number of tries to put down a monster */
treas_room() void
treas_room(void)
{ {
register int nm, index; register int nm, index;
register THING *tp; register THING *tp;

View file

@ -36,7 +36,10 @@ typedef struct optstruct OPTION;
int allowchange(OPTION *opt); int allowchange(OPTION *opt);
int put_bool(), get_bool(), put_str(), get_str(); void put_bool(bool *b);
void put_str(char *str);
int get_bool(bool *bp, WINDOW *win);
int get_str(char *opt, WINDOW *win);
OPTION optlist[] = { OPTION optlist[] = {
{"terse", "Terse output: ", {"terse", "Terse output: ",
@ -63,7 +66,8 @@ OPTION optlist[] = {
* option: * option:
* Print and then set options from the terminal * Print and then set options from the terminal
*/ */
option() void
option(void)
{ {
register OPTION *op; register OPTION *op;
register int retval; register int retval;
@ -125,8 +129,8 @@ option()
* put_bool * put_bool
* Put out a boolean * Put out a boolean
*/ */
put_bool(b) void
bool *b; put_bool(bool *b)
{ {
waddstr(hw, *b ? "True" : "False"); waddstr(hw, *b ? "True" : "False");
} }
@ -135,8 +139,8 @@ bool *b;
* put_str: * put_str:
* Put out a string * Put out a string
*/ */
put_str(str) void
char *str; put_str(char *str)
{ {
waddstr(hw, str); waddstr(hw, str);
} }
@ -145,9 +149,8 @@ char *str;
* get_bool: * get_bool:
* Allow changing a boolean option and print it out * Allow changing a boolean option and print it out
*/ */
get_bool(bp, win) int
bool *bp; get_bool(bool *bp, WINDOW *win)
WINDOW *win;
{ {
register int oy, ox; register int oy, ox;
register bool op_bad; register bool op_bad;
@ -196,9 +199,8 @@ WINDOW *win;
*/ */
#define MAXINP 50 /* max string to read from terminal or environment */ #define MAXINP 50 /* max string to read from terminal or environment */
get_str(opt, win) int
register char *opt; get_str(char *opt, WINDOW *win)
WINDOW *win;
{ {
register char *sp; register char *sp;
register int c, oy, ox; register int c, oy, ox;
@ -274,9 +276,8 @@ WINDOW *win;
* get_num: * get_num:
* Get a numeric option * Get a numeric option
*/ */
get_num(opt, win) int
short *opt; get_num(short *opt, WINDOW *win)
WINDOW *win;
{ {
register int i; register int i;
char buf[MAXSTR]; char buf[MAXSTR];
@ -295,8 +296,8 @@ WINDOW *win;
* being "name=....", with the string being defined up to a comma * being "name=....", with the string being defined up to a comma
* or the end of the entire option string. * or the end of the entire option string.
*/ */
parse_opts(str) void
register char *str; parse_opts(char *str)
{ {
register char *sp; register char *sp;
register OPTION *op; register OPTION *op;
@ -373,9 +374,8 @@ register char *str;
* strucpy: * strucpy:
* Copy string using unctrol for things * Copy string using unctrol for things
*/ */
strucpy(s1, s2, len) void
register char *s1, *s2; strucpy(char *s1, char *s2, int len)
register int len;
{ {
if (len > MAXINP) if (len > MAXINP)
len = MAXINP; len = MAXINP;

View file

@ -14,14 +14,16 @@
#include <ctype.h> #include <ctype.h>
#include "rogue.h" #include "rogue.h"
void money(int value);
/* /*
* update_mdest: * update_mdest:
* Called after picking up an object, before discarding it. * Called after picking up an object, before discarding it.
* If this was the object of something's desire, that monster will * If this was the object of something's desire, that monster will
* get mad and run at the hero * get mad and run at the hero
*/ */
update_mdest(obj) void
register THING *obj; update_mdest(THING *obj)
{ {
register THING *mp; register THING *mp;
@ -36,9 +38,8 @@ register THING *obj;
* non-null use it as the linked_list pointer instead of gettting * non-null use it as the linked_list pointer instead of gettting
* it off the ground. * it off the ground.
*/ */
add_pack(obj, silent) void
register THING *obj; add_pack(THING *obj, bool silent)
bool silent;
{ {
register THING *op, *lp = NULL; register THING *op, *lp = NULL;
register bool exact, from_floor; register bool exact, from_floor;
@ -216,9 +217,8 @@ picked_up:
* inventory: * inventory:
* List what is in the pack * List what is in the pack
*/ */
inventory(list, type) bool
THING *list; inventory(THING *list, int type)
int type;
{ {
register char ch; register char ch;
register int n_objs; register int n_objs;
@ -253,8 +253,8 @@ int type;
* pick_up: * pick_up:
* Add something to characters pack. * Add something to characters pack.
*/ */
pick_up(ch) void
char ch; pick_up(char ch)
{ {
register THING *obj, *mp; register THING *obj, *mp;
@ -290,7 +290,8 @@ char ch;
* picky_inven: * picky_inven:
* Allow player to inventory a single item * Allow player to inventory a single item
*/ */
picky_inven() void
picky_inven(void)
{ {
register THING *obj; register THING *obj;
register char ch, mch; register char ch, mch;
@ -325,9 +326,7 @@ picky_inven()
* Pick something out of a pack for a purpose * Pick something out of a pack for a purpose
*/ */
THING * THING *
get_item(purpose, type) get_item(char *purpose, int type)
char *purpose;
int type;
{ {
register THING *obj; register THING *obj;
register char ch, och; register char ch, och;
@ -384,8 +383,8 @@ int type;
* pack_char: * pack_char:
* Return which character would address a pack object * Return which character would address a pack object
*/ */
pack_char(obj) char
register THING *obj; pack_char(THING *obj)
{ {
register THING *item; register THING *item;
register char c; register char c;
@ -403,8 +402,8 @@ register THING *obj;
* money: * money:
* Add or subtract gold from the pack * Add or subtract gold from the pack
*/ */
money(value) void
register int value; money(int value)
{ {
register char floor; register char floor;

View file

@ -10,14 +10,21 @@
* See the file LICENSE.TXT for full copyright and licensing information. * See the file LICENSE.TXT for full copyright and licensing information.
*/ */
#include <stdlib.h>
#include <curses.h> #include <curses.h>
#include "rogue.h" #include "rogue.h"
void conn(int r1, int r2);
void door(struct room *rm, coord *cp);
void passnum(void);
void numpass(int y, int x);
/* /*
* do_passages: * do_passages:
* Draw all the passages on a level. * Draw all the passages on a level.
*/ */
do_passages() void
do_passages(void)
{ {
register struct rdes *r1, *r2 = NULL; register struct rdes *r1, *r2 = NULL;
register int i, j; register int i, j;
@ -125,8 +132,8 @@ do_passages()
* conn: * conn:
* Draw a corridor from a room in a certain direction. * Draw a corridor from a room in a certain direction.
*/ */
conn(r1, r2) void
int r1, r2; conn(int r1, int r2)
{ {
register struct room *rpf, *rpt = NULL; register struct room *rpf, *rpt = NULL;
register char rmt; register char rmt;
@ -269,9 +276,8 @@ int r1, r2;
* Add a door or possibly a secret door. Also enters the door in * Add a door or possibly a secret door. Also enters the door in
* the exits array of the room. * the exits array of the room.
*/ */
door(rm, cp) void
register struct room *rm; door(struct room *rm, coord *cp)
register coord *cp;
{ {
register int index; register int index;
@ -291,7 +297,8 @@ register coord *cp;
* add_pass: * add_pass:
* Add the passages to the current window (wizard command) * Add the passages to the current window (wizard command)
*/ */
add_pass() void
add_pass(void)
{ {
register int y, x, ch; register int y, x, ch;
@ -309,7 +316,8 @@ add_pass()
static int pnum; static int pnum;
static bool newpnum; static bool newpnum;
passnum() void
passnum(void)
{ {
register struct room *rp; register struct room *rp;
register int i; register int i;
@ -330,8 +338,8 @@ passnum()
* numpass: * numpass:
* Number a passageway square and its brethren * Number a passageway square and its brethren
*/ */
numpass(y, x) void
register int y, x; numpass(int y, int x)
{ {
register char *fp; register char *fp;
register struct room *rp; register struct room *rp;

View file

@ -17,7 +17,8 @@
* quaff: * quaff:
* Quaff a potion from the pack * Quaff a potion from the pack
*/ */
quaff() void
quaff(void)
{ {
register THING *obj, *th; register THING *obj, *th;
register bool discardit = FALSE; register bool discardit = FALSE;
@ -203,7 +204,8 @@ quaff()
* invis_on: * invis_on:
* Turn on the ability to see invisible * Turn on the ability to see invisible
*/ */
invis_on() void
invis_on(void)
{ {
register THING *th; register THING *th;
@ -220,8 +222,8 @@ invis_on()
* see_monst: * see_monst:
* Put on or off seeing monsters on this level * Put on or off seeing monsters on this level
*/ */
turn_see(turn_off) bool
register bool turn_off; turn_see(bool turn_off)
{ {
register THING *mp; register THING *mp;
register bool can_see, add_new; register bool can_see, add_new;

View file

@ -14,11 +14,14 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
int gethand(void);
/* /*
* ring_on: * ring_on:
* Put a ring on a hand * Put a ring on a hand
*/ */
ring_on() void
ring_on(void)
{ {
register THING *obj; register THING *obj;
register int ring; register int ring;
@ -88,7 +91,8 @@ ring_on()
* ring_off: * ring_off:
* Take off a ring * Take off a ring
*/ */
ring_off() void
ring_off(void)
{ {
register int ring; register int ring;
register THING *obj; register THING *obj;
@ -125,7 +129,8 @@ ring_off()
* gethand: * gethand:
* Which hand is the hero interested in? * Which hand is the hero interested in?
*/ */
gethand() int
gethand(void)
{ {
register int c; register int c;
@ -153,8 +158,8 @@ gethand()
* ring_eat: * ring_eat:
* How much food does this ring use up? * How much food does this ring use up?
*/ */
ring_eat(hand) int
register int hand; ring_eat(int hand)
{ {
if (cur_ring[hand] == NULL) if (cur_ring[hand] == NULL)
return 0; return 0;
@ -186,8 +191,7 @@ register int hand;
* Print ring bonuses * Print ring bonuses
*/ */
char * char *
ring_num(obj) ring_num(THING *obj)
register THING *obj;
{ {
static char buf[5]; static char buf[5];

View file

@ -19,6 +19,8 @@
#include <stdlib.h> #include <stdlib.h>
#include "rogue.h" #include "rogue.h"
char *killname(char monst, bool doart);
static char *rip[] = { static char *rip[] = {
" __________", " __________",
" / \\", " / \\",
@ -41,9 +43,8 @@ static char *rip[] = {
* Figure score and post it. * Figure score and post it.
*/ */
/* VARARGS2 */ /* VARARGS2 */
score(amount, flags, monst) void
int amount, flags; score(int amount, int flags, char monst)
char monst;
{ {
register struct sc_ent *scp; register struct sc_ent *scp;
register int i; register int i;
@ -297,8 +298,8 @@ void writelog(int amount, int flags, char monst)
* death: * death:
* Do something really fun when he dies * Do something really fun when he dies
*/ */
death(monst) void
register char monst; death(char monst)
{ {
register char **dp = rip, *killer; register char **dp = rip, *killer;
register struct tm *lt; register struct tm *lt;
@ -341,7 +342,8 @@ register char monst;
* total_winner: * total_winner:
* Code for a winner * Code for a winner
*/ */
total_winner() void
total_winner(void)
{ {
register THING *obj; register THING *obj;
register int worth = 0; register int worth = 0;
@ -461,9 +463,7 @@ total_winner()
* Convert a code to a monster name * Convert a code to a monster name
*/ */
char * char *
killname(monst, doart) killname(char monst, bool doart)
register char monst;
bool doart;
{ {
register const char *sp; register const char *sp;
register bool article; register bool article;

View file

@ -107,6 +107,7 @@ extern const char *metal[];
#define STICK '/' #define STICK '/'
#define CALLABLE -1 #define CALLABLE -1
int spread(int nm);
/* /*
* Various constants * Various constants
*/ */
@ -477,7 +478,157 @@ coord *find_dest(), *rndmove();
THING *find_mons(), *find_obj(), *get_item(), *new_item(), THING *find_mons(), *find_obj(), *get_item(), *new_item(),
*new_thing(), *wake_monster(); *new_thing(), *wake_monster();
struct room *roomin(); struct room *roomin(coord *cp);
void _attach(THING **list, THING *item);
void _detach(THING **list, THING *item);
void _free_list(THING **ptr);
bool add_haste(bool potion);
void add_pack(THING *obj, bool silent);
void add_str(str_t *sp, int amt);
void addmsg(char *fmt, ...);
void aggravate(void);
int attack(THING *mp);
void auto_save(int sig);
void call_it(bool know, char **guess);
bool cansee(int y, int x);
char *charge_str(THING *obj);
void check_level(void);
void chg_str(int amt);
void command(void);
void death(char monst);
bool diag_ok(coord *sp, coord *ep);
void discard(THING *item);
void discovered(void);
void do_daemons(int flag);
void do_fuses(int flag);
void do_motion(THING *obj, int ydelta, int xdelta);
void do_move(int dy, int dx);
void do_passages(void);
void do_rooms(void);
void do_run(char ch);
void do_zap(void);
void doctor(void);
void door_open(struct room *rp);
void drop(void);
bool dropcheck(THING *op);
void eat(void);
int encread(void *starta, int size, int inf);
void encwrite(void *starta, int size, FILE *outf);
void endmsg(void);
void enter_room(coord *cp);
void extinguish(int (*func)());
void fall(THING *obj, bool pr);
bool fallpos(coord *pos, coord *newpos, bool pass);
void fatal(char *s);
bool fight(coord *mp, char mn, THING *weap, bool thrown);
THING *find_obj(int y, int x);
void fire_bolt(coord *start, coord *dir, char *name);
void fix_stick(THING *cur);
void flush_type(void);
void fuse(int (*func)(), int arg, int time, int type);
void genocide(void);
bool get_dir(void);
THING *get_item(char *purpose, int type);
int get_str(char *opt, WINDOW *win);
void give_pack(THING *tp);
bool hit_monster(int y, int x, THING *obj);
void init_check(void);
void init_colors(void);
void init_materials(void);
void init_names(void);
void init_player(void);
void init_stones(void);
void init_things(void);
void init_weapon(THING *weap, char type);
char *inv_name(THING *obj, bool drop);
bool inventory(THING *list, int type);
void invis_on(void);
bool is_current(THING *obj);
bool is_magic(THING *obj);
bool issymlink(char *sp);
void kill_daemon(int (*func)());
void killed(THING *tp, bool pr);
void leave(int sig);
void leave_room(coord *cp);
void lengthen(int (*func)(), int xtime);
bool lock_sc(void);
void look(bool wakeup);
void missile(int ydelta, int xdelta);
void msg(char *fmt, ...);
THING *new_item(void);
void new_level(void);
void new_monster(THING *tp, char type, coord *cp);
THING *new_thing(void);
void nohaste(void);
char *num(int n1, int n2, char type);
void open_log(void);
void open_score(void);
void option(void);
char pack_char(THING *obj);
void parse_opts(char *str);
void pick_up(char ch);
void picky_inven(void);
void playit(void);
void quaff(void);
void quit(int a);
void raise_level(void);
char randmonster(bool wander);
void read_scroll(void);
int readchar(void);
int readcharw(WINDOW *win);
void remove_monster(coord *mp, THING *tp, bool waskill);
bool restore(char *file, char **envp);
int ring_eat(int hand);
char *ring_num(THING *obj);
void ring_off(void);
void ring_on(void);
int rnd(int range);
void rnd_pos(struct room *rp, coord *cp);
int rnd_room(void);
coord *rndmove(THING *who);
int roll(int number, int sides);
void rollwand(void);
void runners(void);
void runto(coord *runner, coord *spot);
bool save(int which);
bool save_game(void);
bool save_throw(int which, THING *tp);
void score(int amount, int flags, char monst);
bool see_monst(THING *mp);
void setup(void);
void shell(void);
void show_win(WINDOW *scr, char *message);
void sight(void);
int sign(int nm);
void start_daemon(int (*func)(), int arg, int type);
void start_score(void);
void status(void);
bool step_ok(char ch);
void stomach(void);
void strucpy(char *s1, char *s2, int len);
void swander(void);
bool swing(int at_lvl, int op_arm, int wplus);
void take_off(void);
int teleport(void);
void total_winner(void);
char *tr_name(char type);
bool turn_see(bool turn_off);
void unconfuse(void);
char *unctrol(char ch);
void unlock_sc(void);
void unsee(void);
char *vowelstr(char *str);
char *xcrypt(const char *key, const char *setting);
void w_wait_for(WINDOW *win, char ch);
void wait_for(char ch);
THING *wake_monster(int y, int x);
void wanderer(void);
void waste_time(void);
void wear(void);
void whatis(bool insist);
void wield(void);
void writelog(int amount, int flags, char monst);
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"

View file

@ -16,11 +16,16 @@
#define GOLDGRP 1 #define GOLDGRP 1
void draw_room(struct room *rp);
void vert(struct room *rp, int startx);
void horiz(struct room *rp, int starty);
/* /*
* do_rooms: * do_rooms:
* Create rooms and corridors with a connectivity graph * Create rooms and corridors with a connectivity graph
*/ */
do_rooms() void
do_rooms(void)
{ {
register int i; register int i;
register struct room *rp; register struct room *rp;
@ -120,8 +125,8 @@ do_rooms()
* draw_room: * draw_room:
* Draw a box around a room and lay down the floor * Draw a box around a room and lay down the floor
*/ */
draw_room(rp) void
register struct room *rp; draw_room(struct room *rp)
{ {
register int y, x; register int y, x;
@ -147,9 +152,8 @@ register struct room *rp;
* vert: * vert:
* Draw a vertical line * Draw a vertical line
*/ */
vert(rp, startx) void
register struct room *rp; vert(struct room *rp, int startx)
register int startx;
{ {
register int y; register int y;
@ -161,9 +165,8 @@ register int startx;
* horiz: * horiz:
* Draw a horizontal line * Draw a horizontal line
*/ */
horiz(rp, starty) void
register struct room *rp; horiz(struct room *rp, int starty)
int starty;
{ {
register int x; register int x;
@ -175,9 +178,8 @@ int starty;
* rnd_pos: * rnd_pos:
* Pick a random spot in a room * Pick a random spot in a room
*/ */
rnd_pos(rp, cp) void
register struct room *rp; rnd_pos(struct room *rp, coord *cp)
register coord *cp;
{ {
cp->x = rp->r_pos.x + rnd(rp->r_max.x - 2) + 1; cp->x = rp->r_pos.x + rnd(rp->r_max.x - 2) + 1;
cp->y = rp->r_pos.y + rnd(rp->r_max.y - 2) + 1; cp->y = rp->r_pos.y + rnd(rp->r_max.y - 2) + 1;
@ -187,8 +189,8 @@ register coord *cp;
* enter_room: * enter_room:
* Code that is executed whenver you appear in a room * Code that is executed whenver you appear in a room
*/ */
enter_room(cp) void
register coord *cp; enter_room(coord *cp)
{ {
register struct room *rp; register struct room *rp;
register int y, x; register int y, x;
@ -220,8 +222,8 @@ register coord *cp;
* leave_room: * leave_room:
* Code for when we exit a room * Code for when we exit a room
*/ */
leave_room(cp) void
register coord *cp; leave_room(coord *cp)
{ {
register int y, x; register int y, x;
register struct room *rp; register struct room *rp;

View file

@ -21,6 +21,10 @@
#undef KERNEL #undef KERNEL
#include "rogue.h" #include "rogue.h"
void save_file(FILE *savef);
extern int rs_save_file(FILE *savef);
extern int rs_restore_file(int inf);
typedef struct stat STAT; typedef struct stat STAT;
extern char version[], encstr[]; extern char version[], encstr[];
@ -33,7 +37,8 @@ STAT sbuf;
* Implement the "save game" command * Implement the "save game" command
*/ */
/* This has to be cleaned up, these goto's are annoying. */ /* This has to be cleaned up, these goto's are annoying. */
save_game() bool
save_game(void)
{ {
register FILE *savef; register FILE *savef;
register int c; register int c;
@ -151,8 +156,8 @@ auto_save(int sig)
* save_file: * save_file:
* Write the saved game on the file * Write the saved game on the file
*/ */
save_file(savef) void
register FILE *savef; save_file(FILE *savef)
{ {
int slines = LINES; int slines = LINES;
int scols = COLS; int scols = COLS;
@ -189,9 +194,8 @@ register FILE *savef;
* Restore a saved game from a file with elaborate checks for file * Restore a saved game from a file with elaborate checks for file
* integrity from cheaters * integrity from cheaters
*/ */
restore(file, envp) bool
register char *file; restore(char *file, char **envp)
char **envp;
{ {
register int inf; register int inf;
register bool syml; register bool syml;
@ -324,10 +328,8 @@ char **envp;
* encwrite: * encwrite:
* Perform an encrypted write * Perform an encrypted write
*/ */
encwrite(starta, size, outf) void
void *starta; encwrite(void *starta, int size, FILE *outf)
unsigned int size;
register FILE *outf;
{ {
register char *ep; register char *ep;
register char *start = (char *) starta; register char *start = (char *) starta;
@ -345,10 +347,8 @@ register FILE *outf;
* encread: * encread:
* Perform an encrypted read * Perform an encrypted read
*/ */
encread(starta, size, inf) int
register void *starta; encread(void *starta, int size, int inf)
unsigned int size;
register int inf;
{ {
register char *ep; register char *ep;
register int read_size; register int read_size;

View file

@ -18,7 +18,8 @@
* read_scroll: * read_scroll:
* Read a scroll from the pack and do the appropriate thing * Read a scroll from the pack and do the appropriate thing
*/ */
read_scroll() void
read_scroll(void)
{ {
register THING *obj; register THING *obj;
register int y, x; register int y, x;

View file

@ -1335,7 +1335,7 @@ rs_read_object_list(int inf, THING **list)
{ {
for (i = 0; i < cnt; i++) for (i = 0; i < cnt; i++)
{ {
l = new_item(sizeof(THING)); l = new_item();
memset(l,0,sizeof(THING)); memset(l,0,sizeof(THING));
l->l_prev = previous; l->l_prev = previous;
if (previous != NULL) if (previous != NULL)

View file

@ -16,12 +16,14 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
void drain(void);
/* /*
* fix_stick: * fix_stick:
* Set up a new stick * Set up a new stick
*/ */
fix_stick(cur) void
register THING *cur; fix_stick(THING *cur)
{ {
if (strcmp(ws_type[cur->o_which], "staff") == 0) if (strcmp(ws_type[cur->o_which], "staff") == 0)
strcpy(cur->o_damage,"2d3"); strcpy(cur->o_damage,"2d3");
@ -45,7 +47,8 @@ register THING *cur;
* do_zap: * do_zap:
* Perform a zap with a wand * Perform a zap with a wand
*/ */
do_zap() void
do_zap(void)
{ {
register THING *obj, *tp; register THING *obj, *tp;
register int y, x; register int y, x;
@ -272,7 +275,8 @@ do_zap()
* drain: * drain:
* Do drain hit points from player shtick * Do drain hit points from player shtick
*/ */
drain() void
drain(void)
{ {
register THING *mp; register THING *mp;
register int cnt; register int cnt;
@ -321,9 +325,8 @@ drain()
* fire_bolt: * fire_bolt:
* Fire a bolt in a given direction from a specific starting place * Fire a bolt in a given direction from a specific starting place
*/ */
fire_bolt(start, dir, name) void
coord *start, *dir; fire_bolt(coord *start, coord *dir, char *name)
char *name;
{ {
register char dirch, ch; register char dirch, ch;
register THING *tp; register THING *tp;
@ -446,8 +449,7 @@ def:
* Return an appropriate string for a wand charge * Return an appropriate string for a wand charge
*/ */
char * char *
charge_str(obj) charge_str(THING *obj)
register THING *obj;
{ {
static char buf[20]; static char buf[20];

View file

@ -16,6 +16,11 @@
#include <string.h> #include <string.h>
#include "rogue.h" #include "rogue.h"
int pick_one(struct magic_item *magic, int nitems);
void print_disc(char type);
void set_order(short *order, int numthings);
char *nothing(char type);
bool got_genocide = FALSE; bool got_genocide = FALSE;
/* /*
@ -24,9 +29,7 @@ bool got_genocide = FALSE;
* inventory. * inventory.
*/ */
char * char *
inv_name(obj, drop) inv_name(THING *obj, bool drop)
register THING *obj;
register bool drop;
{ {
register char *pb; register char *pb;
@ -163,7 +166,8 @@ register bool drop;
* drop: * drop:
* Put something down * Put something down
*/ */
drop() void
drop(void)
{ {
register char ch; register char ch;
register THING *nobj, *op; register THING *nobj, *op;
@ -211,8 +215,8 @@ drop()
* dropcheck: * dropcheck:
* Do special checks for dropping or unweilding|unwearing|unringing * Do special checks for dropping or unweilding|unwearing|unringing
*/ */
dropcheck(op) bool
register THING *op; dropcheck(THING *op)
{ {
if (op == NULL) if (op == NULL)
return TRUE; return TRUE;
@ -253,7 +257,7 @@ register THING *op;
* Return a new thing * Return a new thing
*/ */
THING * THING *
new_thing() new_thing(void)
{ {
register THING *cur; register THING *cur;
register int j, k; register int j, k;
@ -361,9 +365,8 @@ new_thing()
* pick_one: * pick_one:
* Pick an item out of a list of nitems possible magic items * Pick an item out of a list of nitems possible magic items
*/ */
pick_one(magic, nitems) int
register struct magic_item *magic; pick_one(struct magic_item *magic, int nitems)
int nitems;
{ {
register struct magic_item *end; register struct magic_item *end;
register int i; register int i;
@ -398,7 +401,8 @@ static bool newpage = FALSE;
static char *lastfmt, *lastarg; static char *lastfmt, *lastarg;
discovered() void
discovered(void)
{ {
register char ch; register char ch;
register bool disc_list; register bool disc_list;
@ -456,8 +460,8 @@ discovered()
#define MAX(a,b,c,d) (a > b ? (a > c ? (a > d ? a : d) : (c > d ? c : d)) : (b > c ? (b > d ? b : d) : (c > d ? c : d))) #define MAX(a,b,c,d) (a > b ? (a > c ? (a > d ? a : d) : (c > d ? c : d)) : (b > c ? (b > d ? b : d) : (c > d ? c : d)))
print_disc(type) void
char type; print_disc(char type)
{ {
register bool *know = NULL; register bool *know = NULL;
register char **guess = NULL; register char **guess = NULL;
@ -508,9 +512,8 @@ char type;
* set_order: * set_order:
* Set up order for list * Set up order for list
*/ */
set_order(order, numthings) void
short *order; set_order(short *order, int numthings)
int numthings;
{ {
register int i, r, t; register int i, r, t;
@ -591,8 +594,7 @@ end_line()
* Set up prbuf so that message for "nothing found" is there * Set up prbuf so that message for "nothing found" is there
*/ */
char * char *
nothing(type) nothing(char type)
register char type;
{ {
register char *sp, *tystr = NULL; register char *sp, *tystr = NULL;

View file

@ -39,8 +39,8 @@ static struct init_weps {
* missile: * missile:
* Fire a missile in a given direction * Fire a missile in a given direction
*/ */
missile(ydelta, xdelta) void
int ydelta, xdelta; missile(int ydelta, int xdelta)
{ {
register THING *obj, *nitem; register THING *obj, *nitem;
@ -86,9 +86,8 @@ int ydelta, xdelta;
* Do the actual motion on the screen done by an object traveling * Do the actual motion on the screen done by an object traveling
* across the room * across the room
*/ */
do_motion(obj, ydelta, xdelta) void
register THING *obj; do_motion(THING *obj, int ydelta, int xdelta)
register int ydelta, xdelta;
{ {
/* /*
* Come fly with us ... * Come fly with us ...
@ -129,9 +128,8 @@ register int ydelta, xdelta;
* fall: * fall:
* Drop an item someplace around here. * Drop an item someplace around here.
*/ */
fall(obj, pr) void
register THING *obj; fall(THING *obj, bool pr)
register bool pr;
{ {
static coord fpos; static coord fpos;
register int index; register int index;
@ -163,9 +161,8 @@ register bool pr;
* init_weapon: * init_weapon:
* Set up the initial goodies for a weapon * Set up the initial goodies for a weapon
*/ */
init_weapon(weap, type) void
register THING *weap; init_weapon(THING *weap, char type)
char type;
{ {
register struct init_weps *iwp; register struct init_weps *iwp;
@ -187,9 +184,8 @@ char type;
* hit_monster: * hit_monster:
* Does the missile hit the monster? * Does the missile hit the monster?
*/ */
hit_monster(y, x, obj) bool
register int y, x; hit_monster(int y, int x, THING *obj)
THING *obj;
{ {
static coord mp; static coord mp;
@ -203,9 +199,7 @@ THING *obj;
* Figure out the plus number for armor/weapons * Figure out the plus number for armor/weapons
*/ */
char * char *
num(n1, n2, type) num(int n1, int n2, char type)
register int n1, n2;
register char type;
{ {
static char numbuf[10]; static char numbuf[10];
@ -219,7 +213,8 @@ register char type;
* wield: * wield:
* Pull out a certain weapon * Pull out a certain weapon
*/ */
wield() void
wield(void)
{ {
register THING *obj, *oweapon; register THING *obj, *oweapon;
register char *sp; register char *sp;
@ -257,9 +252,8 @@ bad:
* fallpos: * fallpos:
* Pick a random position around the give (y, x) coordinates * Pick a random position around the give (y, x) coordinates
*/ */
fallpos(pos, newpos, pass) bool
register coord *pos, *newpos; fallpos(coord *pos, coord *newpos, bool pass)
register bool pass;
{ {
register int y, x, cnt, ch; register int y, x, cnt, ch;

View file

@ -16,8 +16,8 @@
* whatis: * whatis:
* What a certin object is * What a certin object is
*/ */
whatis(insist) void
bool insist; whatis(bool insist)
{ {
register THING *obj; register THING *obj;
@ -80,7 +80,8 @@ bool insist;
* create_obj: * create_obj:
* Wizard command for getting anything he wants * Wizard command for getting anything he wants
*/ */
create_obj() void
create_obj(void)
{ {
register THING *obj; register THING *obj;
register char ch, bless; register char ch, bless;
@ -150,7 +151,8 @@ create_obj()
* telport: * telport:
* Bamf the hero someplace else * Bamf the hero someplace else
*/ */
teleport() int
teleport(void)
{ {
register int rm; register int rm;
coord c; coord c;
@ -194,7 +196,8 @@ teleport()
* passwd: * passwd:
* See if user knows password * See if user knows password
*/ */
passwd() bool
passwd(void)
{ {
register char *sp, c; register char *sp, c;
char buf[MAXSTR], *xcrypt(); char buf[MAXSTR], *xcrypt();
@ -219,7 +222,8 @@ passwd()
* show_map: * show_map:
* Print out the map for the wizard * Print out the map for the wizard
*/ */
show_map() void
show_map(void)
{ {
register int y, x, real; register int y, x, real;