Super-Rogue: convert to ANSI-style function declarations.

This fixes most of the build warnings.
This commit is contained in:
John "Elwin" Edwards 2016-01-31 13:45:07 -05:00
parent 0f87d5b4d8
commit 59f448e92e
33 changed files with 783 additions and 518 deletions

View file

@ -21,7 +21,8 @@
* wear: * wear:
* The player wants to wear something, so let the hero try * The player wants to wear something, so let the hero try
*/ */
wear() void
wear(void)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -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)
{ {
reg struct object *obj; reg struct object *obj;
@ -69,9 +71,8 @@ take_off()
* initarmor: * initarmor:
* Initialize some armor. * Initialize some armor.
*/ */
initarmor(obj, what) void
struct object *obj; initarmor(struct object *obj, int what)
int what;
{ {
struct init_armor *iwa; struct init_armor *iwa;
struct magic_item *mi; struct magic_item *mi;
@ -90,8 +91,8 @@ int what;
* hurt_armor: * hurt_armor:
* Returns TRUE if armor is damaged * Returns TRUE if armor is damaged
*/ */
hurt_armor(obj) bool
struct object *obj; hurt_armor(struct object *obj)
{ {
reg int type, ac; reg int type, ac;

View file

@ -14,19 +14,24 @@
* 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 "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
#define FARAWAY 32767 #define FARAWAY 32767
#define RDIST(a, b) (DISTANCE((a)->y, (a)->x, (b).y, (b).x)) #define RDIST(a, b) (DISTANCE((a)->y, (a)->x, (b).y, (b).x))
int do_chase(struct linked_list *mon);
int chase(struct thing *tp, struct coord *ee, bool runaway, bool dofight);
struct coord ch_ret; /* Where chasing takes you */ struct coord ch_ret; /* Where chasing takes you */
/* /*
* runners: * runners:
* Make all the running monsters move. * Make all the running monsters move.
*/ */
runners() void
runners(void)
{ {
reg struct thing *tp; reg struct thing *tp;
reg struct linked_list *mon,*nextmon; reg struct linked_list *mon,*nextmon;
@ -54,8 +59,8 @@ runners()
* do_chase: * do_chase:
* Make one thing chase another. * Make one thing chase another.
*/ */
do_chase(mon) int
struct linked_list *mon; do_chase(struct linked_list *mon)
{ {
reg struct thing *th; reg struct thing *th;
reg struct room *rer, *ree, *rxx; reg struct room *rer, *ree, *rxx;
@ -241,10 +246,8 @@ struct linked_list *mon;
* chasee. Returns TRUE if we want to keep on chasing * chasee. Returns TRUE if we want to keep on chasing
* later FALSE if we reach the goal. * later FALSE if we reach the goal.
*/ */
chase(tp, ee, runaway, dofight) int
struct thing *tp; chase(struct thing *tp, struct coord *ee, bool runaway, bool dofight)
struct coord *ee;
bool runaway, dofight;
{ {
reg int x, y, ch; reg int x, y, ch;
reg int dist, thisdist, closest; reg int dist, thisdist, closest;
@ -385,9 +388,8 @@ bool runaway, dofight;
* runto: * runto:
* Set a monster running after something * Set a monster running after something
*/ */
runto(runner, spot) void
struct coord *runner; runto(struct coord *runner, struct coord *spot)
struct coord *spot;
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct thing *tp; reg struct thing *tp;
@ -409,8 +411,7 @@ struct coord *spot;
* NULL means they aren't in any room. * NULL means they aren't in any room.
*/ */
struct room * struct room *
roomin(cp) roomin(struct coord *cp)
struct coord *cp;
{ {
reg struct room *rp; reg struct room *rp;
@ -428,8 +429,7 @@ struct coord *cp;
* Find the monster from his coordinates * Find the monster from his coordinates
*/ */
struct linked_list * struct linked_list *
find_mons(y, x) find_mons(int y, int x)
int y, x;
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct thing *th; reg struct thing *th;
@ -447,8 +447,8 @@ int y, x;
* 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
struct coord *sp, *ep; diag_ok(struct coord *sp, struct coord *ep)
{ {
if (ep->x == sp->x || ep->y == sp->y) if (ep->x == sp->x || ep->y == sp->y)
return TRUE; return TRUE;
@ -462,8 +462,8 @@ struct 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
int y, x; cansee(int y, int x)
{ {
reg struct room *rer; reg struct room *rer;
struct coord tp; struct coord tp;

View file

@ -29,11 +29,19 @@
#include <unistd.h> #include <unistd.h>
#endif #endif
void search(void);
void help(void);
void d_level(void);
void u_level(void);
void shell(void);
void call(void);
/* /*
* command: * command:
* Process the user commands * Process the user commands
*/ */
command() void
command(void)
{ {
reg char ch; reg char ch;
reg int ntimes = 1; /* Number of player moves */ reg int ntimes = 1; /* Number of player moves */
@ -416,7 +424,8 @@ quit(int a)
* Player gropes about him to find hidden things. * Player gropes about him to find hidden things.
*/ */
search() void
search(void)
{ {
reg int x, y; reg int x, y;
reg char ch; reg char ch;
@ -461,7 +470,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)
{ {
extern struct h_list helpstr[]; extern struct h_list helpstr[];
reg struct h_list *strp; reg struct h_list *strp;
@ -519,8 +529,7 @@ help()
* Tell the player what a certain thing is. * Tell the player what a certain thing is.
*/ */
char * char *
identify(what) identify(int what)
int what;
{ {
reg char ch, *str; reg char ch, *str;
@ -581,7 +590,8 @@ int what;
* 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 (winat(hero.y, hero.x) != STAIRS) if (winat(hero.y, hero.x) != STAIRS)
msg("I see no way down."); msg("I see no way down.");
@ -599,7 +609,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 (winat(hero.y, hero.x) == STAIRS) { if (winat(hero.y, hero.x) == STAIRS) {
if (pl_on(ISHELD)) { if (pl_on(ISHELD)) {
@ -624,7 +635,8 @@ u_level()
/* /*
* Let him escape for a while * Let him escape for a while
*/ */
shell() void
shell(void)
{ {
reg int pid; reg int pid;
reg char *sh; reg char *sh;
@ -659,7 +671,8 @@ shell()
* 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)
{ {
reg struct object *obj; reg struct object *obj;
reg struct linked_list *item; reg struct linked_list *item;

View file

@ -34,8 +34,7 @@ struct delayed_action d_list[MAXDAEMONS] = {
* Insert a function in the daemon list. * Insert a function in the daemon list.
*/ */
struct delayed_action * struct delayed_action *
d_insert(func, arg, type, time) d_insert(int (*func)(), int arg, int type, int time)
int arg, type, time, (*func)();
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -51,8 +50,8 @@ int arg, type, time, (*func)();
return NULL; return NULL;
} }
d_delete(wire) void
struct delayed_action *wire; d_delete(struct delayed_action *wire)
{ {
reg struct delayed_action *d1, *d2; reg struct delayed_action *d1, *d2;
@ -73,8 +72,7 @@ struct delayed_action *wire;
* 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)())
int (*func)();
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -88,8 +86,8 @@ 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 arg, type, (*func)(); start_daemon(int (*func)(), int arg, int type)
{ {
d_insert(func, arg, type, DAEMON); d_insert(func, arg, type, DAEMON);
} }
@ -99,8 +97,8 @@ int arg, type, (*func)();
* Run all the daemons that are active with the current * Run all the daemons that are active with the current
* flag, passing the argument to the function. * flag, passing the argument to the function.
*/ */
do_daemons(flag) void
int flag; do_daemons(int flag)
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -113,8 +111,8 @@ 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) void
int (*func)(), arg, time; fuse(int (*func)(), int arg, int time)
{ {
d_insert(func, arg, AFTER, time); d_insert(func, arg, AFTER, time);
} }
@ -123,8 +121,8 @@ int (*func)(), arg, time;
* lengthen: * lengthen:
* Increase the time until a fuse goes off * Increase the time until a fuse goes off
*/ */
lengthen(func, xtime) void
int (*func)(), xtime; lengthen(int (*func)(), int xtime)
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -137,8 +135,8 @@ int (*func)(), xtime;
* extinguish: * extinguish:
* Put out a fuse. Find all such fuses and kill them. * Put out a fuse. Find all such fuses and kill them.
*/ */
extinguish(func) void
int (*func)(); extinguish(int (*func)())
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -151,7 +149,8 @@ int (*func)();
* do_fuses: * do_fuses:
* Decrement counters and start needed fuses * Decrement counters and start needed fuses
*/ */
do_fuses() void
do_fuses(void)
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -170,7 +169,8 @@ do_fuses()
* activity: * activity:
* Show wizard number of demaons and memory blocks used * Show wizard number of demaons and memory blocks used
*/ */
activity() void
activity(void)
{ {
msg("Daemons = %d : Memory Items = %d : Memory Used = %d", msg("Daemons = %d : Memory Items = %d : Memory Used = %d",
demoncnt,total,md_memused()); demoncnt,total,md_memused());

View file

@ -23,8 +23,8 @@ int between = 0;
* doctor: * doctor:
* A healing daemon that restores hit points after rest * A healing daemon that restores hit points after rest
*/ */
doctor(fromfuse) void
int fromfuse; doctor(int fromfuse)
{ {
reg int *thp, lv, ohp, ccon; reg int *thp, lv, ohp, ccon;
@ -63,8 +63,8 @@ int fromfuse;
* 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(fromfuse) void
int fromfuse; swander(int fromfuse)
{ {
start_daemon(rollwand, TRUE, AFTER); start_daemon(rollwand, TRUE, AFTER);
} }
@ -74,8 +74,8 @@ int fromfuse;
* 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(fromfuse) void
int fromfuse; rollwand(int fromfuse)
{ {
if (++between >= 4) { if (++between >= 4) {
@ -94,8 +94,8 @@ int fromfuse;
* unconfuse: * unconfuse:
* Release the poor player from his confusion * Release the poor player from his confusion
*/ */
unconfuse(fromfuse) void
int fromfuse; unconfuse(int fromfuse)
{ {
if (pl_on(ISHUH)) if (pl_on(ISHUH))
msg("You feel less confused now."); msg("You feel less confused now.");
@ -106,8 +106,8 @@ int fromfuse;
* unsee: * unsee:
* He lost his see invisible power * He lost his see invisible power
*/ */
unsee(fromfuse) void
int fromfuse; unsee(int fromfuse)
{ {
player.t_flags &= ~CANSEE; player.t_flags &= ~CANSEE;
} }
@ -116,8 +116,8 @@ int fromfuse;
* sight: * sight:
* He gets his sight back * He gets his sight back
*/ */
sight(fromfuse) void
int fromfuse; sight(int fromfuse)
{ {
if (pl_on(ISBLIND)) if (pl_on(ISBLIND))
msg("The veil of darkness lifts."); msg("The veil of darkness lifts.");
@ -129,8 +129,8 @@ int fromfuse;
* nohaste: * nohaste:
* End the hasting * End the hasting
*/ */
nohaste(fromfuse) void
int fromfuse; nohaste(int fromfuse)
{ {
if (pl_on(ISHASTE)) if (pl_on(ISHASTE))
msg("You feel yourself slowing down."); msg("You feel yourself slowing down.");
@ -142,8 +142,8 @@ int fromfuse;
* stomach: * stomach:
* Digest the hero's food * Digest the hero's food
*/ */
stomach(fromfuse) void
int fromfuse; stomach(int fromfuse)
{ {
reg int oldfood, old_hunger; reg int oldfood, old_hunger;
@ -188,8 +188,8 @@ int fromfuse;
* noteth: * noteth:
* Hero is no longer etherereal * Hero is no longer etherereal
*/ */
noteth(fromfuse) void
int fromfuse; noteth(int fromfuse)
{ {
int ch; int ch;
@ -209,8 +209,8 @@ int fromfuse;
* sapem: * sapem:
* Sap the hero's life away * Sap the hero's life away
*/ */
sapem(fromfuse) void
int fromfuse; sapem(int fromfuse)
{ {
chg_abil(rnd(4) + 1, -1, TRUE); chg_abil(rnd(4) + 1, -1, TRUE);
fuse(sapem, TRUE, 150); fuse(sapem, TRUE, 150);
@ -221,8 +221,8 @@ int fromfuse;
* notslow: * notslow:
* Restore the hero's normal speed * Restore the hero's normal speed
*/ */
notslow(fromfuse) void
int fromfuse; notslow(int fromfuse)
{ {
if (pl_on(ISSLOW)) if (pl_on(ISSLOW))
msg("You no longer feel hindered."); msg("You no longer feel hindered.");
@ -233,8 +233,8 @@ int fromfuse;
* notregen: * notregen:
* Hero is no longer regenerative * Hero is no longer regenerative
*/ */
notregen(fromfuse) void
int fromfuse; notregen(int fromfuse)
{ {
if (pl_on(ISREGEN)) if (pl_on(ISREGEN))
msg("You no longer feel bolstered."); msg("You no longer feel bolstered.");
@ -245,8 +245,8 @@ int fromfuse;
* notinvinc: * notinvinc:
* Hero not invincible any more * Hero not invincible any more
*/ */
notinvinc(fromfuse) void
int fromfuse; notinvinc(int fromfuse)
{ {
if (pl_on(ISINVINC)) if (pl_on(ISINVINC))
msg("You no longer feel invincible."); msg("You no longer feel invincible.");

View file

@ -18,7 +18,8 @@
* displevl: * displevl:
* Display detailed level for wizard and scroll * Display detailed level for wizard and scroll
*/ */
displevl() void
displevl(void)
{ {
reg char ch, mch; reg char ch, mch;
reg int i,j; reg int i,j;
@ -73,7 +74,8 @@ displevl()
* dispmons: * dispmons:
* Show monsters for wizard and potion * Show monsters for wizard and potion
*/ */
dispmons() void
dispmons(void)
{ {
reg int ch, y, x; reg int ch, y, x;
reg struct thing *it; reg struct thing *it;
@ -95,8 +97,8 @@ dispmons()
* winat: * winat:
* Get whatever character is at a location on the screen * Get whatever character is at a location on the screen
*/ */
winat(y, x) char
int x, y; winat(int y, int x)
{ {
reg char ch; reg char ch;
@ -111,8 +113,8 @@ int x, y;
* cordok: * cordok:
* Returns TRUE if coordinate is on usable screen * Returns TRUE if coordinate is on usable screen
*/ */
cordok(y, x) bool
int y, x; cordok(int y, int x)
{ {
if (x < 0 || y < 0 || x >= COLS || y >= LINES - 1) if (x < 0 || y < 0 || x >= COLS || y >= LINES - 1)
return FALSE; return FALSE;
@ -123,8 +125,8 @@ int y, x;
* pl_on: * pl_on:
* Returns TRUE if the player's flag is set * Returns TRUE if the player's flag is set
*/ */
pl_on(what) bool
long what; pl_on(long what)
{ {
return (player.t_flags & what); return (player.t_flags & what);
} }
@ -134,8 +136,8 @@ long what;
* pl_off: * pl_off:
* Returns TRUE when player's flag is reset * Returns TRUE when player's flag is reset
*/ */
pl_off(what) bool
long what; pl_off(long what)
{ {
return (!(player.t_flags & what)); return (!(player.t_flags & what));
} }
@ -145,9 +147,8 @@ long what;
* o_on: * o_on:
* Returns TRUE in the objects flag is set * Returns TRUE in the objects flag is set
*/ */
o_on(what,bit) bool
struct object *what; o_on(struct object *what, long bit)
long bit;
{ {
reg int flag; reg int flag;
@ -162,9 +163,8 @@ long bit;
* o_off: * o_off:
* Returns TRUE is the objects flag is reset * Returns TRUE is the objects flag is reset
*/ */
o_off(what,bit) bool
struct object *what; o_off(struct object *what, long bit)
long bit;
{ {
reg int flag; reg int flag;
@ -179,9 +179,8 @@ long bit;
* setoflg: * setoflg:
* Set the specified flag for the object * Set the specified flag for the object
*/ */
setoflg(what,bit) void
struct object *what; setoflg(struct object *what, long bit)
long bit;
{ {
what->o_flags |= bit; what->o_flags |= bit;
} }
@ -191,9 +190,8 @@ long bit;
* resoflg: * resoflg:
* Reset the specified flag for the object * Reset the specified flag for the object
*/ */
resoflg(what,bit) void
struct object *what; resoflg(struct object *what, long bit)
long bit;
{ {
what->o_flags &= ~bit; what->o_flags &= ~bit;
} }

View file

@ -10,14 +10,19 @@
* See the file LICENSE.TXT for full copyright and licensing information. * See the file LICENSE.TXT for full copyright and licensing information.
*/ */
#include <string.h>
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
int packweight(void);
int pack_vol(void);
/* /*
* updpack: * updpack:
* Update his pack weight and adjust fooduse accordingly * Update his pack weight and adjust fooduse accordingly
*/ */
updpack() void
updpack(void)
{ {
reg int topcarry, curcarry; reg int topcarry, curcarry;
@ -44,7 +49,8 @@ updpack()
* packweight: * packweight:
* Get the total weight of the hero's pack * Get the total weight of the hero's pack
*/ */
packweight() int
packweight(void)
{ {
reg struct object *obj; reg struct object *obj;
reg struct linked_list *pc; reg struct linked_list *pc;
@ -72,8 +78,8 @@ packweight()
* itemweight: * itemweight:
* Get the weight of an object * Get the weight of an object
*/ */
itemweight(wh) int
struct object *wh; itemweight(struct object *wh)
{ {
reg int weight; reg int weight;
@ -97,7 +103,8 @@ struct object *wh;
* pack_vol: * pack_vol:
* Get the total volume of the hero's pack * Get the total volume of the hero's pack
*/ */
pack_vol() int
pack_vol(void)
{ {
reg struct object *obj; reg struct object *obj;
reg struct linked_list *pc; reg struct linked_list *pc;
@ -115,8 +122,8 @@ pack_vol()
* itemvol: * itemvol:
* Get the volume of an object * Get the volume of an object
*/ */
itemvol(wh) int
struct object *wh; itemvol(struct object *wh)
{ {
reg int volume, what, extra; reg int volume, what, extra;
@ -139,9 +146,10 @@ struct object *wh;
* playenc: * playenc:
* Get hero's carrying ability above norm * Get hero's carrying ability above norm
*/ */
playenc() int
playenc(void)
{ {
reg estr = him->s_ef.a_str; reg int estr = him->s_ef.a_str;
if (estr >= 24) if (estr >= 24)
return 3000; return 3000;
switch(him->s_ef.a_str) { switch(him->s_ef.a_str) {
@ -174,7 +182,8 @@ playenc()
* totalenc: * totalenc:
* Get total weight that the hero can carry * Get total weight that the hero can carry
*/ */
totalenc() int
totalenc(void)
{ {
reg int wtotal; reg int wtotal;
@ -192,8 +201,8 @@ totalenc()
* whgtchk: * whgtchk:
* See if the hero can carry his pack * See if the hero can carry his pack
*/ */
wghtchk(fromfuse) void
int fromfuse; wghtchk(int fromfuse)
{ {
reg int dropchk, err = TRUE; reg int dropchk, err = TRUE;
reg char ch; reg char ch;
@ -231,7 +240,8 @@ int fromfuse;
* 0 hit for medium pack weight * 0 hit for medium pack weight
* -1 hit for heavy pack weight * -1 hit for heavy pack weight
*/ */
hitweight() int
hitweight(void)
{ {
return(2 - foodlev); return(2 - foodlev);
} }

View file

@ -14,19 +14,26 @@
* 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 <ctype.h> #include <ctype.h>
#include <string.h>
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
bool roll_em(struct stats *att, struct stats *def, struct object *weap, bool hurl);
char *mindex(char *cp, char c);
char *prname(char *who, bool upper);
void hit(char *er);
void miss(char *er);
void thunk(struct object *weap, char *mname);
void bounce(struct object *weap, char *mname);
/* /*
* fight: * fight:
* The player attacks the monster. * The player attacks the monster.
*/ */
fight(mp, weap, thrown) bool
struct coord *mp; fight(struct coord *mp, struct object *weap, bool thrown)
struct object *weap;
bool thrown;
{ {
reg struct thing *tp; reg struct thing *tp;
@ -123,8 +130,8 @@ bool thrown;
* attack: * attack:
* The monster attacks the player * The monster attacks the player
*/ */
attack(mp) int
struct thing *mp; attack(struct thing *mp)
{ {
reg char *mname; reg char *mname;
@ -349,8 +356,8 @@ struct 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)
{ {
reg int res = rnd(20)+1; reg int res = rnd(20)+1;
reg int need = (21 - at_lvl) - op_arm; reg int need = (21 - at_lvl) - op_arm;
@ -363,7 +370,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)
{ {
reg int lev, add, dif; reg int lev, add, dif;
@ -387,15 +395,12 @@ check_level()
* roll_em: * roll_em:
* Roll several attacks * Roll several attacks
*/ */
roll_em(att, def, weap, hurl) bool
struct stats *att, *def; roll_em(struct stats *att, struct stats *def, struct object *weap, bool hurl)
struct object *weap;
bool hurl;
{ {
reg char *cp; reg char *cp;
reg int ndice, nsides, def_arm, prop_hplus, prop_dplus; reg int ndice, nsides, def_arm, prop_hplus, prop_dplus;
reg bool did_hit = FALSE; reg bool did_hit = FALSE;
char *mindex();
prop_hplus = prop_dplus = 0; prop_hplus = prop_dplus = 0;
if (weap == NULL) { if (weap == NULL) {
@ -479,8 +484,7 @@ bool hurl;
* Look for char 'c' in string pointed to by 'cp' * Look for char 'c' in string pointed to by 'cp'
*/ */
char * char *
mindex(cp, c) mindex(char *cp, char c)
char *cp, c;
{ {
reg int i; reg int i;
@ -498,9 +502,7 @@ char *cp, c;
* The print name of a combatant * The print name of a combatant
*/ */
char * char *
prname(who, upper) prname(char *who, bool upper)
char *who;
bool upper;
{ {
static char tbuf[LINLEN]; static char tbuf[LINLEN];
@ -522,8 +524,8 @@ static char tbuf[LINLEN];
* hit: * hit:
* Print a message to indicate a succesful hit * Print a message to indicate a succesful hit
*/ */
hit(er) void
char *er; hit(char *er)
{ {
msg("%s hit.",prname(er, TRUE)); msg("%s hit.",prname(er, TRUE));
} }
@ -533,8 +535,8 @@ char *er;
* miss: * miss:
* Print a message to indicate a poor swing * Print a message to indicate a poor swing
*/ */
miss(er) void
char *er; miss(char *er)
{ {
msg("%s miss%s.",prname(er, TRUE),(er == 0 ? "":"es")); msg("%s miss%s.",prname(er, TRUE),(er == 0 ? "":"es"));
} }
@ -544,9 +546,8 @@ char *er;
* save_throw: * save_throw:
* See if a creature saves against something * See if a creature saves against something
*/ */
save_throw(which, tp) bool
int which; save_throw(int which, struct thing *tp)
struct thing *tp;
{ {
reg int need; reg int need;
reg struct stats *st; reg struct stats *st;
@ -561,8 +562,8 @@ struct thing *tp;
* save: * save:
* See if he saves against various nasty things * See if he saves against various nasty things
*/ */
save(which) bool
int which; save(int which)
{ {
return save_throw(which, &player); return save_throw(which, &player);
} }
@ -571,7 +572,8 @@ int which;
* 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)
{ {
him->s_exp = e_levels[him->s_lvl-1] + 1L; him->s_exp = e_levels[him->s_lvl-1] + 1L;
check_level(); check_level();
@ -582,9 +584,8 @@ raise_level()
* thunk: * thunk:
* A missile hits a monster * A missile hits a monster
*/ */
thunk(weap, mname) void
struct object *weap; thunk(struct object *weap, char *mname)
char *mname;
{ {
if (weap->o_type == WEAPON) if (weap->o_type == WEAPON)
msg("The %s hits the %s.",w_magic[weap->o_which].mi_name,mname); msg("The %s hits the %s.",w_magic[weap->o_which].mi_name,mname);
@ -597,9 +598,8 @@ char *mname;
* bounce: * bounce:
* A missile misses a monster * A missile misses a monster
*/ */
bounce(weap, mname) void
struct object *weap; bounce(struct object *weap, char *mname)
char *mname;
{ {
if (weap->o_type == WEAPON) if (weap->o_type == WEAPON)
msg("The %s misses the %s.", w_magic[weap->o_which].mi_name,mname); msg("The %s misses the %s.", w_magic[weap->o_which].mi_name,mname);
@ -612,9 +612,8 @@ char *mname;
* remove: * remove:
* Remove a monster from the screen * Remove a monster from the screen
*/ */
remove_monster(mp, item) void
struct coord *mp; remove_monster(struct coord *mp, struct linked_list *item)
struct linked_list *item;
{ {
reg char what; reg char what;
@ -633,8 +632,8 @@ struct linked_list *item;
* is_magic: * is_magic:
* Returns true if an object radiates magic * Returns true if an object radiates magic
*/ */
is_magic(obj) bool
struct object *obj; is_magic(struct object *obj)
{ {
switch (obj->o_type) { switch (obj->o_type) {
case ARMOR: case ARMOR:
@ -656,9 +655,8 @@ struct object *obj;
* killed: * killed:
* Called to put a monster to death * Called to put a monster to death
*/ */
killed(item, pr) void
struct linked_list *item; killed(struct linked_list *item, bool pr)
bool pr;
{ {
reg struct thing *tp; reg struct thing *tp;
reg struct object *obj; reg struct object *obj;

View file

@ -19,6 +19,9 @@
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
int pinit(void);
void badcheck(char *name, struct magic_item *magic);
char *rainbow[NCOLORS] = { char *rainbow[NCOLORS] = {
"Red", "Blue", "Green", "Yellow", "Red", "Blue", "Green", "Yellow",
"Black", "Brown", "Orange", "Pink", "Black", "Brown", "Orange", "Pink",
@ -81,25 +84,12 @@ char *metal[NMETAL] = {
"Tin", "Titanium", "Zinc", "Tin", "Titanium", "Zinc",
}; };
/*
* init_everything:
* Set up all important stuff.
*/
init_everything()
{
init_player(); /* Roll up the rogue */
init_things(); /* Set up probabilities */
init_names(); /* Set up names of scrolls */
init_colors(); /* Set up colors of potions */
init_stones(); /* Set up stones in rings */
init_materials(); /* Set up materials of wands */
}
/* /*
* init_things: * init_things:
* Initialize the probabilities for types of things * Initialize the probabilities for types of things
*/ */
init_things() void
init_things(void)
{ {
struct magic_item *mi; struct magic_item *mi;
@ -128,7 +118,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)
{ {
reg int i, j; reg int i, j;
reg char *str; reg char *str;
@ -155,7 +146,8 @@ init_colors()
* init_names: * init_names:
* Generate the names of the various scrolls * Generate the names of the various scrolls
*/ */
init_names() void
init_names(void)
{ {
reg int nsyl; reg int nsyl;
reg char *cp, *sp; reg char *cp, *sp;
@ -189,7 +181,8 @@ init_names()
* Initialize the ring stone setting scheme for this time * Initialize the ring stone setting scheme for this time
*/ */
init_stones() void
init_stones(void)
{ {
reg int i, j; reg int i, j;
reg char *str; reg char *str;
@ -217,7 +210,8 @@ init_stones()
* Initialize the construction materials for wands and staffs * Initialize the construction materials for wands and staffs
*/ */
init_materials() void
init_materials(void)
{ {
int i, j; int i, j;
char *str; char *str;
@ -264,9 +258,8 @@ init_materials()
badcheck("sticks", ws_magic); badcheck("sticks", ws_magic);
} }
badcheck(name, magic) void
char *name; badcheck(char *name, struct magic_item *magic)
struct magic_item *magic;
{ {
struct magic_item *mg; struct magic_item *mg;
@ -289,7 +282,8 @@ struct magic_item *magic;
* roll up the rogue * roll up the rogue
*/ */
init_player() void
init_player(void)
{ {
player.t_nomove = 0; player.t_nomove = 0;
player.t_nocmd = 0; player.t_nocmd = 0;
@ -315,7 +309,8 @@ init_player()
* pinit: * pinit:
* Returns the best 3 of 4 on a 6-sided die * Returns the best 3 of 4 on a 6-sided die
*/ */
pinit() int
pinit(void)
{ {
int best[4]; int best[4];
reg int i, min, minind, dicetot; reg int i, min, minind, dicetot;
@ -337,3 +332,18 @@ pinit()
} }
return(dicetot); return(dicetot);
} }
/*
* init_everything:
* Set up all important stuff.
*/
void
init_everything(void)
{
init_player(); /* Roll up the rogue */
init_things(); /* Set up probabilities */
init_names(); /* Set up names of scrolls */
init_colors(); /* Set up colors of potions */
init_stones(); /* Set up stones in rings */
init_materials(); /* Set up materials of wands */
}

View file

@ -20,7 +20,7 @@
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
int md_readchar(WINDOW *win); void doadd(char *fmt, va_list ap);
/* /*
* msg: * msg:
@ -29,6 +29,7 @@ int md_readchar(WINDOW *win);
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;
@ -54,6 +55,7 @@ msg(char *fmt, ...)
* addmsg: * addmsg:
* 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;
@ -68,7 +70,8 @@ addmsg(char *fmt, ...)
* Display a new msg, giving him a chance to see the * Display a new msg, giving him a chance to see the
* previous one if it is up there with the --More-- * previous one if it is up there with the --More--
*/ */
endmsg() void
endmsg(void)
{ {
strcpy(huh, msgbuf); strcpy(huh, msgbuf);
if (mpos > 0) { if (mpos > 0) {
@ -88,6 +91,7 @@ endmsg()
* doadd: * doadd:
* Perform a printf into a buffer * Perform a printf into a buffer
*/ */
void
doadd(char *fmt, va_list ap) doadd(char *fmt, va_list ap)
{ {
vsprintf(&msgbuf[newpos], fmt, ap); vsprintf(&msgbuf[newpos], fmt, ap);
@ -98,8 +102,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
unsigned char ch; step_ok(unsigned char ch)
{ {
if (dead_end(ch)) if (dead_end(ch))
return FALSE; return FALSE;
@ -113,8 +117,8 @@ unsigned char ch;
* dead_end: * dead_end:
* Returns TRUE if you cant walk through that character * Returns TRUE if you cant walk through that character
*/ */
dead_end(ch) bool
char ch; dead_end(char ch)
{ {
if (ch == '-' || ch == '|' || ch == ' ' || ch == SECRETDOOR) if (ch == '-' || ch == '|' || ch == ' ' || ch == SECRETDOOR)
return TRUE; return TRUE;
@ -129,7 +133,8 @@ char ch;
* getchar. * getchar.
*/ */
readchar() int
readchar(void)
{ {
char c; char c;
@ -148,8 +153,8 @@ char *hungstr[] = {
* 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(fromfuse) void
int fromfuse; status(int fromfuse)
{ {
reg int totwght, carwght; reg int totwght, carwght;
reg struct real *stef, *stre, *stmx; reg struct real *stef, *stre, *stmx;
@ -220,7 +225,8 @@ int fromfuse;
* dispmax: * dispmax:
* Display the hero's maximum status * Display the hero's maximum status
*/ */
dispmax() void
dispmax(void)
{ {
reg struct real *hmax; reg struct real *hmax;
@ -233,8 +239,8 @@ dispmax()
* illeg_ch: * illeg_ch:
* Returns TRUE if a char shouldn't show on the screen * Returns TRUE if a char shouldn't show on the screen
*/ */
illeg_ch(ch) bool
unsigned char ch; illeg_ch(unsigned char ch)
{ {
if (ch < 32 || ch > 127) if (ch < 32 || ch > 127)
return TRUE; return TRUE;
@ -247,9 +253,8 @@ unsigned char ch;
* wait_for: * wait_for:
* Sit around until the guy types the right key * Sit around until the guy types the right key
*/ */
wait_for(win,ch) void
WINDOW *win; wait_for(WINDOW *win, char ch)
char ch;
{ {
register char c; register char c;
@ -293,9 +298,8 @@ gettime()
* dbotline: * dbotline:
* Displays message on bottom line and waits for a space to return * Displays message on bottom line and waits for a space to return
*/ */
dbotline(scr,message) void
WINDOW *scr; dbotline(WINDOW *scr, char *message)
char *message;
{ {
mvwaddstr(scr,LINES-1,0,message); mvwaddstr(scr,LINES-1,0,message);
draw(scr); draw(scr);
@ -307,8 +311,8 @@ char *message;
* restscr: * restscr:
* Restores the screen to the terminal * Restores the screen to the terminal
*/ */
restscr(scr) void
WINDOW *scr; restscr(WINDOW *scr)
{ {
clearok(scr,TRUE); clearok(scr,TRUE);
touchwin(scr); touchwin(scr);
@ -318,8 +322,8 @@ WINDOW *scr;
* npch: * npch:
* Get the next char in line for inventories * Get the next char in line for inventories
*/ */
npch(ch) char
char ch; npch(char ch)
{ {
reg char nch; reg char nch;
if (ch >= 'z') if (ch >= 'z')

View file

@ -23,8 +23,8 @@
* 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
struct linked_list **list, *item; _detach(struct linked_list **list, struct linked_list *item)
{ {
if (*list == item) if (*list == item)
*list = next(item); *list = next(item);
@ -39,8 +39,8 @@ struct linked_list **list, *item;
/* /*
* _attach: add an item to the head of a list * _attach: add an item to the head of a list
*/ */
_attach(list, item) void
struct linked_list **list, *item; _attach(struct linked_list **list, struct linked_list *item)
{ {
if (*list != NULL) { if (*list != NULL) {
item->l_next = *list; item->l_next = *list;
@ -57,8 +57,8 @@ struct linked_list **list, *item;
/* /*
* _free_list: Throw the whole blamed thing away * _free_list: Throw the whole blamed thing away
*/ */
_free_list(ptr) void
struct linked_list **ptr; _free_list(struct linked_list **ptr)
{ {
register struct linked_list *item; register struct linked_list *item;
@ -72,8 +72,8 @@ struct linked_list **ptr;
/* /*
* discard: free up an item * discard: free up an item
*/ */
discard(item) void
struct linked_list *item; discard(struct linked_list *item)
{ {
total -= 2; total -= 2;
FREE(item->l_data); FREE(item->l_data);
@ -84,8 +84,7 @@ struct linked_list *item;
* new_item: get a new item with a specified size * new_item: get a new item with a specified size
*/ */
struct linked_list * struct linked_list *
new_item(size) new_item(int size)
int size;
{ {
register struct linked_list *item; register struct linked_list *item;
@ -96,8 +95,7 @@ int size;
} }
char * char *
new(size) new(int size)
int size;
{ {
register char *space = ALLOC(size); register char *space = ALLOC(size);

View file

@ -34,14 +34,14 @@
#include "rogue.ext" #include "rogue.ext"
char *roguehome(void);
void open_records(void); void open_records(void);
extern int scorefd; extern int scorefd;
extern FILE *logfile; extern FILE *logfile;
main(argc, argv, envp) int
char **argv; main(int argc, char *argv[], char *envp[])
char **envp;
{ {
register char *env; register char *env;
register struct linked_list *item; register struct linked_list *item;
@ -50,7 +50,6 @@ char **envp;
char *getpass(), *xcrypt(), *strrchr(); char *getpass(), *xcrypt(), *strrchr();
int lowtime; int lowtime;
time_t now; time_t now;
char *roguehome();
char *homedir = roguehome(); char *homedir = roguehome();
#ifdef __DJGPP__ #ifdef __DJGPP__
@ -322,8 +321,8 @@ endit(int a)
* Exit the program, printing a message. * Exit the program, printing a message.
*/ */
fatal(s) void
char *s; fatal(char *s)
{ {
clear(); clear();
refresh(); refresh();
@ -340,8 +339,7 @@ char *s;
*/ */
void void
byebye(how) byebye(int how)
int how;
{ {
if (!isendwin()) if (!isendwin())
endwin(); endwin();
@ -354,8 +352,8 @@ int how;
* rnd: * rnd:
* Pick a very random number. * Pick a very random number.
*/ */
rnd(range) int
int range; rnd(int range)
{ {
reg int wh; reg int wh;
@ -372,8 +370,8 @@ int range;
* roll: * roll:
* roll a number of dice * roll a number of dice
*/ */
roll(number, sides) int
int number, sides; roll(int number, int sides)
{ {
reg int dtotal = 0; reg int dtotal = 0;
@ -386,7 +384,8 @@ int number, sides;
/* /*
** setup: Setup signal catching functions ** setup: Setup signal catching functions
*/ */
setup() void
setup(void)
{ {
md_onsignal_autosave(); md_onsignal_autosave();
@ -400,7 +399,8 @@ setup()
** refreshing things and looking at the proper times. ** refreshing things and looking at the proper times.
*/ */
playit() void
playit(void)
{ {
reg char *opts; reg char *opts;
@ -421,7 +421,8 @@ playit()
/* /*
** author: See if a user is an author of the program ** author: See if a user is an author of the program
*/ */
author() bool
author(void)
{ {
switch (playuid) { switch (playuid) {
case 100: case 100:
@ -444,7 +445,7 @@ directory_exists(char *dirname)
} }
char * char *
roguehome() roguehome(void)
{ {
static char path[LINLEN+16]; static char path[LINLEN+16];
char *end,*home; char *end,*home;

View file

@ -22,7 +22,8 @@
* waste_time: * waste_time:
* Do nothing but let other things happen * Do nothing but let other things happen
*/ */
waste_time() void
waste_time(void)
{ {
if (inwhgt) /* if from wghtchk, then done */ if (inwhgt) /* if from wghtchk, then done */
return; return;
@ -35,8 +36,8 @@ waste_time()
* getindex: * getindex:
* Convert a type into an index for the things structures * Convert a type into an index for the things structures
*/ */
getindex(what) int
char what; getindex(char what)
{ {
int index = -1; int index = -1;
@ -58,8 +59,7 @@ char what;
* print the name of a trap * print the name of a trap
*/ */
char * char *
tr_name(ch) tr_name(char ch)
char ch;
{ {
reg char *s; reg char *s;
@ -92,8 +92,8 @@ char ch;
* Look: * Look:
* A quick glance all around the player * A quick glance all around the player
*/ */
look(wakeup) void
bool wakeup; look(bool wakeup)
{ {
reg char ch; reg char ch;
reg int oldx, oldy, y, x; reg int oldx, oldy, y, x;
@ -230,8 +230,7 @@ bool wakeup;
* find the unclaimed object at y, x * find the unclaimed object at y, x
*/ */
struct linked_list * struct linked_list *
find_obj(y, x) find_obj(int y, int x)
int y, x;
{ {
reg struct linked_list *obj; reg struct linked_list *obj;
reg struct object *op; reg struct object *op;
@ -248,7 +247,8 @@ int y, x;
* eat: * eat:
* Let the hero eat some food. * Let the hero eat some food.
*/ */
eat() void
eat(void)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -297,7 +297,8 @@ eat()
* aggravate: * aggravate:
* aggravate all the monsters on this level * aggravate all the monsters on this level
*/ */
aggravate() void
aggravate(void)
{ {
reg struct linked_list *mi; reg struct linked_list *mi;
@ -310,8 +311,7 @@ aggravate()
* If string starts with a vowel, return "n" for an "an" * If string starts with a vowel, return "n" for an "an"
*/ */
char * char *
vowelstr(str) vowelstr(char *str)
char *str;
{ {
switch (tolower(*str)) { switch (tolower(*str)) {
case 'a': case 'a':
@ -329,8 +329,8 @@ 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
struct object *obj; is_current(struct object *obj)
{ {
if (obj == NULL) if (obj == NULL)
return FALSE; return FALSE;
@ -346,7 +346,8 @@ struct object *obj;
* get_dir: * get_dir:
* Set up the direction coordinates * Set up the direction coordinates
*/ */
get_dir() bool
get_dir(void)
{ {
reg char *prompt; reg char *prompt;
reg bool gotit; reg bool gotit;
@ -384,8 +385,8 @@ get_dir()
* initfood: * initfood:
* Set up stuff for a food-type object * Set up stuff for a food-type object
*/ */
initfood(what) void
struct object *what; initfood(struct object *what)
{ {
what->o_type = FOOD; what->o_type = FOOD;
what->o_group = NORMFOOD; what->o_group = NORMFOOD;

View file

@ -14,6 +14,7 @@
* See the file LICENSE.TXT for full copyright and licensing information. * See the file LICENSE.TXT for full copyright and licensing information.
*/ */
#include <string.h>
#include "rogue.h" #include "rogue.h"
#include <ctype.h> #include <ctype.h>
#include "rogue.ext" #include "rogue.ext"
@ -23,10 +24,10 @@
* 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.
*/ */
rnd_mon(wander,baddie) char
bool wander; rnd_mon(bool wander, bool baddie)
bool baddie; /* TRUE when from a polymorph stick */
{ {
/* baddie; TRUE when from a polymorph stick */
reg int i, ok, cnt; reg int i, ok, cnt;
cnt = 0; cnt = 0;
@ -60,7 +61,8 @@ bool baddie; /* TRUE when from a polymorph stick */
* lev_mon: * lev_mon:
* This gets all monsters possible on this level * This gets all monsters possible on this level
*/ */
lev_mon() void
lev_mon(void)
{ {
reg int i; reg int i;
reg struct monster *mm; reg struct monster *mm;
@ -83,10 +85,7 @@ lev_mon()
* Pick a new monster and add it to the list * Pick a new monster and add it to the list
*/ */
struct linked_list * struct linked_list *
new_monster(type, cp, treas) new_monster(char type, struct coord *cp, bool treas)
struct coord *cp;
bool treas;
char type;
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct thing *tp; reg struct thing *tp;
@ -191,7 +190,8 @@ char type;
* wanderer: * wanderer:
* A wandering monster has awakened and is headed for the player * A wandering monster has awakened and is headed for the player
*/ */
wanderer() void
wanderer(void)
{ {
reg int ch = '-'; reg int ch = '-';
reg struct room *rp, *hr = player.t_room; reg struct room *rp, *hr = player.t_room;
@ -217,8 +217,7 @@ wanderer()
* What to do when the hero steps next to a monster * What to do when the hero steps next to a monster
*/ */
struct linked_list * struct linked_list *
wake_monster(y, x) wake_monster(int y, int x)
int y, x;
{ {
reg struct thing *tp; reg struct thing *tp;
reg struct linked_list *it; reg struct linked_list *it;
@ -279,7 +278,8 @@ int y, x;
* genocide: * genocide:
* Eradicate a monster forevermore * Eradicate a monster forevermore
*/ */
genocide() void
genocide(void)
{ {
reg struct linked_list *ip, *nip; reg struct linked_list *ip, *nip;
reg struct thing *mp; reg struct thing *mp;
@ -331,8 +331,8 @@ tryagain:
* unhold: * unhold:
* Release the player from being held * Release the player from being held
*/ */
unhold(whichmon) void
char whichmon; unhold(char whichmon)
{ {
switch (whichmon) { switch (whichmon) {
case 'F': case 'F':
@ -347,8 +347,8 @@ char whichmon;
* midx: * midx:
* This returns an index to 'whichmon' * This returns an index to 'whichmon'
*/ */
midx(whichmon) int
char whichmon; midx(char whichmon)
{ {
if (isupper(whichmon)) if (isupper(whichmon))
return(whichmon - 'A'); /* 0 to 25 for uppercase */ return(whichmon - 'A'); /* 0 to 25 for uppercase */
@ -363,8 +363,8 @@ char whichmon;
* See when monster should run or fight. Return * See when monster should run or fight. Return
* TRUE if hit points less than acceptable. * TRUE if hit points less than acceptable.
*/ */
monhurt(th) bool
struct thing *th; monhurt(struct thing *th)
{ {
reg int ewis, crithp, f1, f2; reg int ewis, crithp, f1, f2;
reg struct stats *st; reg struct stats *st;

View file

@ -14,6 +14,7 @@
* See the file LICENSE.TXT for full copyright and licensing information. * See the file LICENSE.TXT for full copyright and licensing information.
*/ */
#include <string.h>
#include <ctype.h> #include <ctype.h>
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
@ -29,8 +30,8 @@ struct coord nh;
* 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;
@ -43,8 +44,8 @@ char ch;
* consequences (fighting, picking up, etc.) * consequences (fighting, picking up, etc.)
*/ */
do_move(dy, dx) void
int dy, dx; do_move(int dy, int dx)
{ {
reg int ch; reg int ch;
reg struct room *rp; reg struct room *rp;
@ -209,8 +210,8 @@ int dy, dx;
* Called to illuminate a room. * Called to illuminate a room.
* If it is dark, remove anything that might move. * If it is dark, remove anything that might move.
*/ */
light(cp) void
struct coord *cp; light(struct coord *cp)
{ {
reg struct room *rp; reg struct room *rp;
reg int j, k, x, y; reg int j, k, x, y;
@ -291,8 +292,8 @@ struct coord *cp;
* show: * show:
* returns what a certain thing will display as to the un-initiated * returns what a certain thing will display as to the un-initiated
*/ */
show(y, x) char
int y, x; show(int y, int x)
{ {
reg char ch = winat(y, x); reg char ch = winat(y, x);
reg struct linked_list *it; reg struct linked_list *it;
@ -330,9 +331,8 @@ int y, x;
* be_trapped: * be_trapped:
* Hero or monster stepped on a trap. * Hero or monster stepped on a trap.
*/ */
be_trapped(tc, th) int
struct thing *th; be_trapped(struct coord *tc, struct thing *th)
struct coord *tc;
{ {
reg struct trap *trp; reg struct trap *trp;
reg int ch, ishero; reg int ch, ishero;
@ -340,7 +340,7 @@ struct coord *tc;
char stuckee[35], seeit, sayso; char stuckee[35], seeit, sayso;
if ((trp = trap_at(tc->y, tc->x)) == NULL) if ((trp = trap_at(tc->y, tc->x)) == NULL)
return; return 0;
ishero = (th == &player); ishero = (th == &player);
if (ishero) { if (ishero) {
strcpy(stuckee, "You"); strcpy(stuckee, "You");
@ -491,7 +491,7 @@ goner:
if ((trp->tr_flags & ISGONE) && rnd(100) < 10) { if ((trp->tr_flags & ISGONE) && rnd(100) < 10) {
nlmove = TRUE; nlmove = TRUE;
if (rnd(100) < 15) if (rnd(100) < 15)
teleport(rndspot); /* teleport away */ teleport(rndspot, th); /* teleport away */
else if(rnd(100) < 15 && level > 2) { else if(rnd(100) < 15 && level > 2) {
level -= rnd(2) + 1; level -= rnd(2) + 1;
new_level(NORMLEV); new_level(NORMLEV);
@ -519,7 +519,8 @@ goner:
* dip_it: * dip_it:
* Dip an object into a magic pool * Dip an object into a magic pool
*/ */
dip_it() void
dip_it(void)
{ {
reg struct linked_list *what; reg struct linked_list *what;
reg struct object *ob; reg struct object *ob;
@ -654,8 +655,7 @@ dip_it()
* Find the trap at (y,x) on screen. * Find the trap at (y,x) on screen.
*/ */
struct trap * struct trap *
trap_at(y, x) trap_at(int y, int x)
int y, x;
{ {
reg struct trap *tp, *ep; reg struct trap *tp, *ep;
@ -673,8 +673,7 @@ int y, x;
* move in a random direction if the monster/person is confused * move in a random direction if the monster/person is confused
*/ */
struct coord * struct coord *
rndmove(who) rndmove(struct thing *who)
struct thing *who;
{ {
reg int x, y, ex, ey, ch; reg int x, y, ex, ey, ch;
int nopen = 0; int nopen = 0;
@ -720,8 +719,8 @@ struct thing *who;
* isatrap: * isatrap:
* Returns TRUE if this character is some kind of trap * Returns TRUE if this character is some kind of trap
*/ */
isatrap(ch) bool
char ch; isatrap(char ch)
{ {
switch(ch) { switch(ch) {
case POST: case POST:

View file

@ -17,14 +17,16 @@
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
void put_things(void);
/* /*
* new_level: * new_level:
* Dig and draw a new level * Dig and draw a new level
*/ */
new_level(ltype) void
int ltype; new_level(int ltype)
{ {
register i; register int i;
register char ch; register char ch;
struct coord traploc; struct coord traploc;
struct room *rp; struct room *rp;
@ -145,9 +147,10 @@ again:
* 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 rm; register int rm;
if (levtype != NORMLEV) if (levtype != NORMLEV)
rm = 0; rm = 0;
@ -166,9 +169,10 @@ rnd_room()
* put potions and scrolls on this level * put potions and scrolls on this level
*/ */
put_things() void
put_things(void)
{ {
register i, cnt, rm; register int i, cnt, rm;
struct linked_list *item; struct linked_list *item;
struct object *cur; struct object *cur;
struct coord tp; struct coord tp;

View file

@ -30,7 +30,7 @@ struct optstruct {
typedef struct optstruct OPTION; typedef struct optstruct OPTION;
int put_str(), get_str(); int allowchange(OPTION *opt);
OPTION optlist[] = { OPTION optlist[] = {
{ "name", "Name: ", whoami }, { "name", "Name: ", whoami },
@ -46,7 +46,8 @@ OPTION safeoptlist[] = {
/* /*
* print and then set options from the terminal * print and then set options from the terminal
*/ */
option() void
option(void)
{ {
reg OPTION *op; reg OPTION *op;
reg int wh; reg int wh;
@ -106,9 +107,8 @@ option()
* Set a string option * Set a string option
*/ */
#define CTRLB 2 #define CTRLB 2
get_str(opt, awin) int
char *opt; get_str(char *opt, WINDOW *awin)
WINDOW *awin;
{ {
reg char *sp; reg char *sp;
reg int c, oy, ox; reg int c, oy, ox;
@ -119,7 +119,7 @@ WINDOW *awin;
/* /*
* loop reading in the string, and put it in a temporary buffer * loop reading in the string, and put it in a temporary buffer
*/ */
for (sp = buf; (c=readchar(awin)) != '\n' && c != '\r' && c != ESCAPE; for (sp = buf; (c=readchar()) != '\n' && c != '\r' && c != ESCAPE;
wclrtoeol(awin), draw(awin)) { wclrtoeol(awin), draw(awin)) {
if (sp - buf >= 50) { if (sp - buf >= 50) {
*sp = '\0'; /* line was too long */ *sp = '\0'; /* line was too long */
@ -186,8 +186,8 @@ WINDOW *awin;
* or the end of the entire option string. * or the end of the entire option string.
*/ */
parse_opts(str) void
char *str; parse_opts(char *str)
{ {
reg char *sp; reg char *sp;
reg OPTION *op; reg OPTION *op;
@ -231,9 +231,8 @@ char *str;
/* /*
* copy string using unctrl for things * copy string using unctrl for things
*/ */
strucpy(s1, s2, len) void
char *s1, *s2; strucpy(char *s1, char *s2, int len)
int len;
{ {
reg char *sp; reg char *sp;

View file

@ -24,9 +24,8 @@
* is non-null use it as the linked_list pointer instead of * is non-null use it as the linked_list pointer instead of
* getting it off the ground. * getting it off the ground.
*/ */
add_pack(item, silent) bool
struct linked_list *item; add_pack(struct linked_list *item, bool silent)
bool silent;
{ {
reg struct linked_list *ip, *lp; reg struct linked_list *ip, *lp;
reg struct object *obj, *op = NULL; reg struct object *obj, *op = NULL;
@ -191,9 +190,8 @@ picked_up:
* inventory: * inventory:
* Show what items are in a specific list * Show what items are in a specific list
*/ */
inventory(list, type) bool
struct linked_list *list; inventory(struct linked_list *list, int type)
int type;
{ {
reg struct linked_list *pc; reg struct linked_list *pc;
reg struct object *obj; reg struct object *obj;
@ -229,8 +227,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)
{ {
nochange = FALSE; nochange = FALSE;
switch(ch) { switch(ch) {
@ -254,7 +252,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)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg char ch, mch; reg char ch, mch;
@ -288,9 +287,7 @@ picky_inven()
* pick something out of a pack for a purpose * pick something out of a pack for a purpose
*/ */
struct linked_list * struct linked_list *
get_item(purpose, type) get_item(char *purpose, int type)
char *purpose;
int type;
{ {
reg struct linked_list *obj, *pit, *savepit = NULL; reg struct linked_list *obj, *pit, *savepit = NULL;
struct object *pob; struct object *pob;
@ -408,8 +405,7 @@ int type;
* Get the character of a particular item in the pack * Get the character of a particular item in the pack
*/ */
char char
pack_char(obj) pack_char(struct object *obj)
struct object *obj;
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg char c; reg char c;
@ -427,7 +423,8 @@ struct object *obj;
* idenpack: * idenpack:
* Identify all the items in the pack * Identify all the items in the pack
*/ */
idenpack() void
idenpack(void)
{ {
reg struct linked_list *pc; reg struct linked_list *pc;
@ -440,8 +437,8 @@ idenpack()
* del_pack: * del_pack:
* Take something out of the hero's pack * Take something out of the hero's pack
*/ */
del_pack(what) void
struct linked_list *what; del_pack(struct linked_list *what)
{ {
reg struct object *op; reg struct object *op;
@ -461,8 +458,8 @@ struct linked_list *what;
* cur_null: * cur_null:
* This updates cur_weapon etc for dropping things * This updates cur_weapon etc for dropping things
*/ */
cur_null(op) void
struct object *op; cur_null(struct object *op)
{ {
if (op == cur_weapon) if (op == cur_weapon)
cur_weapon = NULL; cur_weapon = NULL;

View file

@ -14,15 +14,20 @@
* 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 "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
void conn(int r1, int r2);
void door(struct room *rm, struct coord *cp);
/* /*
* do_passages: * do_passages:
* Draw all the passages on a level. * Draw all the passages on a level.
*/ */
do_passages() void
do_passages(void)
{ {
reg struct rdes *r1, *r2 = NULL; reg struct rdes *r1, *r2 = NULL;
reg int i, j; reg int i, j;
@ -123,8 +128,8 @@ do_passages()
* Cconnect two rooms. * Cconnect two rooms.
*/ */
conn(r1, r2) void
int r1, r2; conn(int r1, int r2)
{ {
reg struct room *rpf, *rpt = NULL; reg struct room *rpf, *rpt = NULL;
reg char rmt, direc; reg char rmt, direc;
@ -255,9 +260,8 @@ int r1, r2;
* also enters the door in the exits array of the room. * also enters the door in the exits array of the room.
*/ */
door(rm, cp) void
struct room *rm; door(struct room *rm, struct coord *cp)
struct coord *cp;
{ {
cmov(*cp); cmov(*cp);
addch(rnd(10) < level - 1 && rnd(100) < 20 ? SECRETDOOR : DOOR); addch(rnd(10) < level - 1 && rnd(100) < 20 ? SECRETDOOR : DOOR);
@ -269,7 +273,8 @@ struct 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)
{ {
reg int y, x, ch; reg int y, x, ch;

View file

@ -23,7 +23,8 @@
* quaff: * quaff:
* Let the hero drink a potion * Let the hero drink a potion
*/ */
quaff() void
quaff(void)
{ {
reg struct object *obj; reg struct object *obj;
reg struct linked_list *item, *titem; reg struct linked_list *item, *titem;
@ -189,7 +190,7 @@ quaff()
p_know[P_XHEAL] = TRUE; p_know[P_XHEAL] = TRUE;
if (!iswearing(R_SLOW)) if (!iswearing(R_SLOW))
notslow(FALSE); notslow(FALSE);
unconfuse(); unconfuse(FALSE);
extinguish(unconfuse); extinguish(unconfuse);
sight(FALSE); sight(FALSE);
} }

View file

@ -13,15 +13,15 @@
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
void updabil(int what, int amt, struct real *pst, int how);
int hungdam(void);
/* /*
* chg_hpt: * chg_hpt:
* Changes players hit points * Changes players hit points
*/ */
chg_hpt(howmany, alsomax, what) void
int howmany; chg_hpt(int howmany, bool alsomax, char what)
bool alsomax;
char what;
{ {
nochange = FALSE; nochange = FALSE;
if(alsomax) if(alsomax)
@ -38,8 +38,8 @@ char what;
* rchg_str: * rchg_str:
* Update the players real strength * Update the players real strength
*/ */
rchg_str(amt) void
int amt; rchg_str(int amt)
{ {
chg_abil(STR,amt,TRUE); chg_abil(STR,amt,TRUE);
} }
@ -48,8 +48,8 @@ int amt;
* chg_abil: * chg_abil:
* Used to modify the hero's abilities * Used to modify the hero's abilities
*/ */
chg_abil(what,amt,how) void
int amt, what, how; chg_abil(int what, int amt, int how)
{ {
if (amt == 0) if (amt == 0)
return; return;
@ -66,9 +66,8 @@ int amt, what, how;
* updabil: * updabil:
* Do the actual abilities updating * Do the actual abilities updating
*/ */
updabil(what, amt, pst, how) void
struct real *pst; updabil(int what, int amt, struct real *pst, int how)
int what, amt, how;
{ {
register int *wh, *mx, *mr; register int *wh, *mx, *mr;
struct real *mst, *msr; struct real *mst, *msr;
@ -138,8 +137,8 @@ int what, amt, how;
* add_haste: * add_haste:
* add a haste to the player * add a haste to the player
*/ */
add_haste(potion) void
bool potion; add_haste(bool potion)
{ {
if (pl_on(ISHASTE)) { if (pl_on(ISHASTE)) {
msg("You faint from exhaustion."); msg("You faint from exhaustion.");
@ -160,9 +159,8 @@ bool potion;
* getpdex: * getpdex:
* Gets players added dexterity for fighting * Gets players added dexterity for fighting
*/ */
getpdex(who, heave) int
struct stats *who; getpdex(struct stats *who, bool heave)
bool heave;
{ {
reg int edex; reg int edex;
@ -217,8 +215,8 @@ bool heave;
* getpwis: * getpwis:
* Get a players wisdom for fighting * Get a players wisdom for fighting
*/ */
getpwis(who) int
struct stats *who; getpwis(struct stats *who)
{ {
reg int ewis; reg int ewis;
@ -249,8 +247,8 @@ struct stats *who;
* getpcon: * getpcon:
* Get added hit points from players constitution * Get added hit points from players constitution
*/ */
getpcon(who) int
struct stats *who; getpcon(struct stats *who)
{ {
reg int econ; reg int econ;
@ -282,8 +280,8 @@ struct stats *who;
* 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(who) int
struct stats *who; str_plus(struct stats *who)
{ {
reg int hitplus, str; reg int hitplus, str;
@ -315,8 +313,8 @@ struct stats *who;
* add_dam: * add_dam:
* Compute additional damage done depending on strength * Compute additional damage done depending on strength
*/ */
add_dam(who) int
struct stats *who; add_dam(struct stats *who)
{ {
reg int exdam, str; reg int exdam, str;
@ -350,7 +348,8 @@ struct stats *who;
* hungdam: * hungdam:
* Calculate damage depending on players hungry state * Calculate damage depending on players hungry state
*/ */
hungdam() int
hungdam(void)
{ {
switch (hungry_state) { switch (hungry_state) {
case F_OKAY: case F_OKAY:
@ -364,9 +363,8 @@ hungdam()
* heal_self: * heal_self:
* Heal the hero. * Heal the hero.
*/ */
heal_self(factor, updmaxhp) void
int factor; heal_self(int factor, bool updmaxhp)
bool updmaxhp;
{ {
him->s_hpt += roll(him->s_lvl + getpcon(him), factor); him->s_hpt += roll(him->s_lvl + getpcon(him), factor);
if (updmaxhp) if (updmaxhp)

View file

@ -19,11 +19,15 @@
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
int gethand(bool isrmv);
int ring_eat(void);
/* /*
* ring_on: * ring_on:
* Put on a ring * Put on a ring
*/ */
ring_on() void
ring_on(void)
{ {
reg struct object *obj; reg struct object *obj;
reg struct linked_list *item; reg struct linked_list *item;
@ -144,7 +148,8 @@ ring_on()
* ring_off: * ring_off:
* Take off some ring * Take off some ring
*/ */
ring_off() void
ring_off(void)
{ {
reg int ring; reg int ring;
reg struct object *obj; reg struct object *obj;
@ -178,8 +183,8 @@ ring_off()
* toss_ring: * toss_ring:
* Remove a ring and stop its effects * Remove a ring and stop its effects
*/ */
toss_ring(what) void
struct object *what; toss_ring(struct object *what)
{ {
bool okring; bool okring;
@ -228,8 +233,8 @@ struct object *what;
* gethand: * gethand:
* Get a hand to wear a ring * Get a hand to wear a ring
*/ */
gethand(isrmv) int
bool isrmv; gethand(bool isrmv)
{ {
reg int c; reg int c;
char *ptr; char *ptr;
@ -280,7 +285,8 @@ bool isrmv;
* ring_eat: * ring_eat:
* How much food do the hero's rings use up? * How much food do the hero's rings use up?
*/ */
ring_eat() int
ring_eat(void)
{ {
reg struct object *lb; reg struct object *lb;
reg int hand, i, howmuch; reg int hand, i, howmuch;
@ -335,8 +341,7 @@ ring_eat()
* Print ring bonuses * Print ring bonuses
*/ */
char * char *
ring_num(what) ring_num(struct object *what)
struct object *what;
{ {
static char number[5]; static char number[5];
@ -355,8 +360,8 @@ struct object *what;
* magring: * magring:
* Returns TRUE if a ring has a number, i.e. +2 * Returns TRUE if a ring has a number, i.e. +2
*/ */
magring(what) bool
struct object *what; magring(struct object *what)
{ {
switch(what->o_which) { switch(what->o_which) {
case R_SPEED: case R_SPEED:
@ -379,7 +384,8 @@ struct object *what;
* ringabil: * ringabil:
* Compute effective abilities due to rings * Compute effective abilities due to rings
*/ */
ringabil() void
ringabil(void)
{ {
reg struct object *rptr; reg struct object *rptr;
reg int i; reg int i;
@ -406,10 +412,10 @@ ringabil()
* init_ring: * init_ring:
* Initialize a ring * Initialize a ring
*/ */
init_ring(what,fromwiz) void
struct object *what; init_ring(struct object *what, bool fromwiz)
bool fromwiz; /* TRUE when from wizards */
{ {
/* fromwiz: TRUE when from wizards */
reg int much; reg int much;
switch (what->o_which) { switch (what->o_which) {
@ -459,8 +465,8 @@ bool fromwiz; /* TRUE when from wizards */
* ringex: * ringex:
* Get extra gains from rings * Get extra gains from rings
*/ */
ringex(rtype) int
int rtype; ringex(int rtype)
{ {
reg int howmuch = 0; reg int howmuch = 0;
@ -475,8 +481,8 @@ int rtype;
* iswearing: * iswearing:
* Returns TRUE when the hero is wearing a certain type of ring * Returns TRUE when the hero is wearing a certain type of ring
*/ */
iswearing(ring) bool
int ring; iswearing(int ring)
{ {
return (isring(LEFT,ring) || isring(RIGHT,ring)); return (isring(LEFT,ring) || isring(RIGHT,ring));
} }
@ -485,8 +491,8 @@ int ring;
* isring: * isring:
* Returns TRUE if a ring is on a hand * Returns TRUE if a ring is on a hand
*/ */
isring(hand,ring) bool
int hand, ring; isring(int hand, int ring)
{ {
if (cur_ring[hand] != NULL && cur_ring[hand]->o_which == ring) if (cur_ring[hand] != NULL && cur_ring[hand]->o_which == ring)
return TRUE; return TRUE;

View file

@ -50,8 +50,8 @@ static char *rip[] = {
extern int scorefd; extern int scorefd;
extern FILE *logfile; extern FILE *logfile;
char *killname(); char *killname(unsigned char monst);
void writelog(int amount, int aflag, char monst); void showpack(bool winner, char *howso);
/* /*
* death: * death:
@ -59,8 +59,8 @@ void writelog(int amount, int aflag, char monst);
*/ */
#include <time.h> #include <time.h>
death(monst) void
char monst; death(char monst)
{ {
reg char dp, *killer; reg char dp, *killer;
struct tm *lt; struct tm *lt;
@ -119,9 +119,8 @@ int oldpurse;
* score: * score:
* Figure score and post it. * Figure score and post it.
*/ */
score(amount, aflag, monst) void
char monst; score(int amount, int aflag, char monst)
int amount, aflag;
{ {
reg struct sc_ent *scp, *sc2; reg struct sc_ent *scp, *sc2;
reg int i, fd, prflags = 0; reg int i, fd, prflags = 0;
@ -261,8 +260,8 @@ void writelog(int amount, int aflag, char monst)
* showtop: * showtop:
* Display the top ten on the screen * Display the top ten on the screen
*/ */
showtop(showname) bool
int showname; showtop(int showname)
{ {
reg int fd, i; reg int fd, i;
char *killer; char *killer;
@ -310,7 +309,8 @@ int showname;
* total_winner: * total_winner:
* The hero made it back out alive * The hero made it back out alive
*/ */
total_winner() void
total_winner(void)
{ {
clear(); clear();
addstr(" \n"); addstr(" \n");
@ -345,9 +345,8 @@ addstr("a great profit and are admitted to the fighters guild.\n");
* showpack: * showpack:
* Display the contents of the hero's pack * Display the contents of the hero's pack
*/ */
showpack(winner, howso) void
bool winner; showpack(bool winner, char *howso)
char *howso;
{ {
reg char *iname; reg char *iname;
reg int cnt, worth, ch; reg int cnt, worth, ch;
@ -392,8 +391,7 @@ char *howso;
* Returns what the hero was killed by. * Returns what the hero was killed by.
*/ */
char * char *
killname(monst) killname(unsigned char monst)
unsigned char monst;
{ {
if (monst < MAXMONS + 1) if (monst < MAXMONS + 1)
return monsters[monst].m_name; return monsters[monst].m_name;

View file

@ -2,11 +2,10 @@ EXTTHG player;
EXTWEP weaps[]; EXTWEP weaps[];
EXTARM armors[]; EXTARM armors[];
EXTMON monsters[], *mtlev[]; EXTMON monsters[], *mtlev[];
EXTTRAP *trap_at(), traps[]; EXTTRAP traps[];
EXTROOM *roomin(), *oldrp, rooms[]; EXTROOM *oldrp, rooms[];
EXTCORD *rndmove(), *rnd_pos(), delta, stairs, oldpos, rndspot; EXTCORD delta, stairs, oldpos, rndspot;
EXTLKL *mlist, *lvl_obj, *new_item(), *new_thing(), *new_monster(); EXTLKL *mlist, *lvl_obj;
EXTLKL *find_mons(), *wake_monster(), *find_obj(), *get_item();
EXTOBJ *cur_armor, *cur_weapon, *cur_ring[]; EXTOBJ *cur_armor, *cur_weapon, *cur_ring[];
EXTMAG r_magic[], s_magic[], ws_magic[], p_magic[]; EXTMAG r_magic[], s_magic[], ws_magic[], p_magic[];
EXTMAG things[], a_magic[], w_magic[]; EXTMAG things[], a_magic[], w_magic[];
@ -14,20 +13,16 @@ EXTINT max_hp, quiet, food_left, hungry_state, level, max_level;
EXTINT foodlev, total, count, demoncnt, fung_hit, ntraps; EXTINT foodlev, total, count, demoncnt, fung_hit, ntraps;
EXTINT lastscore, purse, mpos, seed, dnum, no_food, packvol, playuid; EXTINT lastscore, purse, mpos, seed, dnum, no_food, packvol, playuid;
EXTINT curprice, trader, group, levcount, levtype, ringfood, playgid; EXTINT curprice, trader, group, levcount, levtype, ringfood, playgid;
EXTINT chkstairs(), rollwand(), swander(), notslow(), notfight(), rnd(); EXTINT chkstairs(), notfight();
EXTINT rchg_str(), wghtchk(), stomach(), doctor(), runners(), status(), sight(); EXTINT prntfile();
extern void quit(), auto_save(), endit(), byebye(), game_err();
EXTINT prntfile(), unconfuse(), sapem();
EXTINT noteth(), notregen(), notinvinc(), unsee(), nohaste(), npch();
EXTBOOL running, nochange, after, inwhgt, isfight, firstmove, nlmove; EXTBOOL running, nochange, after, inwhgt, isfight, firstmove, nlmove;
EXTBOOL wizard, waswizard, in_shell, amulet, door_stop, playing, use_savedir; EXTBOOL wizard, waswizard, in_shell, amulet, door_stop, playing, use_savedir;
EXTBOOL notify, ws_know[], p_know[], s_know[], r_know[], inpool; EXTBOOL notify, ws_know[], p_know[], s_know[], r_know[], inpool;
EXTCHAR home[], file_name[], whoami[], fruit[], curpurch[], scorefile[]; EXTCHAR home[], file_name[], whoami[], fruit[], curpurch[], scorefile[];
EXTCHAR *r_stones[], *p_colors[], *s_names[], *ws_type[], *ws_made[]; EXTCHAR *r_stones[], *p_colors[], *s_names[], *ws_type[], *ws_made[];
EXTCHAR *ws_guess[], *s_guess[], *r_guess[], *p_guess[];/*, *unctrl();*/ EXTCHAR *ws_guess[], *s_guess[], *r_guess[], *p_guess[];/*, *unctrl();*/
EXTCHAR morestr[], prbuf[], huh[], *identify(), *vowelstr(); EXTCHAR morestr[], prbuf[], huh[];
EXTCHAR *new(), *strcpy(), *strcat(), *inv_name(), pack_char(), *prname(); EXTCHAR *release, take, runch;
EXTCHAR *num(), *getenv(), *tr_name(), *release, take, runch;
EXTCHAR retstr[], wizstr[], spacemsg[], illegal[], callit[], starlist[]; EXTCHAR retstr[], wizstr[], spacemsg[], illegal[], callit[], starlist[];
EXTSTAT max_stats, *him; EXTSTAT max_stats, *him;
extern struct magic_info thnginfo[]; extern struct magic_info thnginfo[];
@ -46,3 +41,207 @@ extern char *stones[NSTONES];
extern char *wood[NWOOD]; extern char *wood[NWOOD];
extern char *metal[NMETAL]; extern char *metal[NMETAL];
void _attach(struct linked_list **list, struct linked_list *item);
void _detach(struct linked_list **list, struct linked_list *item);
void _free_list(struct linked_list **ptr);
void activity(void);
int add_dam(struct stats *who);
void add_haste(bool potion);
void add_mon(struct room *rm, bool treas);
bool add_pack(struct linked_list *item, bool silent);
void add_pass(void);
void addmsg(char *fmt, ...);
void aggravate(void);
int attack(struct thing *mp);
bool author(void);
void auto_save(int a);
int be_trapped(struct coord *tc, struct thing *th);
void buy_it(void);
void byebye(int how);
bool cansee(int y, int x);
char *charge_str(struct object *obj);
void check_level(void);
void chg_abil(int what, int amt, int how);
void chg_hpt(int howmany, bool alsomax, char what);
void command(void);
bool cordok(int y, int x);
void create_obj(bool fscr);
void cur_null(struct object *op);
void dbotline(WINDOW *scr, char *message);
bool dead_end(char ch);
void death(char monst);
void del_pack(struct linked_list *what);
bool diag_ok(struct coord *sp, struct coord *ep);
void dip_it(void);
void discard(struct linked_list *item);
void displevl(void);
void dispmax(void);
void dispmons(void);
void do_daemons(int flag);
void do_fuses(void);
void do_maze(void);
void do_motion(struct object *obj, int ydelta, int xdelta);
void do_move(int dy, int dx);
void do_passages(void);
void do_post(void);
void do_rooms(void);
void do_run(char ch);
void do_zap(bool gotdir);
void doctor(int fromfuse);
void draw_room(struct room *rp);
int drop(struct linked_list *item);
bool dropcheck(struct object *op);
void eat(void);
int encread(void *starta, unsigned int size, int inf);
void encwrite(void *starta, unsigned int size, FILE *outf);
void endit(int a);
void endmsg(void);
void extinguish(int (*func)());
int extras(void);
void fall(struct linked_list *item, bool pr);
bool fallpos(struct coord *pos, struct coord *newpos, bool passages);
void fatal(char *s);
bool fight(struct coord *mp, struct object *weap, bool thrown);
struct linked_list *find_mons(int y, int x);
struct linked_list *find_obj(int y, int x);
void fix_stick(struct object *cur);
void fuse(int (*func)(), int arg, int time);
void game_err(int a);
void genocide(void);
bool get_dir(void);
struct linked_list *get_item(char *purpose, int type);
int get_str(char *opt, WINDOW *awin);
int get_worth(struct object *obj);
int getbless(void);
int getindex(char what);
int getpcon(struct stats *who);
int getpdex(struct stats *who, bool heave);
int getpwis(struct stats *who);
void heal_self(int factor, bool updmaxhp);
bool hit_monster(struct coord *mp, struct object *obj);
int hitweight(void);
bool hurt_armor(struct object *obj);
void idenpack(void);
char *identify(int what);
void ignore(void);
bool illeg_ch(unsigned char ch);
void init_everything(void);
void init_ring(struct object *what, bool fromwiz);
void init_weapon(struct object *weap, int type);
void initarmor(struct object *obj, int what);
void initfood(struct object *what);
char *inv_name(struct object *obj, bool drop);
bool inventory(struct linked_list *list, int type);
int itemvol(struct object *wh);
int itemweight(struct object *wh);
bool is_current(struct object *obj);
bool is_magic(struct object *obj);
bool isatrap(char ch);
bool isring(int hand, int ring);
bool iswearing(int ring);
void killed(struct linked_list *item, bool pr);
void lengthen(int (*func)(), int xtime);
void lev_mon(void);
void light(struct coord *cp);
void look(bool wakeup);
bool magring(struct object *what);
bool makemons(int what);
int midx(char whichmon);
void missile(int ydelta, int xdelta);
void money(void);
bool monhurt(struct thing *th);
void msg(char *fmt, ...);
char *new(int size);
struct linked_list *new_item(int size);
void new_level(int ltype);
struct linked_list *new_monster(char type, struct coord *cp, bool treas);
struct linked_list *new_thing(bool treas, int type, int which);
void nohaste(int fromfuse);
void noteth(int fromfuse);
void notinvinc(int fromfuse);
void notregen(int fromfuse);
void notslow(int fromfuse);
char npch(char ch);
char *num(int n1, int n2);
bool o_off(struct object *what, long bit);
bool o_on(struct object *what, long bit);
void option(void);
char pack_char(struct object *obj);
void parse_opts(char *str);
bool passwd(void);
int pick_one(struct magic_item *mag);
void pick_up(char ch);
void picky_inven(void);
bool pl_off(long what);
bool pl_on(long what);
void playit(void);
bool price_it(void);
void quaff(void);
void quit(int a);
void raise_level(void);
void rchg_str(int amt);
void read_scroll(void);
int readchar(void);
void remove_monster(struct coord *mp, struct linked_list *item);
void resoflg(struct object *what, long bit);
bool restore(char *file, char **envp);
void restscr(WINDOW *scr);
bool rf_on(struct room *rm, long bit);
char *ring_num(struct object *what);
void ring_off(void);
void ring_on(void);
void ringabil(void);
int ringex(int rtype);
int rnd(int range);
char rnd_mon(bool wander, bool baddie);
struct coord *rnd_pos(struct room *rp);
int rnd_room(void);
struct coord *rndmove(struct thing *who);
int roll(int number, int sides);
void rollwand(int fromfuse);
struct room *roomin(struct coord *cp);
int rs_restore_file(int inf);
int rs_save_file(FILE *savef);
void runners(void);
void runto(struct coord *runner, struct coord *spot);
void sapem(int fromfuse);
bool save(int which);
bool save_game(void);
bool save_throw(int which, struct thing *tp);
void score(int amount, int aflag, char monst);
void sell_it(void);
void setoflg(struct object *what, long bit);
void setup(void);
char show(int y, int x);
bool showtop(int showname);
void sight(int fromfuse);
void start_daemon(int (*func)(), int arg, int type);
void status(int fromfuse);
bool step_ok(unsigned char ch);
void stomach(int fromfuse);
int str_plus(struct stats *who);
void strucpy(char *s1, char *s2, int len);
void swander(int fromfuse);
bool swing(int at_lvl, int op_arm, int wplus);
void take_off(void);
int teleport(struct coord spot, struct thing *th);
void toss_ring(struct object *what);
void total_winner(void);
int totalenc(void);
char *tr_name(char ch);
struct trap *trap_at(int y, int x);
void unconfuse(int fromfuse);
void unhold(char whichmon);
void unsee(int fromfuse);
void updpack(void);
char *vowelstr(char *str);
void wait_for(WINDOW *win, char ch);
struct linked_list *wake_monster(int y, int x);
void wanderer(void);
void waste_time(void);
void wear(void);
void wghtchk(int fromfuse);
void whatis(struct linked_list *what);
void wield(void);
char winat(int y, int x);
void writelog(int amount, int aflag, char monst);

View file

@ -17,11 +17,15 @@
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
void horiz(int cnt);
void vert(int cnt);
/* /*
* do_rooms: * do_rooms:
* Place the rooms in the dungeon * Place the rooms in the dungeon
*/ */
do_rooms() void
do_rooms(void)
{ {
int mloops, mchance, nummons, left_out, roomtries; int mloops, mchance, nummons, left_out, roomtries;
bool treas = FALSE; bool treas = FALSE;
@ -131,9 +135,8 @@ do_rooms()
* add_mon: * add_mon:
* Add a monster to a room * Add a monster to a room
*/ */
add_mon(rm, treas) void
struct room *rm; add_mon(struct room *rm, bool treas)
bool treas;
{ {
reg struct thing *tp; reg struct thing *tp;
reg struct linked_list *item; reg struct linked_list *item;
@ -165,8 +168,8 @@ bool treas;
* draw_room: * draw_room:
* Draw a box around a room * Draw a box around a room
*/ */
draw_room(rp) void
struct room *rp; draw_room(struct room *rp)
{ {
reg int j, k; reg int j, k;
@ -197,8 +200,8 @@ struct room *rp;
* horiz: * horiz:
* draw a horizontal line * draw a horizontal line
*/ */
horiz(cnt) void
int cnt; horiz(int cnt)
{ {
while (cnt-- > 0) while (cnt-- > 0)
addch('-'); addch('-');
@ -209,8 +212,8 @@ int cnt;
* vert: * vert:
* draw a vertical line * draw a vertical line
*/ */
vert(cnt) void
int cnt; vert(int cnt)
{ {
reg int x, y; reg int x, y;
@ -228,8 +231,7 @@ int cnt;
* pick a random spot in a room * pick a random spot in a room
*/ */
struct coord * struct coord *
rnd_pos(rp) rnd_pos(struct room *rp)
struct room *rp;
{ {
reg int y, x, i; reg int y, x, i;
static struct coord spot; static struct coord spot;
@ -249,9 +251,8 @@ struct room *rp;
* rf_on: * rf_on:
* Returns TRUE if flag is set for room stuff * Returns TRUE if flag is set for room stuff
*/ */
rf_on(rm, bit) bool
struct room *rm; rf_on(struct room *rm, long bit)
long bit;
{ {
return (rm->r_flags & bit); return (rm->r_flags & bit);
} }

View file

@ -32,6 +32,9 @@
EXTCHAR version[]; EXTCHAR version[];
EXTCHAR *ctime(); EXTCHAR *ctime();
bool dosave(void);
void save_file(FILE *savef);
typedef struct stat STAT; typedef struct stat STAT;
STAT sbuf; STAT sbuf;
@ -39,7 +42,8 @@ STAT sbuf;
* ignore: * ignore:
* Ignore ALL signals possible * Ignore ALL signals possible
*/ */
ignore() void
ignore(void)
{ {
md_ignoreallsignals(); md_ignoreallsignals();
} }
@ -48,7 +52,8 @@ ignore()
* save_game: * save_game:
* Save the current game * Save the current game
*/ */
save_game() bool
save_game(void)
{ {
reg FILE *savef; reg FILE *savef;
reg int c; reg int c;
@ -136,7 +141,8 @@ game_err(int a)
* dosave: * dosave:
* Save the game. UID/GID no longer get reset here. * Save the game. UID/GID no longer get reset here.
*/ */
dosave() bool
dosave(void)
{ {
FILE *savef; FILE *savef;
@ -157,8 +163,8 @@ dosave()
* save_file: * save_file:
* Do the actual save of this game to a file * Do the actual save of this game to a file
*/ */
save_file(savef) void
FILE *savef; save_file(FILE *savef)
{ {
int slines = LINES; int slines = LINES;
int scols = COLS; int scols = COLS;
@ -182,10 +188,10 @@ FILE *savef;
* restore: * restore:
* Restore a saved game from a file * Restore a saved game from a file
*/ */
restore(file, envp) bool
char *file, **envp; restore(char *file, char **envp)
{ {
register inf, pid; register int inf, pid;
int ret_status; int ret_status;
#ifndef _AIX #ifndef _AIX
extern char **environ; extern char **environ;

View file

@ -24,7 +24,8 @@
* read_scroll: * read_scroll:
* Let the hero read a scroll * Let the hero read a scroll
*/ */
read_scroll() void
read_scroll(void)
{ {
reg struct object *obj; reg struct object *obj;
reg struct linked_list *item; reg struct linked_list *item;

View file

@ -70,6 +70,9 @@
#define READSTAT ((format_error == 0) && (read_error == 0)) #define READSTAT ((format_error == 0) && (read_error == 0))
#define WRITESTAT (write_error == 0) #define WRITESTAT (write_error == 0)
int rs_read_int(int inf, int *i);
int rs_write_int(FILE *savef, int c);
int read_error = FALSE; int read_error = FALSE;
int write_error = FALSE; int write_error = FALSE;
int format_error = FALSE; int format_error = FALSE;
@ -82,10 +85,8 @@ char encstr[] = "\354\251\243\332A\201|\301\321p\210\251\327\"\257\365t\341%3\27
/* /*
* perform an encrypted write * perform an encrypted write
*/ */
encwrite(starta, size, outf) void
register void *starta; encwrite(void *starta, unsigned int size, FILE *outf)
unsigned int size;
register FILE *outf;
{ {
register char *ep; register char *ep;
register char *start = starta; register char *start = starta;
@ -103,10 +104,8 @@ register FILE *outf;
/* /*
* perform an encrypted read * perform an encrypted read
*/ */
encread(starta, size, inf) int
register void *starta; encread(void *starta, unsigned int size, int inf)
unsigned int size;
register int inf;
{ {
register char *ep; register char *ep;
register int read_size; register int read_size;
@ -1556,6 +1555,7 @@ rs_write_traps(FILE *savef, struct trap *trap,int count)
} }
} }
int
rs_read_traps(int inf, struct trap *trap, int count) rs_read_traps(int inf, struct trap *trap, int count)
{ {
int id = 0, value = 0, n = 0; int id = 0, value = 0, n = 0;
@ -1885,8 +1885,8 @@ rs_read_thing(int inf, struct thing *t)
return(READSTAT); return(READSTAT);
} }
rs_fix_monster_list(list) void
struct linked_list *list; rs_fix_monster_list(struct linked_list *list)
{ {
struct linked_list *item; struct linked_list *item;
@ -1970,6 +1970,7 @@ rs_write_object_reference(FILE *savef, struct linked_list *list,
return(WRITESTAT); return(WRITESTAT);
} }
int
rs_read_object_reference(int inf, struct linked_list *list, rs_read_object_reference(int inf, struct linked_list *list,
struct object **item) struct object **item)
{ {
@ -2225,6 +2226,7 @@ rs_save_file(FILE *savef)
return(WRITESTAT); return(WRITESTAT);
} }
int
rs_restore_file(int inf) rs_restore_file(int inf)
{ {
bool junk; bool junk;

View file

@ -16,15 +16,18 @@
*/ */
#include <ctype.h> #include <ctype.h>
#include <string.h>
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
void drain(int ymin, int ymax, int xmin, int xmax);
/* /*
* fix_stick: * fix_stick:
* Init a stick for the hero * Init a stick for the hero
*/ */
fix_stick(cur) void
struct object *cur; fix_stick(struct object *cur)
{ {
struct rod *rd; struct rod *rd;
@ -62,8 +65,8 @@ struct object *cur;
* do_zap: * do_zap:
* Zap a stick at something * Zap a stick at something
*/ */
do_zap(gotdir) void
bool gotdir; do_zap(bool gotdir)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -537,8 +540,8 @@ bool gotdir;
* drain: * drain:
* Do drain hit points from player stick * Do drain hit points from player stick
*/ */
drain(ymin, ymax, xmin, xmax) void
int ymin, ymax, xmin, xmax; drain(int ymin, int ymax, int xmin, int xmax)
{ {
reg int i, j, cnt; reg int i, j, cnt;
reg struct thing *ick; reg struct thing *ick;
@ -580,8 +583,7 @@ int ymin, ymax, xmin, xmax;
* Return number of charges left in a stick * Return number of charges left in a stick
*/ */
char * char *
charge_str(obj) charge_str(struct object *obj)
struct object *obj;
{ {
static char buf[20]; static char buf[20];

View file

@ -20,15 +20,14 @@
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
void basic_init(struct object *cur);
/* /*
* inv_name: * inv_name:
* Return the name of something as it would appear in an inventory. * Return the name of something as it would appear in an inventory.
*/ */
char * char *
inv_name(obj, drop) inv_name(struct object *obj, bool drop)
struct object *obj;
bool drop;
{ {
reg char *pb, *tn, *pl; reg char *pb, *tn, *pl;
reg int wh, knowit; reg int wh, knowit;
@ -183,7 +182,8 @@ bool drop;
* money: * money:
* Add to characters purse * Add to characters purse
*/ */
money() void
money(void)
{ {
reg struct room *rp; reg struct room *rp;
reg struct linked_list *item; reg struct linked_list *item;
@ -215,8 +215,8 @@ money()
* drop: * drop:
* put something down * put something down
*/ */
drop(item) int
struct linked_list *item; drop(struct linked_list *item)
{ {
reg char ch; reg char ch;
reg struct linked_list *ll, *nll; reg struct linked_list *ll, *nll;
@ -281,8 +281,8 @@ struct linked_list *item;
* dropcheck: * dropcheck:
* Do special checks for dropping or unweilding|unwearing|unringing * Do special checks for dropping or unweilding|unwearing|unringing
*/ */
dropcheck(op) bool
struct object *op; dropcheck(struct object *op)
{ {
if (op == NULL) if (op == NULL)
return TRUE; return TRUE;
@ -320,9 +320,7 @@ struct object *op;
* Return a new thing * Return a new thing
*/ */
struct linked_list * struct linked_list *
new_thing(treas, type, which) new_thing(bool treas, int type, int which)
int type, which;
bool treas;
{ {
struct linked_list *item; struct linked_list *item;
struct magic_item *mi; struct magic_item *mi;
@ -404,8 +402,8 @@ bool treas;
* basic_init: * basic_init:
* Set all params of an object to the basic values. * Set all params of an object to the basic values.
*/ */
basic_init(cur) void
struct object *cur; basic_init(struct object *cur)
{ {
cur->o_ac = 11; cur->o_ac = 11;
cur->o_count = 1; cur->o_count = 1;
@ -423,7 +421,8 @@ struct object *cur;
* extras: * extras:
* Return the number of extra items to be created * Return the number of extra items to be created
*/ */
extras() int
extras(void)
{ {
reg int i; reg int i;
@ -441,8 +440,8 @@ extras()
* 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(mag) int
struct magic_item *mag; pick_one(struct magic_item *mag)
{ {
reg struct magic_item *start; reg struct magic_item *start;
reg int i; reg int i;

View file

@ -11,16 +11,25 @@
*/ */
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
#define NOTPRICED -1 #define NOTPRICED -1
bool open_market(void);
void trans_line(void);
void draw_maze(void);
int findcells(int y, int x);
void rmwall(int newy, int newx, int oldy, int oldx);
void crankout(void);
/* /*
* do_post: * do_post:
* Put a trading post room and stuff on the screen * Put a trading post room and stuff on the screen
*/ */
do_post() void
do_post(void)
{ {
struct coord tp; struct coord tp;
reg int i; reg int i;
@ -66,7 +75,8 @@ do_post()
* price_it: * price_it:
* Price the object that the hero stands on * Price the object that the hero stands on
*/ */
price_it() bool
price_it(void)
{ {
static char *bargain[] = { static char *bargain[] = {
"great bargain", "great bargain",
@ -100,7 +110,8 @@ price_it()
* buy_it: * buy_it:
* Buy the item on which the hero stands * Buy the item on which the hero stands
*/ */
buy_it() void
buy_it(void)
{ {
reg int wh; reg int wh;
@ -151,7 +162,8 @@ buy_it()
* sell_it: * sell_it:
* Sell an item to the trading post * Sell an item to the trading post
*/ */
sell_it() void
sell_it(void)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -199,7 +211,8 @@ sell_it()
* open_market: * open_market:
* Retruns TRUE when ok do to transacting * Retruns TRUE when ok do to transacting
*/ */
open_market() bool
open_market(void)
{ {
if (trader >= MAXPURCH) { if (trader >= MAXPURCH) {
msg("The market is closed. The stairs are that-a-way."); msg("The market is closed. The stairs are that-a-way.");
@ -213,8 +226,8 @@ open_market()
* get_worth: * get_worth:
* Calculate an objects worth in gold * Calculate an objects worth in gold
*/ */
get_worth(obj) int
struct object *obj; get_worth(struct object *obj)
{ {
reg int worth, wh; reg int worth, wh;
@ -272,7 +285,8 @@ struct object *obj;
* trans_line: * trans_line:
* Show how many transactions the hero has left * Show how many transactions the hero has left
*/ */
trans_line() void
trans_line(void)
{ {
sprintf(prbuf,"You have %d transactions remaining.",MAXPURCH-trader); sprintf(prbuf,"You have %d transactions remaining.",MAXPURCH-trader);
mvwaddstr(cw, LINES - 4, 0, prbuf); mvwaddstr(cw, LINES - 4, 0, prbuf);
@ -282,7 +296,8 @@ trans_line()
* domaze: * domaze:
* Draw the maze on this level. * Draw the maze on this level.
*/ */
do_maze() void
do_maze(void)
{ {
struct coord tp; struct coord tp;
reg int i, least; reg int i, least;
@ -328,14 +343,16 @@ struct bordercells {
} mborder; } mborder;
char *frontier, *bits; char *frontier, *bits;
char *moffset(), *foffset(); char *moffset(int y, int x);
char *foffset(int y, int x);
int tlines, tcols; int tlines, tcols;
/* /*
* draw_maze: * draw_maze:
* Generate and draw the maze on the screen * Generate and draw the maze on the screen
*/ */
draw_maze() void
draw_maze(void)
{ {
reg int i, j, more; reg int i, j, more;
reg char *ptr; reg char *ptr;
@ -372,8 +389,7 @@ draw_maze()
* Calculate memory address for bits * Calculate memory address for bits
*/ */
char * char *
moffset(y, x) moffset(int y, int x)
int y, x;
{ {
char *ptr; char *ptr;
@ -386,8 +402,7 @@ int y, x;
* Calculate memory address for frontier * Calculate memory address for frontier
*/ */
char * char *
foffset(y, x) foffset(int y, int x)
int y, x;
{ {
char *ptr; char *ptr;
@ -399,8 +414,8 @@ int y, x;
* findcells: * findcells:
* Figure out cells to open up * Figure out cells to open up
*/ */
findcells(y,x) int
int x, y; findcells(int y, int x)
{ {
reg int rtpos, i; reg int rtpos, i;
@ -450,8 +465,8 @@ int x, y;
* rmwall: * rmwall:
* Removes appropriate walls from the maze * Removes appropriate walls from the maze
*/ */
rmwall(newy, newx, oldy, oldx) void
int newy, newx, oldy, oldx; rmwall(int newy, int newx, int oldy, int oldx)
{ {
reg int xdif,ydif; reg int xdif,ydif;
@ -467,7 +482,8 @@ int newy, newx, oldy, oldx;
* crankout: * crankout:
* Does actual drawing of maze to window * Does actual drawing of maze to window
*/ */
crankout() void
crankout(void)
{ {
reg int x, y, i; reg int x, y, i;

View file

@ -14,6 +14,7 @@
* See the file LICENSE.TXT for full copyright and licensing information. * See the file LICENSE.TXT for full copyright and licensing information.
*/ */
#include <string.h>
#include <ctype.h> #include <ctype.h>
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
@ -22,8 +23,8 @@
* 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)
{ {
reg struct object *obj, *nowwield; reg struct object *obj, *nowwield;
reg struct linked_list *item, *nitem; reg struct linked_list *item, *nitem;
@ -83,9 +84,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
struct object *obj; do_motion(struct object *obj, int ydelta, int xdelta)
int ydelta, xdelta;
{ {
reg int ch, y, x; reg int ch, y, x;
@ -120,9 +120,8 @@ int ydelta, xdelta;
* Drop an item someplace around here. * Drop an item someplace around here.
*/ */
fall(item, pr) void
struct linked_list *item; fall(struct linked_list *item, bool pr)
bool pr;
{ {
reg struct object *obj; reg struct object *obj;
reg struct room *rp; reg struct room *rp;
@ -155,9 +154,8 @@ bool pr;
* Set up the initial goodies for a weapon * Set up the initial goodies for a weapon
*/ */
init_weapon(weap, type) void
struct object *weap; init_weapon(struct object *weap, int type)
int type;
{ {
reg struct init_weps *iwp; reg struct init_weps *iwp;
@ -182,9 +180,8 @@ int type;
* hit_monster: * hit_monster:
* Does the missile hit the monster * Does the missile hit the monster
*/ */
hit_monster(mp, obj) bool
struct coord *mp; hit_monster(struct coord *mp, struct object *obj)
struct object *obj;
{ {
return fight(mp, obj, TRUE); return fight(mp, obj, TRUE);
} }
@ -194,8 +191,7 @@ struct object *obj;
* Figure out the plus number for armor/weapons * Figure out the plus number for armor/weapons
*/ */
char * char *
num(n1, n2) num(int n1, int n2)
int n1, n2;
{ {
static char numbuf[LINLEN]; static char numbuf[LINLEN];
@ -212,7 +208,8 @@ int n1, n2;
* wield: * wield:
* Pull out a certain weapon * Pull out a certain weapon
*/ */
wield() void
wield(void)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj, *oweapon; reg struct object *obj, *oweapon;
@ -238,9 +235,8 @@ wield()
* 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, passages) bool
struct coord *pos, *newpos; fallpos(struct coord *pos, struct coord *newpos, bool passages)
bool passages;
{ {
reg int y, x, ch; reg int y, x, ch;

View file

@ -16,6 +16,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <ctype.h> #include <ctype.h>
#include <string.h>
#include "rogue.h" #include "rogue.h"
#include "rogue.ext" #include "rogue.ext"
@ -23,8 +24,8 @@
* whatis: * whatis:
* What a certain object is * What a certain object is
*/ */
whatis(what) void
struct linked_list *what; whatis(struct linked_list *what)
{ {
reg struct object *obj; reg struct object *obj;
reg struct linked_list *item; reg struct linked_list *item;
@ -74,8 +75,8 @@ struct linked_list *what;
* create_obj: * create_obj:
* Create any object for wizard or scroll (almost) * Create any object for wizard or scroll (almost)
*/ */
create_obj(fscr) void
bool fscr; create_obj(bool fscr)
{ {
reg struct linked_list *item; reg struct linked_list *item;
reg struct object *obj; reg struct object *obj;
@ -245,7 +246,8 @@ bool fscr;
* getbless: * getbless:
* Get a blessing for a wizards object * Get a blessing for a wizards object
*/ */
getbless() int
getbless(void)
{ {
int bless; int bless;
@ -263,8 +265,8 @@ getbless()
* makemons: * makemons:
* Make a monster * Make a monster
*/ */
makemons(what) bool
int what; makemons(int what)
{ {
reg int x, y, oktomake = FALSE, appear = 1; reg int x, y, oktomake = FALSE, appear = 1;
struct coord mp; struct coord mp;
@ -293,9 +295,8 @@ int what;
* telport: * telport:
* Bamf the thing someplace else * Bamf the thing someplace else
*/ */
teleport(spot, th) int
struct coord spot; teleport(struct coord spot, struct thing *th)
struct thing *th;
{ {
reg int rm, y, x; reg int rm, y, x;
struct coord oldspot; struct coord oldspot;
@ -345,7 +346,8 @@ struct thing *th;
* passwd: * passwd:
* See if user knows password * See if user knows password
*/ */
passwd() bool
passwd(void)
{ {
reg char *sp, c; reg char *sp, c;
bool passok; bool passok;