Merge the GCC5 and build fix branches.

This fixes all warnings produced by GCC 5, except the ones related to
system functions.  Those could be fixed by including the proper headers,
but it would be better to replace the system-dependent code with
functions from mdport.c.
This commit is contained in:
John "Elwin" Edwards 2016-03-11 19:47:52 -05:00
commit 8df0a6308d
52 changed files with 416 additions and 392 deletions

View file

@ -70,7 +70,7 @@ f_slot(void)
* Find a particular slot in the table * Find a particular slot in the table
*/ */
struct delayed_action * struct delayed_action *
find_slot(int (*func)()) find_slot(void (*func)())
{ {
reg int i; reg int i;
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -87,7 +87,7 @@ find_slot(int (*func)())
* Start a daemon, takes a function. * Start a daemon, takes a function.
*/ */
void void
start_daemon(int (*func)(), void *arg, int type) start_daemon(void (*func)(), void *arg, int type)
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -107,7 +107,7 @@ start_daemon(int (*func)(), void *arg, int type)
* Remove a daemon from the list * Remove a daemon from the list
*/ */
void void
kill_daemon(int (*func)()) kill_daemon(void (*func)())
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
reg int i; reg int i;
@ -155,7 +155,7 @@ do_daemons(int flag)
* Start a fuse to go off in a certain number of turns * Start a fuse to go off in a certain number of turns
*/ */
void void
fuse(int (*func)(), void *arg, int time, int type) fuse(void (*func)(), void *arg, int time, int type)
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -175,7 +175,7 @@ fuse(int (*func)(), void *arg, int time, int type)
* Increase the time until a fuse goes off * Increase the time until a fuse goes off
*/ */
void void
lengthen(int (*func)(), int xtime) lengthen(void (*func)(), int xtime)
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -190,7 +190,7 @@ lengthen(int (*func)(), int xtime)
* Put out a fuse * Put out a fuse
*/ */
void void
extinguish(int (*func)()) extinguish(void (*func)())
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;

View file

@ -20,17 +20,18 @@
bool roll_em(struct thing *att_er, struct thing *def_er, struct object *weap, bool roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
bool hurl, struct object *cur_weapon, bool back_stab); bool hurl, struct object *cur_weapon, bool back_stab);
void hit(struct object *weapon, struct thing *tp, char *er, char *ee, void hit(struct object *weapon, struct thing *tp, const char *er,
bool back_stab); const char *ee, bool back_stab);
void miss(struct object *weapon, struct thing *tp, char *er, char *ee); void miss(struct object *weapon, struct thing *tp, const char *er,
const char *ee);
int dext_plus(int dexterity); int dext_plus(int dexterity);
int str_plus(short str); int str_plus(short str);
int add_dam(short str); int add_dam(short str);
int hung_dam(void); int hung_dam(void);
void thunk(struct object *weap, struct thing *tp, char *mname); void thunk(struct object *weap, struct thing *tp, const char *mname);
void m_thunk(struct object *weap, struct thing *tp, char *mname); void m_thunk(struct object *weap, struct thing *tp, const char *mname);
void bounce(struct object *weap, struct thing *tp, char *mname); void bounce(struct object *weap, struct thing *tp, const char *mname);
void m_bounce(struct object *weap, struct thing *tp, char *mname); void m_bounce(struct object *weap, struct thing *tp, const char *mname);
struct object *wield_weap(struct object *thrown, struct thing *mp); struct object *wield_weap(struct object *thrown, struct thing *mp);
void explode(struct thing *tp); void explode(struct thing *tp);
@ -1037,7 +1038,7 @@ roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
*/ */
char * char *
prname(char *who, bool upper) prname(const char *who, bool upper)
{ {
static char tbuf[LINELEN]; static char tbuf[LINELEN];
@ -1062,7 +1063,8 @@ prname(char *who, bool upper)
*/ */
void void
hit(struct object *weapon, struct thing *tp, char *er, char *ee, bool back_stab) hit(struct object *weapon, struct thing *tp, const char *er, const char *ee,
bool back_stab)
{ {
register char *s = NULL; register char *s = NULL;
char char
@ -1119,7 +1121,7 @@ hit(struct object *weapon, struct thing *tp, char *er, char *ee, bool back_stab)
*/ */
void void
miss(struct object *weapon, struct thing *tp, char *er, char *ee) miss(struct object *weapon, struct thing *tp, const char *er, const char *ee)
{ {
register char *s = NULL; register char *s = NULL;
char char
@ -1226,7 +1228,7 @@ hung_dam(void)
*/ */
void void
thunk(struct object *weap, struct thing *tp, char *mname) thunk(struct object *weap, struct thing *tp, const char *mname)
{ {
/* tp: Defender */ /* tp: Defender */
char *def_name; /* Name of defender */ char *def_name; /* Name of defender */
@ -1254,7 +1256,7 @@ thunk(struct object *weap, struct thing *tp, char *mname)
*/ */
void void
m_thunk(struct object *weap, struct thing *tp, char *mname) m_thunk(struct object *weap, struct thing *tp, const char *mname)
{ {
char *att_name; /* Name of attacker */ char *att_name; /* Name of attacker */
@ -1281,7 +1283,7 @@ m_thunk(struct object *weap, struct thing *tp, char *mname)
*/ */
void void
bounce(struct object *weap, struct thing *tp, char *mname) bounce(struct object *weap, struct thing *tp, const char *mname)
{ {
/* tp: Defender */ /* tp: Defender */
char *def_name; /* Name of defender */ char *def_name; /* Name of defender */
@ -1309,7 +1311,7 @@ bounce(struct object *weap, struct thing *tp, char *mname)
*/ */
void void
m_bounce(struct object *weap, struct thing *tp, char *mname) m_bounce(struct object *weap, struct thing *tp, const char *mname)
{ {
char *att_name; /* Name of attacker */ char *att_name; /* Name of attacker */

View file

@ -28,8 +28,8 @@
struct optstruct { struct optstruct {
char *o_name; /* option name */ char *o_name; /* option name */
char *o_prompt; /* prompt for interactive entry */ char *o_prompt; /* prompt for interactive entry */
int *o_opt; /* pointer to thing to set */ void *o_opt; /* pointer to thing to set */
int (*o_putfunc)(); /* function to print value */ void (*o_putfunc)(); /* function to print value */
int (*o_getfunc)(); /* function to get value interactively */ int (*o_getfunc)(); /* function to get value interactively */
}; };
@ -39,38 +39,38 @@ int get_ro(WINDOW *win, int oy, int ox);
int get_restr(char *optstr, WINDOW *win); int get_restr(char *optstr, WINDOW *win);
int get_score(char *optstr, WINDOW *win); int get_score(char *optstr, WINDOW *win);
void put_abil(int *ability, WINDOW *win); void put_abil(int *ability, WINDOW *win);
void get_abil(int *abil, WINDOW *win); int get_abil(int *abil, WINDOW *win);
void put_quest(int *quest, WINDOW *win); void put_quest(int *quest, WINDOW *win);
void get_quest(int *quest, WINDOW *win); int get_quest(int *quest, WINDOW *win);
void put_bool(bool *b, WINDOW *win); void put_bool(bool *b, WINDOW *win);
int get_bool(bool *bp, WINDOW *win); int get_bool(bool *bp, WINDOW *win);
void put_str(char *str, WINDOW *win); void put_str(char *str, WINDOW *win);
OPTION optlist[] = { OPTION optlist[] = {
{"terse", "Terse output: ", {"terse", "Terse output: ",
(int *) &terse, put_bool, get_bool }, (void *) &terse, put_bool, get_bool },
{"flush", "Flush typeahead during battle: ", {"flush", "Flush typeahead during battle: ",
(int *) &fight_flush, put_bool, get_bool }, (void *) &fight_flush, put_bool, get_bool },
{"jump", "Show position only at end of run: ", {"jump", "Show position only at end of run: ",
(int *) &jump, put_bool, get_bool }, (void *) &jump, put_bool, get_bool },
{"step", "Do inventories one line at a time: ", {"step", "Do inventories one line at a time: ",
(int *) &slow_invent, put_bool, get_bool }, (void *) &slow_invent, put_bool, get_bool },
{"askme", "Ask me about unidentified things: ", {"askme", "Ask me about unidentified things: ",
(int *) &askme, put_bool, get_bool }, (void *) &askme, put_bool, get_bool },
{"pickup", "Pick things up automatically: ", {"pickup", "Pick things up automatically: ",
(int *) &auto_pickup, put_bool, get_bool }, (void *) &auto_pickup, put_bool, get_bool },
{"name", "Name: ", {"name", "Name: ",
(int *) whoami, put_str, get_restr }, (void *) whoami, put_str, get_restr },
{"fruit", "Fruit: ", {"fruit", "Fruit: ",
(int *) fruit, put_str, get_str }, (void *) fruit, put_str, get_str },
{"file", "Save file: ", {"file", "Save file: ",
(int *) file_name, put_str, get_restr }, (void *) file_name, put_str, get_restr },
{"score", "Score file: ", {"score", "Score file: ",
(int *) score_file, put_str, get_score }, (void *) score_file, put_str, get_score },
{"class", "Character class: ", {"class", "Character class: ",
(int *)&char_type, put_abil, get_abil }, (void *)&char_type, put_abil, get_abil },
{"quest", "Quest item: ", {"quest", "Quest item: ",
(int *) &quest_item, put_quest, get_quest } (void *) &quest_item, put_quest, get_quest }
}; };
/* For fields that would be restricted if use_savedir is set. */ /* For fields that would be restricted if use_savedir is set. */
@ -111,27 +111,27 @@ int get_score(char *optstr, WINDOW *win)
/* /*
* The ability field is read-only * The ability field is read-only
*/ */
void int
get_abil(int *abil, WINDOW *win) get_abil(int *abil, WINDOW *win)
{ {
register int oy, ox; register int oy, ox;
getyx(win, oy, ox); getyx(win, oy, ox);
put_abil(abil, win); put_abil(abil, win);
get_ro(win, oy, ox); return get_ro(win, oy, ox);
} }
/* /*
* The quest field is read-only * The quest field is read-only
*/ */
void int
get_quest(int *quest, WINDOW *win) get_quest(int *quest, WINDOW *win)
{ {
register int oy, ox; register int oy, ox;
getyx(win, oy, ox); getyx(win, oy, ox);
waddstr(win, rel_magic[*quest].mi_name); waddstr(win, rel_magic[*quest].mi_name);
get_ro(win, oy, ox); return get_ro(win, oy, ox);
} }
/* /*
@ -416,18 +416,19 @@ parse_opts(char *str)
if (op->o_putfunc != put_abil) if (op->o_putfunc != put_abil)
strcpy((char *)op->o_opt, value); strcpy((char *)op->o_opt, value);
else if (*op->o_opt == -1) { /* Only init ability once */ else if (*(int *)op->o_opt == -1) {
/* Only init ability once */
register int len = strlen(value); register int len = strlen(value);
if (isupper(value[0])) value[0] = tolower(value[0]); if (isupper(value[0])) value[0] = tolower(value[0]);
if (EQSTR(value, "fighter", len)) if (EQSTR(value, "fighter", len))
*op->o_opt = C_FIGHTER; *(int *)op->o_opt = C_FIGHTER;
else if (EQSTR(value, "magic", min(len, 5))) else if (EQSTR(value, "magic", min(len, 5)))
*op->o_opt = C_MAGICIAN; *(int *)op->o_opt = C_MAGICIAN;
else if (EQSTR(value, "cleric", len)) else if (EQSTR(value, "cleric", len))
*op->o_opt = C_CLERIC; *(int *)op->o_opt = C_CLERIC;
else if (EQSTR(value, "thief", len)) else if (EQSTR(value, "thief", len))
*op->o_opt = C_THIEF; *(int *)op->o_opt = C_THIEF;
} }
} }
break; break;

View file

@ -724,7 +724,7 @@
struct delayed_action { struct delayed_action {
int d_type; int d_type;
int (*d_func)(); void (*d_func)();
void *d_arg; void *d_arg;
int d_time; int d_time;
}; };
@ -1013,17 +1013,17 @@ int encread(char *start, unsigned int size, int inf);
int encwrite(char *start, unsigned int size, FILE *outf); int encwrite(char *start, unsigned int size, FILE *outf);
void endit(int sig); void endit(int sig);
void endmsg(void); void endmsg(void);
void extinguish(int (*func)()); void extinguish(void (*func)());
void fall(struct linked_list *item, bool pr); void fall(struct linked_list *item, bool pr);
coord *fallpos(coord *pos, bool be_clear, int range); coord *fallpos(coord *pos, bool be_clear, int range);
void fatal(char *s); void fatal(char *s);
bool fight(coord *mp, struct object *weap, bool thrown); bool fight(coord *mp, struct object *weap, bool thrown);
struct linked_list *find_mons(int y, int x); struct linked_list *find_mons(int y, int x);
struct linked_list *find_obj(int y, int x); struct linked_list *find_obj(int y, int x);
struct delayed_action *find_slot(int (*func)()); struct delayed_action *find_slot(void (*func)());
void fix_stick(struct object *cur); void fix_stick(struct object *cur);
void fumble(void); void fumble(void);
void fuse(int (*func)(), void *arg, int time, int type); void fuse(void (*func)(), void *arg, int time, int type);
void genmonsters(int least, bool treas); void genmonsters(int least, bool treas);
bool get_dir(void); bool get_dir(void);
struct linked_list *get_item(struct linked_list *list, char *purpose, int type); struct linked_list *get_item(struct linked_list *list, char *purpose, int type);
@ -1053,11 +1053,11 @@ bool is_current(struct object *obj);
bool is_magic(struct object *obj); bool is_magic(struct object *obj);
bool isatrap(char ch); bool isatrap(char ch);
int itemweight(struct object *wh); int itemweight(struct object *wh);
void kill_daemon(int (*func)()); void kill_daemon(void (*func)());
void killed(struct linked_list *item, bool pr, bool points); void killed(struct linked_list *item, bool pr, bool points);
void lake_check(coord *place); void lake_check(coord *place);
void land(void); void land(void);
void lengthen(int (*func)(), int xtime); void lengthen(void (*func)(), int xtime);
void light(coord *cp); void light(coord *cp);
bool lit_room(struct room *rp); bool lit_room(struct room *rp);
void look(bool wakeup, bool runend); void look(bool wakeup, bool runend);
@ -1133,7 +1133,7 @@ bool shoot_ok(char ch);
char show(int y, int x); char show(int y, int x);
void sight(void); void sight(void);
struct linked_list *spec_item(int type, int which, int hit, int damage); struct linked_list *spec_item(int type, int which, int hit, int damage);
void start_daemon(int (*func)(), void *arg, int type); void start_daemon(void (*func)(), void *arg, int type);
void status(bool display); void status(bool display);
void steal(void); void steal(void);
bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr); bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr);
@ -1165,6 +1165,7 @@ void use_mm(int which);
char *vowelstr(char *str); char *vowelstr(char *str);
void wait_for(WINDOW *win, char ch); void wait_for(WINDOW *win, char ch);
struct linked_list *wake_monster(int y, int x); struct linked_list *wake_monster(int y, int x);
void wanderer(void);
void waste_time(void); void waste_time(void);
char *weap_name(struct object *obj); char *weap_name(struct object *obj);
void wear(void); void wear(void);

View file

@ -78,7 +78,7 @@ f_slot(void)
* Find a particular slot in the table * Find a particular slot in the table
*/ */
struct delayed_action * struct delayed_action *
find_slot(int (*func)()) find_slot(void (*func)())
{ {
reg int i; reg int i;
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -95,7 +95,7 @@ find_slot(int (*func)())
* Start a daemon, takes a function. * Start a daemon, takes a function.
*/ */
void void
start_daemon(int (*func)(), int arg, int type) start_daemon(void (*func)(), void *arg, int type)
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -103,7 +103,7 @@ start_daemon(int (*func)(), int arg, int type)
if (dev != NULL) { if (dev != NULL) {
dev->d_type = type; dev->d_type = type;
dev->d_func = func; dev->d_func = func;
dev->d_.arg = arg; dev->d_.varg = arg;
dev->d_time = DAEMON; dev->d_time = DAEMON;
demoncnt += 1; /* update count */ demoncnt += 1; /* update count */
} }
@ -115,7 +115,7 @@ start_daemon(int (*func)(), int arg, int type)
* Remove a daemon from the list * Remove a daemon from the list
*/ */
void void
kill_daemon(int (*func)()) kill_daemon(void (*func)())
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
reg int i; reg int i;
@ -154,7 +154,7 @@ do_daemons(int flag)
* Executing each one, giving it the proper arguments * Executing each one, giving it the proper arguments
*/ */
if (dev->d_type == flag && dev->d_time == DAEMON) if (dev->d_type == flag && dev->d_time == DAEMON)
(*dev->d_func)(dev->d_.arg); (*dev->d_func)(dev->d_.varg);
} }
@ -163,7 +163,7 @@ do_daemons(int flag)
* Start a fuse to go off in a certain number of turns * Start a fuse to go off in a certain number of turns
*/ */
void void
fuse(int (*func)(), int arg, int time, int type) fuse(void (*func)(), void *arg, int time, int type)
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -171,7 +171,10 @@ fuse(int (*func)(), int arg, int time, int type)
if (wire != NULL) { if (wire != NULL) {
wire->d_type = type; wire->d_type = type;
wire->d_func = func; wire->d_func = func;
wire->d_.arg = arg; if (func == changeclass || func == res_strength)
wire->d_.arg = *(int *) arg;
else
wire->d_.varg = arg;
wire->d_time = time; wire->d_time = time;
fusecnt += 1; /* update count */ fusecnt += 1; /* update count */
} }
@ -183,7 +186,7 @@ fuse(int (*func)(), int arg, int time, int type)
* Increase the time until a fuse goes off * Increase the time until a fuse goes off
*/ */
void void
lengthen(int (*func)(), int xtime) lengthen(void (*func)(), int xtime)
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -198,7 +201,7 @@ lengthen(int (*func)(), int xtime)
* Put out a fuse * Put out a fuse
*/ */
void void
extinguish(int (*func)()) extinguish(void (*func)())
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -232,8 +235,10 @@ do_fuses(int flag)
if(flag == wire->d_type && wire->d_time > 0 && if(flag == wire->d_type && wire->d_time > 0 &&
--wire->d_time == 0) { --wire->d_time == 0) {
wire->d_type = EMPTY; wire->d_type = EMPTY;
if (wire->d_func != NULL) if (wire->d_func == changeclass || wire->d_func == res_strength)
(*wire->d_func)(wire->d_.arg); (*wire->d_func)(wire->d_.arg);
else if (wire->d_func != NULL)
(*wire->d_func)(wire->d_.varg);
fusecnt -= 1; fusecnt -= 1;
} }
} }

View file

@ -111,7 +111,7 @@ doctor(struct thing *tp)
void void
swander(void) swander(void)
{ {
start_daemon(rollwand, 0, BEFORE); start_daemon(rollwand, NULL, BEFORE);
} }
/* /*
@ -134,7 +134,7 @@ rollwand(void)
if (levtype != POSTLEV) if (levtype != POSTLEV)
wanderer(); wanderer();
kill_daemon(rollwand); kill_daemon(rollwand);
fuse(swander, 0, WANDERTIME, BEFORE); fuse(swander, NULL, WANDERTIME, BEFORE);
} }
between = 0; between = 0;
} }
@ -663,7 +663,7 @@ spell_recovery(void)
time = SPELLTIME - max(17-pstats.s_intel, 0); time = SPELLTIME - max(17-pstats.s_intel, 0);
time = max(time, 5); time = max(time, 5);
if (spell_power > 0) spell_power--; if (spell_power > 0) spell_power--;
fuse(spell_recovery, 0, time, AFTER); fuse(spell_recovery, NULL, time, AFTER);
} }
/* /*
* give the hero back some prayer points * give the hero back some prayer points
@ -676,7 +676,7 @@ prayer_recovery(void)
time = SPELLTIME - max(17-pstats.s_wisdom, 0); time = SPELLTIME - max(17-pstats.s_wisdom, 0);
time = max(time, 5); time = max(time, 5);
if (pray_time > 0) pray_time--; if (pray_time > 0) pray_time--;
fuse(prayer_recovery, 0, time, AFTER); fuse(prayer_recovery, NULL, time, AFTER);
} }
/* /*
* give the hero back some chant points * give the hero back some chant points
@ -689,5 +689,5 @@ chant_recovery(void)
time = SPELLTIME - max(17-pstats.s_wisdom, 0); time = SPELLTIME - max(17-pstats.s_wisdom, 0);
time = max(time, 5); time = max(time, 5);
if (chant_time > 0) chant_time--; if (chant_time > 0) chant_time--;
fuse(chant_recovery, 0, time, AFTER); fuse(chant_recovery, NULL, time, AFTER);
} }

View file

@ -294,7 +294,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
if (on(player, HASSTINK)) lengthen(unstink, STINKTIME); if (on(player, HASSTINK)) lengthen(unstink, STINKTIME);
else { else {
turn_on(player, HASSTINK); turn_on(player, HASSTINK);
fuse(unstink, 0, STINKTIME, AFTER); fuse(unstink, NULL, STINKTIME, AFTER);
} }
} }
} }
@ -308,8 +308,10 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
msg("You cringe at %s's chilling touch.", msg("You cringe at %s's chilling touch.",
prname(attname, FALSE)); prname(attname, FALSE));
chg_str(-1); chg_str(-1);
if (lost_str++ == 0) if (lost_str++ == 0) {
fuse(res_strength, 0, CHILLTIME, AFTER); int fuse_arg = 0;
fuse(res_strength, &fuse_arg, CHILLTIME, AFTER);
}
else lengthen(res_strength, CHILLTIME); else lengthen(res_strength, CHILLTIME);
} }
} }
@ -344,7 +346,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
} }
else { else {
turn_on(*def, HASDISEASE); turn_on(*def, HASDISEASE);
fuse(cure_disease, 0, roll(HEALTIME,SICKTIME), AFTER); fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME), AFTER);
msg(terse ? "You have been diseased." msg(terse ? "You have been diseased."
: "You have contracted a disease!"); : "You have contracted a disease!");
} }
@ -478,7 +480,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
turn_off(*att, CANDANCE); turn_off(*att, CANDANCE);
turn_on(*def, ISDANCE); turn_on(*def, ISDANCE);
msg("You begin to dance uncontrollably!"); msg("You begin to dance uncontrollably!");
fuse(undance, 0, roll(2,4), AFTER); fuse(undance, NULL, roll(2,4), AFTER);
} }
/* /*
@ -491,7 +493,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
(find_slot(suffocate) == 0)) { (find_slot(suffocate) == 0)) {
turn_on(*att, DIDSUFFOCATE); turn_on(*att, DIDSUFFOCATE);
msg("%s is beginning to suffocate you.", prname(attname, TRUE)); msg("%s is beginning to suffocate you.", prname(attname, TRUE));
fuse(suffocate, 0, roll(9,3), AFTER); fuse(suffocate, NULL, roll(9,3), AFTER);
} }
/* /*
@ -530,11 +532,11 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
msg("You smell an unpleasant odor."); msg("You smell an unpleasant odor.");
else { else {
int odor_str = -(rnd(6)+1); int odor_str = -(rnd(6)+1);
int fuse_arg2 = 0;
msg("You are overcome by a foul odor."); msg("You are overcome by a foul odor.");
if (lost_str == 0) { if (lost_str == 0) {
chg_str(odor_str); chg_str(odor_str);
fuse(res_strength, 0, SMELLTIME, AFTER); fuse(res_strength, &fuse_arg2, SMELLTIME, AFTER);
lost_str -= odor_str; lost_str -= odor_str;
} }
else lengthen(res_strength, SMELLTIME); else lengthen(res_strength, SMELLTIME);

View file

@ -174,7 +174,7 @@ wghtchk(void)
ch = CCHAR( mvwinch(stdscr, hero.y, hero.x) ); ch = CCHAR( mvwinch(stdscr, hero.y, hero.x) );
if((ch != FLOOR && ch != PASSAGE)) { if((ch != FLOOR && ch != PASSAGE)) {
extinguish(wghtchk); extinguish(wghtchk);
fuse(wghtchk,TRUE,1,AFTER); fuse(wghtchk, NULL, 1, AFTER);
inwhgt = FALSE; inwhgt = FALSE;
return; return;
} }

View file

@ -538,7 +538,7 @@ roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
if (find_slot(unconfuse)) if (find_slot(unconfuse))
lengthen(unconfuse, HUHDURATION); lengthen(unconfuse, HUHDURATION);
else else
fuse(unconfuse, 0, HUHDURATION, AFTER); fuse(unconfuse, NULL, HUHDURATION, AFTER);
turn_on(player, ISHUH); turn_on(player, ISHUH);
} }
else msg("You feel dizzy, but it quickly passes."); else msg("You feel dizzy, but it quickly passes.");

View file

@ -393,18 +393,18 @@ main(int argc, char *argv[], char *envp[])
* Start up daemons and fuses * Start up daemons and fuses
*/ */
start_daemon(doctor, &player, AFTER); start_daemon(doctor, &player, AFTER);
fuse(swander, 0, WANDERTIME, AFTER); fuse(swander, NULL, WANDERTIME, AFTER);
if (player.t_ctype == C_MAGICIAN || player.t_ctype == C_RANGER) if (player.t_ctype == C_MAGICIAN || player.t_ctype == C_RANGER)
fuse(spell_recovery, 0, SPELLTIME, AFTER); fuse(spell_recovery, NULL, SPELLTIME, AFTER);
if (player.t_ctype == C_DRUID || player.t_ctype == C_RANGER) if (player.t_ctype == C_DRUID || player.t_ctype == C_RANGER)
fuse(chant_recovery, 0, SPELLTIME, AFTER); fuse(chant_recovery, NULL, SPELLTIME, AFTER);
if (player.t_ctype == C_CLERIC || player.t_ctype == C_PALADIN) if (player.t_ctype == C_CLERIC || player.t_ctype == C_PALADIN)
fuse(prayer_recovery, 0, SPELLTIME, AFTER); fuse(prayer_recovery, NULL, SPELLTIME, AFTER);
start_daemon(stomach, 0, AFTER); start_daemon(stomach, NULL, AFTER);
if (player.t_ctype == C_THIEF || if (player.t_ctype == C_THIEF ||
player.t_ctype == C_ASSASIN || player.t_ctype == C_ASSASIN ||
player.t_ctype == C_MONK) player.t_ctype == C_MONK)
start_daemon(trap_look, 0, AFTER); start_daemon(trap_look, NULL, AFTER);
/* Does this character have any special knowledge? */ /* Does this character have any special knowledge? */
switch (player.t_ctype) { switch (player.t_ctype) {

View file

@ -81,11 +81,11 @@ changeclass(int newclass)
* if he becomes a spell caster of some kind, give him a fuse * if he becomes a spell caster of some kind, give him a fuse
*/ */
if (newclass == C_MAGICIAN || newclass == C_RANGER) if (newclass == C_MAGICIAN || newclass == C_RANGER)
fuse(spell_recovery, 0, SPELLTIME, AFTER); fuse(spell_recovery, NULL, SPELLTIME, AFTER);
if (newclass == C_DRUID || newclass == C_RANGER) if (newclass == C_DRUID || newclass == C_RANGER)
fuse(chant_recovery, 0, SPELLTIME, AFTER); fuse(chant_recovery, NULL, SPELLTIME, AFTER);
if ((newclass==C_CLERIC || newclass==C_PALADIN) && !cur_misc[HEIL_ANKH]) if ((newclass==C_CLERIC || newclass==C_PALADIN) && !cur_misc[HEIL_ANKH])
fuse(prayer_recovery, 0, SPELLTIME, AFTER); fuse(prayer_recovery, NULL, SPELLTIME, AFTER);
/* /*
* if he's changing from a fighter then may have to change * if he's changing from a fighter then may have to change
* his sword since only fighter can use two-handed * his sword since only fighter can use two-handed
@ -117,7 +117,7 @@ changeclass(int newclass)
* if he becomes a thief then add the trap_look() daemon * if he becomes a thief then add the trap_look() daemon
*/ */
if (newclass == C_THIEF || newclass == C_ASSASIN || newclass == C_MONK) if (newclass == C_THIEF || newclass == C_ASSASIN || newclass == C_MONK)
start_daemon(trap_look, 0, AFTER); start_daemon(trap_look, NULL, AFTER);
char_type = player.t_ctype = newclass; char_type = player.t_ctype = newclass;
save = pstats.s_hpt; save = pstats.s_hpt;
max_stats.s_hpt = pstats.s_hpt = 0; max_stats.s_hpt = pstats.s_hpt = 0;
@ -1025,7 +1025,7 @@ use_mm(int which)
msg("aaAAACHOOOooo. Cough. Cough. Sneeze. Sneeze."); msg("aaAAACHOOOooo. Cough. Cough. Sneeze. Sneeze.");
if (!find_slot(dust_appear)) { if (!find_slot(dust_appear)) {
turn_on(player, ISINVIS); turn_on(player, ISINVIS);
fuse(dust_appear, 0, DUSTTIME, AFTER); fuse(dust_appear, NULL, DUSTTIME, AFTER);
PLAYER = IPLAYER; PLAYER = IPLAYER;
light(&hero); light(&hero);
} }
@ -1054,7 +1054,7 @@ use_mm(int which)
if (find_slot(unchoke)) if (find_slot(unchoke))
lengthen(unchoke, DUSTTIME); lengthen(unchoke, DUSTTIME);
else else
fuse(unchoke, 0, DUSTTIME, AFTER); fuse(unchoke, NULL, DUSTTIME, AFTER);
turn_on(player, ISHUH); turn_on(player, ISHUH);
turn_on(player, ISBLIND); turn_on(player, ISBLIND);
light(&hero); light(&hero);

View file

@ -649,7 +649,7 @@ wake_monster(int y, int x)
if (find_slot(unconfuse)) if (find_slot(unconfuse))
lengthen(unconfuse, HUHDURATION); lengthen(unconfuse, HUHDURATION);
else { else {
fuse(unconfuse, 0, HUHDURATION, AFTER); fuse(unconfuse, NULL, HUHDURATION, AFTER);
msg("%s's gaze has confused you.",prname(mname, TRUE)); msg("%s's gaze has confused you.",prname(mname, TRUE));
turn_on(player, ISHUH); turn_on(player, ISHUH);
} }
@ -691,7 +691,7 @@ wake_monster(int y, int x)
if (!save(VS_WAND, &player, 0)) { if (!save(VS_WAND, &player, 0)) {
msg("The gaze of %s blinds you", prname(mname, FALSE)); msg("The gaze of %s blinds you", prname(mname, FALSE));
turn_on(player, ISBLIND); turn_on(player, ISBLIND);
fuse(sight, 0, rnd(30)+20, AFTER); fuse(sight, NULL, rnd(30)+20, AFTER);
light(&hero); light(&hero);
} }
} }

View file

@ -33,8 +33,8 @@
struct optstruct { struct optstruct {
char *o_name; /* option name */ char *o_name; /* option name */
char *o_prompt; /* prompt for interactive entry */ char *o_prompt; /* prompt for interactive entry */
int *o_opt; /* pointer to thing to set */ void *o_opt; /* pointer to thing to set */
int (*o_putfunc)(); /* function to print value */ void (*o_putfunc)(); /* function to print value */
int (*o_getfunc)(); /* function to get value interactively */ int (*o_getfunc)(); /* function to get value interactively */
}; };
@ -45,9 +45,9 @@ int get_bool(bool *bp, WINDOW *win);
void put_str(char *str, WINDOW *win); void put_str(char *str, WINDOW *win);
int get_str(char *opt, WINDOW *win); int get_str(char *opt, WINDOW *win);
void put_abil(int *ability, WINDOW *win); void put_abil(int *ability, WINDOW *win);
void get_abil(int *abil, WINDOW *win); int get_abil(int *abil, WINDOW *win);
void put_quest(int *quest, WINDOW *win); void put_quest(int *quest, WINDOW *win);
void get_quest(int *quest, WINDOW *win); int get_quest(int *quest, WINDOW *win);
int get_ro(WINDOW *win, int oy, int ox); int get_ro(WINDOW *win, int oy, int ox);
int get_str_prot(char *opt, WINDOW *win); int get_str_prot(char *opt, WINDOW *win);
@ -56,55 +56,55 @@ bool allowchange(OPTION *op);
OPTION optlist[] = { OPTION optlist[] = {
{"terse", "Terse output: ", {"terse", "Terse output: ",
(int *) &terse, put_bool, get_bool }, (void *) &terse, put_bool, get_bool },
{"flush", "Flush typeahead during battle: ", {"flush", "Flush typeahead during battle: ",
(int *) &fight_flush, put_bool, get_bool }, (void *) &fight_flush, put_bool, get_bool },
{"jump", "Show position only at end of run: ", {"jump", "Show position only at end of run: ",
(int *) &jump, put_bool, get_bool }, (void *) &jump, put_bool, get_bool },
{"step", "Do inventories one line at a time: ", {"step", "Do inventories one line at a time: ",
(int *) &slow_invent, put_bool, get_bool }, (void *) &slow_invent, put_bool, get_bool },
{"askme", "Ask me about unidentified things: ", {"askme", "Ask me about unidentified things: ",
(int *) &askme, put_bool, get_bool }, (void *) &askme, put_bool, get_bool },
{"pickup", "Pick things up automatically: ", {"pickup", "Pick things up automatically: ",
(int *) &auto_pickup, put_bool, get_bool }, (void *) &auto_pickup, put_bool, get_bool },
{"overlay", "Overlay menu: ", {"overlay", "Overlay menu: ",
(int *) &menu_overlay, put_bool, get_bool }, (void *) &menu_overlay, put_bool, get_bool },
{"name", "Name: ", {"name", "Name: ",
(int *) whoami, put_str, get_str_prot }, (void *) whoami, put_str, get_str_prot },
{"file", "Save file: ", {"file", "Save file: ",
(int *) file_name, put_str, get_str_prot }, (void *) file_name, put_str, get_str_prot },
{"score", "Score file: ", {"score", "Score file: ",
(int *) score_file, put_str, get_score }, (void *) score_file, put_str, get_score },
{"class", "Character class: ", {"class", "Character class: ",
(int *)&char_type, put_abil, get_abil }, (void *)&char_type, put_abil, get_abil },
{"quest", "Quest item: ", {"quest", "Quest item: ",
(int *) &quest_item, put_quest, get_quest } (void *) &quest_item, put_quest, get_quest }
}; };
/* /*
* The ability field is read-only * The ability field is read-only
*/ */
void int
get_abil(int *abil, WINDOW *win) get_abil(int *abil, WINDOW *win)
{ {
register int oy, ox; register int oy, ox;
getyx(win, oy, ox); getyx(win, oy, ox);
put_abil(abil, win); put_abil(abil, win);
get_ro(win, oy, ox); return get_ro(win, oy, ox);
} }
/* /*
* The quest field is read-only * The quest field is read-only
*/ */
void int
get_quest(int *quest, WINDOW *win) get_quest(int *quest, WINDOW *win)
{ {
register int oy, ox; register int oy, ox;
getyx(win, oy, ox); getyx(win, oy, ox);
waddstr(win, rel_magic[*quest].mi_name); waddstr(win, rel_magic[*quest].mi_name);
get_ro(win, oy, ox); return get_ro(win, oy, ox);
} }
/* /*
@ -387,14 +387,15 @@ parse_opts(char *str)
strcpy((char *)op->o_opt, (char *)value); strcpy((char *)op->o_opt, (char *)value);
} }
else if (*op->o_opt == -1) { /* Only init ability once */ else if (*(int *)op->o_opt == -1) {
/* Only init ability once */
register int len = strlen(value); register int len = strlen(value);
register int i; register int i;
if (isupper(value[0])) value[0] = tolower(value[0]); if (isupper(value[0])) value[0] = tolower(value[0]);
for (i=0; i<NUM_CHARTYPES-1; i++) { for (i=0; i<NUM_CHARTYPES-1; i++) {
if (EQSTR(value, char_class[i].name, len)) { if (EQSTR(value, char_class[i].name, len)) {
*op->o_opt = i; *(int *)op->o_opt = i;
break; break;
} }
} }

View file

@ -249,12 +249,13 @@ picked_up:
/* Relics can do strange things when you pick them up */ /* Relics can do strange things when you pick them up */
if (obj->o_type == RELIC) { if (obj->o_type == RELIC) {
int newclass;
switch (obj->o_which) { switch (obj->o_which) {
/* the ankh of Heil gives you prayers */ /* the ankh of Heil gives you prayers */
case HEIL_ANKH: case HEIL_ANKH:
msg("The ankh welds itself into your hand."); msg("The ankh welds itself into your hand.");
if (player.t_ctype != C_CLERIC && player.t_ctype != C_PALADIN) if (player.t_ctype != C_CLERIC && player.t_ctype != C_PALADIN)
fuse(prayer_recovery, 0, SPELLTIME, AFTER); fuse(prayer_recovery, NULL, SPELLTIME, AFTER);
/* A cloak must be worn. */ /* A cloak must be worn. */
when EMORI_CLOAK: when EMORI_CLOAK:
@ -306,7 +307,7 @@ picked_up:
msg("The excrutiating pain slowly turns into a dull throb."); msg("The excrutiating pain slowly turns into a dull throb.");
when QUILL_NAGROM: when QUILL_NAGROM:
fuse(quill_charge,0,player.t_ctype==C_MAGICIAN ? 4 : 8,AFTER); fuse(quill_charge,NULL,player.t_ctype==C_MAGICIAN ? 4 : 8,AFTER);
/* Weapons will insist on being wielded. */ /* Weapons will insist on being wielded. */
when MUSTY_DAGGER: when MUSTY_DAGGER:
@ -316,7 +317,8 @@ picked_up:
/* For the daggers start a fuse to change player to a thief. */ /* For the daggers start a fuse to change player to a thief. */
/* and set a daemon to eat gold. */ /* and set a daemon to eat gold. */
if (obj->o_which == MUSTY_DAGGER) { if (obj->o_which == MUSTY_DAGGER) {
fuse(changeclass, C_THIEF, roll(20, 20), AFTER); newclass = C_THIEF;
fuse(changeclass, &newclass, roll(20, 20), AFTER);
if (purse > 0) if (purse > 0)
msg("Your purse feels lighter"); msg("Your purse feels lighter");
else else
@ -326,7 +328,8 @@ picked_up:
} }
/* For the axe start a fuse to change player to a fighter. */ /* For the axe start a fuse to change player to a fighter. */
if (obj->o_which == AXE_AKLAD) if (obj->o_which == AXE_AKLAD)
fuse(changeclass, C_FIGHTER, roll(20, 20), AFTER); newclass = C_FIGHTER;
fuse(changeclass, &newclass, roll(20, 20), AFTER);
if (cur_weapon != NULL) { if (cur_weapon != NULL) {
msg("The artifact insists you release your current weapon."); msg("The artifact insists you release your current weapon.");
if (!dropcheck(cur_weapon)) { if (!dropcheck(cur_weapon)) {

View file

@ -150,7 +150,7 @@ add_haste(bool blessed)
else { else {
msg("You feel yourself moving %sfaster.", blessed ? "much " : ""); msg("You feel yourself moving %sfaster.", blessed ? "much " : "");
turn_on(player, ISHASTE); turn_on(player, ISHASTE);
fuse(nohaste, 0, roll(hasttime, hasttime), AFTER); fuse(nohaste, NULL, roll(hasttime, hasttime), AFTER);
} }
} }
@ -206,7 +206,7 @@ add_slow(void)
lengthen(noslow, roll(HASTETIME,HASTETIME)); lengthen(noslow, roll(HASTETIME,HASTETIME));
else { else {
turn_on(player, ISSLOW); turn_on(player, ISSLOW);
fuse(noslow, 0, roll(HASTETIME,HASTETIME), AFTER); fuse(noslow, NULL, roll(HASTETIME,HASTETIME), AFTER);
} }
} }
} }
@ -324,7 +324,7 @@ quaff(int which, int kind, int flags, bool is_potion)
} }
else { /* Just light a fuse for how long player is safe */ else { /* Just light a fuse for how long player is safe */
if (off(player, ISCLEAR)) { if (off(player, ISCLEAR)) {
fuse(unclrhead, 0, CLRDURATION, AFTER); fuse(unclrhead, NULL, CLRDURATION, AFTER);
msg("A faint blue aura surrounds your head."); msg("A faint blue aura surrounds your head.");
} }
else { /* If we have a fuse lengthen it, else we else { /* If we have a fuse lengthen it, else we
@ -491,7 +491,7 @@ quaff(int which, int kind, int flags, bool is_potion)
{ {
msg("A cloak of darkness falls around you."); msg("A cloak of darkness falls around you.");
turn_on(player, ISBLIND); turn_on(player, ISBLIND);
fuse(sight, 0, SEEDURATION, AFTER); fuse(sight, NULL, SEEDURATION, AFTER);
light(&hero); light(&hero);
} }
else else
@ -501,7 +501,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (off(player, CANSEE)) { if (off(player, CANSEE)) {
turn_on(player, CANSEE); turn_on(player, CANSEE);
msg("Your eyes begin to tingle."); msg("Your eyes begin to tingle.");
fuse(unsee, 0, blessed ? SEEDURATION*3 :SEEDURATION, AFTER); fuse(unsee, NULL, blessed ? SEEDURATION*3 :SEEDURATION, AFTER);
light(&hero); light(&hero);
} }
else if (find_slot(unsee) != 0) else if (find_slot(unsee) != 0)
@ -523,7 +523,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (on(player, CANINWALL)) if (on(player, CANINWALL))
lengthen(unphase, duration*PHASEDURATION); lengthen(unphase, duration*PHASEDURATION);
else { else {
fuse(unphase, 0, duration*PHASEDURATION, AFTER); fuse(unphase, NULL, duration*PHASEDURATION, AFTER);
turn_on(player, CANINWALL); turn_on(player, CANINWALL);
} }
msg("You feel %slight-headed!", msg("You feel %slight-headed!",
@ -547,7 +547,7 @@ quaff(int which, int kind, int flags, bool is_potion)
} }
} }
else { else {
fuse(land, 0, duration*FLYTIME, AFTER); fuse(land, NULL, duration*FLYTIME, AFTER);
turn_on(player, ISFLY); turn_on(player, ISFLY);
} }
if (say_message) { if (say_message) {
@ -610,7 +610,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (off(player, ISINVIS)) { if (off(player, ISINVIS)) {
turn_on(player, ISINVIS); turn_on(player, ISINVIS);
msg("You have a tingling feeling all over your body"); msg("You have a tingling feeling all over your body");
fuse(appear, 0, blessed ? GONETIME*3 : GONETIME, AFTER); fuse(appear, NULL, blessed ? GONETIME*3 : GONETIME, AFTER);
PLAYER = IPLAYER; PLAYER = IPLAYER;
light(&hero); light(&hero);
} }
@ -675,7 +675,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (!find_slot(unskill)) { /* No skill */ if (!find_slot(unskill)) { /* No skill */
pstats.s_lvladj = -2; pstats.s_lvladj = -2;
pstats.s_lvl += pstats.s_lvladj; pstats.s_lvl += pstats.s_lvladj;
fuse(unskill, 0, SKILLDURATION, AFTER); fuse(unskill, NULL, SKILLDURATION, AFTER);
} }
else { /* Has an artifical skill */ else { /* Has an artifical skill */
/* Is the skill beneficial? */ /* Is the skill beneficial? */
@ -714,7 +714,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (!find_slot(unskill)) { if (!find_slot(unskill)) {
pstats.s_lvladj = adjust; pstats.s_lvladj = adjust;
pstats.s_lvl += pstats.s_lvladj; pstats.s_lvl += pstats.s_lvladj;
fuse(unskill, 0, fuse(unskill, NULL,
blessed ? SKILLDURATION*2 : SKILLDURATION, AFTER); blessed ? SKILLDURATION*2 : SKILLDURATION, AFTER);
} }
else { /* Has an artifical skill */ else { /* Has an artifical skill */
@ -763,7 +763,7 @@ quaff(int which, int kind, int flags, bool is_potion)
} }
} }
else { else {
fuse(nofire, 0, duration*FIRETIME, AFTER); fuse(nofire, NULL, duration*FIRETIME, AFTER);
turn_on(player, NOFIRE); turn_on(player, NOFIRE);
} }
if (say_message) { if (say_message) {
@ -789,7 +789,7 @@ quaff(int which, int kind, int flags, bool is_potion)
} }
} }
else { else {
fuse(nocold, 0, duration*COLDTIME, AFTER); fuse(nocold, NULL, duration*COLDTIME, AFTER);
turn_on(player, NOCOLD); turn_on(player, NOCOLD);
} }
if (say_message) { if (say_message) {
@ -811,7 +811,7 @@ quaff(int which, int kind, int flags, bool is_potion)
lengthen(nobolt, duration*BOLTTIME); lengthen(nobolt, duration*BOLTTIME);
} }
else { else {
fuse(nobolt, 0, duration*BOLTTIME, AFTER); fuse(nobolt, NULL, duration*BOLTTIME, AFTER);
turn_on(player, NOBOLT); turn_on(player, NOBOLT);
} }
if (say_message) if (say_message)

View file

@ -90,9 +90,9 @@ ring_on(struct linked_list *item)
} }
} }
when R_SEARCH: when R_SEARCH:
start_daemon(ring_search, 0, AFTER); start_daemon(ring_search, NULL, AFTER);
when R_TELEPORT: when R_TELEPORT:
start_daemon(ring_teleport, 0, AFTER); start_daemon(ring_teleport, NULL, AFTER);
} }
status(FALSE); status(FALSE);
if (r_know[obj->o_which] && r_guess[obj->o_which]) if (r_know[obj->o_which] && r_guess[obj->o_which])

View file

@ -1113,7 +1113,7 @@ struct quill {
struct delayed_action { struct delayed_action {
int d_type; int d_type;
int (*d_func)(); void (*d_func)();
union { union {
int arg; int arg;
void *varg; void *varg;
@ -1212,18 +1212,18 @@ int encread(char *start, unsigned int size, int inf);
int encwrite(char *start, unsigned int size, int outf); int encwrite(char *start, unsigned int size, int outf);
void endmsg(void); void endmsg(void);
void explode(struct thing *tp); void explode(struct thing *tp);
void extinguish(int (*func)()); void extinguish(void (*func)());
void fall(struct linked_list *item, bool pr); void fall(struct linked_list *item, bool pr);
coord *fallpos(coord *pos, bool be_clear, int range); coord *fallpos(coord *pos, bool be_clear, int range);
void fatal(char *s); void fatal(char *s);
bool fight(coord *mp, struct object *weap, bool thrown); bool fight(coord *mp, struct object *weap, bool thrown);
struct linked_list *find_mons(int y, int x); struct linked_list *find_mons(int y, int x);
struct linked_list *find_obj(int y, int x); struct linked_list *find_obj(int y, int x);
struct delayed_action *find_slot(int (*func)()); struct delayed_action *find_slot(void (*func)());
int findmindex(char *name); int findmindex(char *name);
void fix_stick(struct object *cur); void fix_stick(struct object *cur);
void fumble(void); void fumble(void);
void fuse(int (*func)(), int arg, int time, int type); void fuse(void (*func)(), void *arg, int time, int type);
void genmonsters(int least, bool treas); void genmonsters(int least, bool treas);
coord get_coordinates(void); coord get_coordinates(void);
bool get_dir(coord *direction); bool get_dir(coord *direction);
@ -1256,11 +1256,11 @@ bool is_current(struct object *obj);
bool is_magic(struct object *obj); bool is_magic(struct object *obj);
bool isatrap(char ch); bool isatrap(char ch);
int itemweight(struct object *wh); int itemweight(struct object *wh);
void kill_daemon(int (*func)()); void kill_daemon(void (*func)());
void killed(struct linked_list *item, bool pr, bool points, bool treasure); void killed(struct linked_list *item, bool pr, bool points, bool treasure);
void lake_check(coord *place); void lake_check(coord *place);
void land(void); void land(void);
void lengthen(int (*func)(), int xtime); void lengthen(void (*func)(), int xtime);
void light(coord *cp); void light(coord *cp);
bool lit_room(struct room *rp); bool lit_room(struct room *rp);
void look(bool wakeup, bool runend); void look(bool wakeup, bool runend);
@ -1357,7 +1357,7 @@ bool skirmish(struct thing *attacker, coord *mp, struct object *weap,
bool thrown); bool thrown);
struct linked_list *spec_item(int type, int which, int hit, int damage); struct linked_list *spec_item(int type, int which, int hit, int damage);
void spell_recovery(void); void spell_recovery(void);
void start_daemon(int (*func)(), int arg, int type); void start_daemon(void (*func)(), void *arg, int type);
void status(bool display); void status(bool display);
void steal(void); void steal(void);
bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr); bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr);

View file

@ -1504,7 +1504,7 @@ rs_write_daemons(FILE *savef, struct delayed_action *d_list, int count)
func = 15; func = 15;
else if (d_list[i].d_func == unstink) else if (d_list[i].d_func == unstink)
func = 16; func = 16;
else if (d_list[i].d_func == (int (*)()) res_strength) else if (d_list[i].d_func == res_strength)
func = 17; func = 17;
else if (d_list[i].d_func == undance) else if (d_list[i].d_func == undance)
func = 18; func = 18;
@ -1644,7 +1644,7 @@ rs_read_daemons(int inf, struct delayed_action *d_list, int count)
break; break;
case 16: d_list[i].d_func = unstink; case 16: d_list[i].d_func = unstink;
break; break;
case 17: d_list[i].d_func = (int (*)()) res_strength; case 17: d_list[i].d_func = res_strength;
break; break;
case 18: d_list[i].d_func = undance; case 18: d_list[i].d_func = undance;
break; break;

View file

@ -590,7 +590,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
turn_on(player, HASDISEASE); turn_on(player, HASDISEASE);
turn_on(player, HASINFEST); turn_on(player, HASINFEST);
turn_on(player, DOROT); turn_on(player, DOROT);
fuse(cure_disease, 0, roll(HEALTIME,SICKTIME), AFTER); fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME), AFTER);
infest_dam++; infest_dam++;
} }
else msg("You fell momentarily sick"); else msg("You fell momentarily sick");
@ -1188,7 +1188,7 @@ at_hero: if (!save(VS_BREATH, &player,
rnd(20)+HUHDURATION); rnd(20)+HUHDURATION);
else { else {
turn_on(player, ISHUH); turn_on(player, ISHUH);
fuse(unconfuse, 0, fuse(unconfuse, NULL,
rnd(20)+HUHDURATION, AFTER); rnd(20)+HUHDURATION, AFTER);
msg( msg(
"The confusion gas has confused you."); "The confusion gas has confused you.");

View file

@ -209,7 +209,7 @@ confus_player(void)
if (find_slot(unconfuse)) if (find_slot(unconfuse))
lengthen(unconfuse, HUHDURATION); lengthen(unconfuse, HUHDURATION);
else else
fuse(unconfuse, 0, HUHDURATION, AFTER); fuse(unconfuse, NULL, HUHDURATION, AFTER);
turn_on(player, ISHUH); turn_on(player, ISHUH);
} }
else msg("You feel dizzy for a moment, but it quickly passes."); else msg("You feel dizzy for a moment, but it quickly passes.");

View file

@ -327,7 +327,7 @@ wear(void)
msg("Wearing %s", inv_name(obj,TRUE)); msg("Wearing %s", inv_name(obj,TRUE));
cur_misc[WEAR_GAUNTLET] = obj; cur_misc[WEAR_GAUNTLET] = obj;
if (obj->o_which == MM_FUMBLE) if (obj->o_which == MM_FUMBLE)
start_daemon(fumble, 0, AFTER); start_daemon(fumble, NULL, AFTER);
/* /*
* the jewel of attacks does an aggavate monster * the jewel of attacks does an aggavate monster
*/ */
@ -351,7 +351,7 @@ wear(void)
msg("Wearing %s",inv_name(obj,TRUE)); msg("Wearing %s",inv_name(obj,TRUE));
cur_misc[WEAR_NECKLACE] = obj; cur_misc[WEAR_NECKLACE] = obj;
msg("The necklace is beginning to strangle you!"); msg("The necklace is beginning to strangle you!");
start_daemon(strangle, 0, AFTER); start_daemon(strangle, NULL, AFTER);
otherwise: otherwise:
msg("What a strange item you have!"); msg("What a strange item you have!");
} }

View file

@ -48,7 +48,7 @@ d_slot(void)
* Find a particular slot in the table * Find a particular slot in the table
*/ */
struct delayed_action * struct delayed_action *
find_slot(int (*func)()) find_slot(void (*func)())
{ {
register int i; register int i;
register struct delayed_action *dev; register struct delayed_action *dev;
@ -64,7 +64,7 @@ find_slot(int (*func)())
* Start a daemon, takes a function. * Start a daemon, takes a function.
*/ */
void void
start_daemon(int (*func)(), int arg, int type) start_daemon(void (*func)(), int arg, int type)
{ {
register struct delayed_action *dev; register struct delayed_action *dev;
@ -80,7 +80,7 @@ start_daemon(int (*func)(), int arg, int type)
* Remove a daemon from the list * Remove a daemon from the list
*/ */
void void
kill_daemon(int (*func)()) kill_daemon(void (*func)())
{ {
register struct delayed_action *dev; register struct delayed_action *dev;
@ -118,7 +118,7 @@ do_daemons(int flag)
* Start a fuse to go off in a certain number of turns * Start a fuse to go off in a certain number of turns
*/ */
void void
fuse(int (*func)(), int arg, int time, int type) fuse(void (*func)(), int arg, int time, int type)
{ {
register struct delayed_action *wire; register struct delayed_action *wire;
@ -134,7 +134,7 @@ fuse(int (*func)(), int arg, int time, int type)
* Increase the time until a fuse goes off * Increase the time until a fuse goes off
*/ */
void void
lengthen(int (*func)(), int xtime) lengthen(void (*func)(), int xtime)
{ {
register struct delayed_action *wire; register struct delayed_action *wire;
@ -148,7 +148,7 @@ lengthen(int (*func)(), int xtime)
* Put out a fuse * Put out a fuse
*/ */
void void
extinguish(int (*func)()) extinguish(void (*func)())
{ {
register struct delayed_action *wire; register struct delayed_action *wire;

View file

@ -22,8 +22,8 @@ long e_levels[] = {
}; };
bool roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl); bool roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl);
void hit(char *er, char *ee); void hit(const char *er, const char *ee);
void miss(char *er, char *ee); void miss(const char *er, const char *ee);
int str_plus(str_t str); int str_plus(str_t str);
int add_dam(str_t str); int add_dam(str_t str);
void thunk(THING *weap, const char *mname); void thunk(THING *weap, const char *mname);
@ -446,7 +446,7 @@ roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl)
* The print name of a combatant * The print name of a combatant
*/ */
char * char *
prname(char *who, bool upper) prname(const char *who, bool upper)
{ {
static char tbuf[MAXSTR]; static char tbuf[MAXSTR];
@ -470,7 +470,7 @@ prname(char *who, bool upper)
* Print a message to indicate a succesful hit * Print a message to indicate a succesful hit
*/ */
void void
hit(char *er, char *ee) hit(const char *er, const char *ee)
{ {
register char *s = ""; register char *s = "";
@ -496,7 +496,7 @@ hit(char *er, char *ee)
* Print a message to indicate a poor swing * Print a message to indicate a poor swing
*/ */
void void
miss(char *er, char *ee) miss(const char *er, const char *ee)
{ {
register char *s = ""; register char *s = "";

View file

@ -345,7 +345,7 @@ aggravate(void)
* "an". * "an".
*/ */
char * char *
vowelstr(char *str) vowelstr(const char *str)
{ {
switch (*str) switch (*str)
{ {

View file

@ -27,8 +27,8 @@
struct optstruct { struct optstruct {
char *o_name; /* option name */ char *o_name; /* option name */
char *o_prompt; /* prompt for interactive entry */ char *o_prompt; /* prompt for interactive entry */
int *o_opt; /* pointer to thing to set */ void *o_opt; /* pointer to thing to set */
int (*o_putfunc)(); /* function to print value */ void (*o_putfunc)(); /* function to print value */
int (*o_getfunc)(); /* function to get value interactively */ int (*o_getfunc)(); /* function to get value interactively */
}; };
@ -43,23 +43,23 @@ int get_str(char *opt, WINDOW *win);
OPTION optlist[] = { OPTION optlist[] = {
{"terse", "Terse output: ", {"terse", "Terse output: ",
(int *) &terse, put_bool, get_bool }, (void *) &terse, put_bool, get_bool },
{"flush", "Flush typeahead during battle: ", {"flush", "Flush typeahead during battle: ",
(int *) &fight_flush, put_bool, get_bool }, (void *) &fight_flush, put_bool, get_bool },
{"jump", "Show position only at end of run: ", {"jump", "Show position only at end of run: ",
(int *) &jump, put_bool, get_bool }, (void *) &jump, put_bool, get_bool },
{"step", "Do inventories one line at a time: ", {"step", "Do inventories one line at a time: ",
(int *) &slow_invent, put_bool, get_bool }, (void *) &slow_invent, put_bool, get_bool },
{"askme", "Ask me about unidentified things: ", {"askme", "Ask me about unidentified things: ",
(int *) &askme, put_bool, get_bool }, (void *) &askme, put_bool, get_bool },
{"passgo", "Follow turnings in passageways: ", {"passgo", "Follow turnings in passageways: ",
(int *) &passgo, put_bool, get_bool }, (void *) &passgo, put_bool, get_bool },
{"name", "Name: ", {"name", "Name: ",
(int *) whoami, put_str, get_str }, (void *) whoami, put_str, get_str },
{"fruit", "Fruit: ", {"fruit", "Fruit: ",
(int *) fruit, put_str, get_str }, (void *) fruit, put_str, get_str },
{"file", "Save file: ", {"file", "Save file: ",
(int *) file_name, put_str, get_str } (void *) file_name, put_str, get_str }
}; };
/* /*

View file

@ -324,7 +324,7 @@ typedef struct {
struct delayed_action { struct delayed_action {
int d_type; int d_type;
int (*d_func)(); void (*d_func)();
int d_arg; int d_arg;
int d_time; int d_time;
}; };
@ -484,6 +484,7 @@ void _attach(THING **list, THING *item);
void _detach(THING **list, THING *item); void _detach(THING **list, THING *item);
void _free_list(THING **ptr); void _free_list(THING **ptr);
bool add_haste(bool potion); bool add_haste(bool potion);
void add_line(char *fmt, char *arg);
void add_pack(THING *obj, bool silent); void add_pack(THING *obj, bool silent);
void add_str(str_t *sp, int amt); void add_str(str_t *sp, int amt);
void addmsg(char *fmt, ...); void addmsg(char *fmt, ...);
@ -515,9 +516,10 @@ bool dropcheck(THING *op);
void eat(void); void eat(void);
int encread(void *starta, int size, int inf); int encread(void *starta, int size, int inf);
void encwrite(void *starta, int size, FILE *outf); void encwrite(void *starta, int size, FILE *outf);
void end_line(void);
void endmsg(void); void endmsg(void);
void enter_room(coord *cp); void enter_room(coord *cp);
void extinguish(int (*func)()); void extinguish(void (*func)());
void fall(THING *obj, bool pr); void fall(THING *obj, bool pr);
bool fallpos(coord *pos, coord *newpos, bool pass); bool fallpos(coord *pos, coord *newpos, bool pass);
void fatal(char *s); void fatal(char *s);
@ -526,7 +528,7 @@ THING *find_obj(int y, int x);
void fire_bolt(coord *start, coord *dir, char *name); void fire_bolt(coord *start, coord *dir, char *name);
void fix_stick(THING *cur); void fix_stick(THING *cur);
void flush_type(void); void flush_type(void);
void fuse(int (*func)(), int arg, int time, int type); void fuse(void (*func)(), int arg, int time, int type);
void genocide(void); void genocide(void);
bool get_dir(void); bool get_dir(void);
THING *get_item(char *purpose, int type); THING *get_item(char *purpose, int type);
@ -547,11 +549,11 @@ void invis_on(void);
bool is_current(THING *obj); bool is_current(THING *obj);
bool is_magic(THING *obj); bool is_magic(THING *obj);
bool issymlink(char *sp); bool issymlink(char *sp);
void kill_daemon(int (*func)()); void kill_daemon(void (*func)());
void killed(THING *tp, bool pr); void killed(THING *tp, bool pr);
void leave(int sig); void leave(int sig);
void leave_room(coord *cp); void leave_room(coord *cp);
void lengthen(int (*func)(), int xtime); void lengthen(void (*func)(), int xtime);
bool lock_sc(void); bool lock_sc(void);
void look(bool wakeup); void look(bool wakeup);
void missile(int ydelta, int xdelta); void missile(int ydelta, int xdelta);
@ -601,7 +603,7 @@ void shell(void);
void show_win(WINDOW *scr, char *message); void show_win(WINDOW *scr, char *message);
void sight(void); void sight(void);
int sign(int nm); int sign(int nm);
void start_daemon(int (*func)(), int arg, int type); void start_daemon(void (*func)(), int arg, int type);
void start_score(void); void start_score(void);
void status(void); void status(void);
bool step_ok(char ch); bool step_ok(char ch);
@ -619,7 +621,7 @@ void unconfuse(void);
char *unctrol(char ch); char *unctrol(char ch);
void unlock_sc(void); void unlock_sc(void);
void unsee(void); void unsee(void);
char *vowelstr(char *str); char *vowelstr(const char *str);
char *xcrypt(const char *key, const char *setting); char *xcrypt(const char *key, const char *setting);
void w_wait_for(WINDOW *win, char ch); void w_wait_for(WINDOW *win, char ch);
void wait_for(char ch); void wait_for(char ch);

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_write_int(FILE *savef, int c);
int rs_read_int(int inf, int *i);
int read_error = FALSE; int read_error = FALSE;
int write_error = FALSE; int write_error = FALSE;
int format_error = FALSE; int format_error = FALSE;
@ -1533,7 +1536,7 @@ rs_write_thing(FILE *savef, THING *t)
return(WRITESTAT); return(WRITESTAT);
} }
int void
rs_fix_thing(THING *t) rs_fix_thing(THING *t)
{ {
THING *item; THING *item;

View file

@ -438,11 +438,11 @@ discovered(void)
if (ch == '*') if (ch == '*')
{ {
print_disc(POTION); print_disc(POTION);
add_line(""); add_line("", NULL);
print_disc(SCROLL); print_disc(SCROLL);
add_line(""); add_line("", NULL);
print_disc(RING); print_disc(RING);
add_line(""); add_line("", NULL);
print_disc(STICK); print_disc(STICK);
end_line(); end_line();
} }
@ -505,7 +505,7 @@ print_disc(char type)
num_found++; num_found++;
} }
if (num_found == 0) if (num_found == 0)
add_line(nothing(type)); add_line(nothing(type), NULL);
} }
/* /*
@ -533,9 +533,8 @@ set_order(short *order, int numthings)
* add_line: * add_line:
* Add a line to the list of discoveries * Add a line to the list of discoveries
*/ */
/* VARARGS1 */ void
add_line(fmt, arg) add_line(char *fmt, char *arg)
char *fmt, *arg;
{ {
if (line_cnt == 0) if (line_cnt == 0)
{ {
@ -545,7 +544,7 @@ char *fmt, *arg;
} }
if (slow_invent) if (slow_invent)
{ {
if (*fmt != '\0') if (fmt != NULL && *fmt != '\0')
msg(fmt, arg); msg(fmt, arg);
line_cnt++; line_cnt++;
} }
@ -575,7 +574,8 @@ char *fmt, *arg;
* end_line: * end_line:
* End the list of lines * End the list of lines
*/ */
end_line() void
end_line(void)
{ {
if (!slow_invent) if (!slow_invent)
if (line_cnt == 1 && !newpage) if (line_cnt == 1 && !newpage)
@ -584,7 +584,7 @@ end_line()
msg(lastfmt, lastarg); msg(lastfmt, lastarg);
} }
else else
add_line(NULL); add_line(NULL, NULL);
line_cnt = 0; line_cnt = 0;
newpage = FALSE; newpage = FALSE;
} }

View file

@ -34,7 +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(int (*func)(), int arg, int type, int time) d_insert(void (*func)(), int arg, int type, int time)
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -72,7 +72,7 @@ d_delete(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(int (*func)()) find_slot(void (*func)())
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -87,7 +87,7 @@ find_slot(int (*func)())
* Start a daemon, takes a function. * Start a daemon, takes a function.
*/ */
void void
start_daemon(int (*func)(), int arg, int type) start_daemon(void (*func)(), int arg, int type)
{ {
d_insert(func, arg, type, DAEMON); d_insert(func, arg, type, DAEMON);
} }
@ -112,7 +112,7 @@ do_daemons(int flag)
* Start a fuse to go off in a certain number of turns * Start a fuse to go off in a certain number of turns
*/ */
void void
fuse(int (*func)(), int arg, int time) fuse(void (*func)(), int arg, int time)
{ {
d_insert(func, arg, AFTER, time); d_insert(func, arg, AFTER, time);
} }
@ -122,7 +122,7 @@ fuse(int (*func)(), int arg, int time)
* Increase the time until a fuse goes off * Increase the time until a fuse goes off
*/ */
void void
lengthen(int (*func)(), int xtime) lengthen(void (*func)(), int xtime)
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -136,7 +136,7 @@ lengthen(int (*func)(), int xtime)
* Put out a fuse. Find all such fuses and kill them. * Put out a fuse. Find all such fuses and kill them.
*/ */
void void
extinguish(int (*func)()) extinguish(void (*func)())
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;

View file

@ -96,7 +96,7 @@ int encread(void *starta, unsigned int size, int inf);
void encwrite(void *starta, unsigned int size, FILE *outf); void encwrite(void *starta, unsigned int size, FILE *outf);
void endit(int a); void endit(int a);
void endmsg(void); void endmsg(void);
void extinguish(int (*func)()); void extinguish(void (*func)());
int extras(void); int extras(void);
void fall(struct linked_list *item, bool pr); void fall(struct linked_list *item, bool pr);
bool fallpos(struct coord *pos, struct coord *newpos, bool passages); bool fallpos(struct coord *pos, struct coord *newpos, bool passages);
@ -105,7 +105,7 @@ bool fight(struct coord *mp, struct object *weap, bool thrown);
struct linked_list *find_mons(int y, int x); struct linked_list *find_mons(int y, int x);
struct linked_list *find_obj(int y, int x); struct linked_list *find_obj(int y, int x);
void fix_stick(struct object *cur); void fix_stick(struct object *cur);
void fuse(int (*func)(), int arg, int time); void fuse(void (*func)(), int arg, int time);
void game_err(int a); void game_err(int a);
void genocide(void); void genocide(void);
bool get_dir(void); bool get_dir(void);
@ -140,7 +140,7 @@ bool isatrap(char ch);
bool isring(int hand, int ring); bool isring(int hand, int ring);
bool iswearing(int ring); bool iswearing(int ring);
void killed(struct linked_list *item, bool pr); void killed(struct linked_list *item, bool pr);
void lengthen(int (*func)(), int xtime); void lengthen(void (*func)(), int xtime);
void lev_mon(void); void lev_mon(void);
void light(struct coord *cp); void light(struct coord *cp);
void look(bool wakeup); void look(bool wakeup);
@ -215,7 +215,7 @@ void setup(void);
char show(int y, int x); char show(int y, int x);
bool showtop(int showname); bool showtop(int showname);
void sight(int fromfuse); void sight(int fromfuse);
void start_daemon(int (*func)(), int arg, int type); void start_daemon(void (*func)(), int arg, int type);
void status(int fromfuse); void status(int fromfuse);
bool step_ok(unsigned char ch); bool step_ok(unsigned char ch);
void stomach(int fromfuse); void stomach(int fromfuse);

View file

@ -531,7 +531,7 @@ char *xcrypt(const char *key, const char *setting);
struct delayed_action { struct delayed_action {
int d_type; int d_type;
int (*d_func)(); void (*d_func)();
int d_arg; int d_arg;
int d_time; int d_time;
}; };
@ -565,7 +565,7 @@ struct monlev {
struct linked_list { struct linked_list {
struct linked_list *l_next; struct linked_list *l_next;
struct linked_list *l_prev; struct linked_list *l_prev;
char *l_data; /* Various structure pointers */ void *l_data; /* Various structure pointers */
}; };

View file

@ -341,7 +341,7 @@ at_hero: if (!save(VS_BREATH, &player,
rnd(20)+HUHDURATION); rnd(20)+HUHDURATION);
else { else {
turn_on(player, ISHUH); turn_on(player, ISHUH);
fuse(unconfuse, (VOID *)NULL, fuse(unconfuse, NULL,
rnd(20)+HUHDURATION, AFTER); rnd(20)+HUHDURATION, AFTER);
msg("The confusion gas has confused you."); msg("The confusion gas has confused you.");
} }

View file

@ -693,7 +693,7 @@ quit(int sig)
* Reset the signal in case we got here via an interrupt * Reset the signal in case we got here via an interrupt
*/ */
if ((VOID(*)())signal(SIGINT, quit) != (VOID(*)())quit) if (signal(SIGINT, quit) != quit)
mpos = 0; mpos = 0;
getyx(cw, oy, ox); getyx(cw, oy, ox);

View file

@ -74,7 +74,7 @@ f_slot(void)
*/ */
struct delayed_action * struct delayed_action *
find_slot(int (*func)()) find_slot(void (*func)())
{ {
reg int i; reg int i;
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -91,7 +91,7 @@ find_slot(int (*func)())
*/ */
void void
start_daemon(int (*dfunc)(), VOID *arg, int type) start_daemon(void (*dfunc)(), void *arg, int type)
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
@ -111,7 +111,7 @@ start_daemon(int (*dfunc)(), VOID *arg, int type)
*/ */
void void
kill_daemon(int (*dfunc)()) kill_daemon(void (*dfunc)())
{ {
reg struct delayed_action *dev; reg struct delayed_action *dev;
reg int i; reg int i;
@ -164,7 +164,7 @@ do_daemons(int flag)
*/ */
void void
fuse(int (*dfunc)(), VOID *arg, int time, int type) fuse(void (*dfunc)(), void *arg, int time, int type)
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -172,6 +172,9 @@ fuse(int (*dfunc)(), VOID *arg, int time, int type)
if (wire != NULL) { if (wire != NULL) {
wire->d_type = type; wire->d_type = type;
wire->d_func = dfunc; wire->d_func = dfunc;
if (dfunc == changeclass || dfunc == res_strength)
wire->d_arg.i = *(int *) arg;
else
wire->d_arg.vp = arg; wire->d_arg.vp = arg;
wire->d_time = time; wire->d_time = time;
fusecnt += 1; /* update count */ fusecnt += 1; /* update count */
@ -184,7 +187,7 @@ fuse(int (*dfunc)(), VOID *arg, int time, int type)
*/ */
void void
lengthen(int (*dfunc)(), int xtime) lengthen(void (*dfunc)(), int xtime)
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -199,7 +202,7 @@ lengthen(int (*dfunc)(), int xtime)
*/ */
void void
extinguish(int (*dfunc)()) extinguish(void (*dfunc)())
{ {
reg struct delayed_action *wire; reg struct delayed_action *wire;
@ -235,7 +238,9 @@ do_fuses(int flag)
if(flag == wire->d_type && wire->d_time > 0 && if(flag == wire->d_type && wire->d_time > 0 &&
--wire->d_time == 0) { --wire->d_time == 0) {
wire->d_type = EMPTY; wire->d_type = EMPTY;
if (wire->d_func != NULL) if (*wire->d_func == changeclass || *wire->d_func == res_strength)
(*wire->d_func)(wire->d_arg.i);
else if (wire->d_func != NULL)
(*wire->d_func)(wire->d_arg.vp); (*wire->d_func)(wire->d_arg.vp);
fusecnt -= 1; fusecnt -= 1;
} }

View file

@ -114,7 +114,7 @@ doctor(struct thing *tp)
void void
swander(void) swander(void)
{ {
start_daemon(rollwand, (VOID *)NULL, BEFORE); start_daemon(rollwand, NULL, BEFORE);
} }
/* /*
@ -137,7 +137,7 @@ rollwand(void)
if (levtype != POSTLEV) if (levtype != POSTLEV)
wanderer(); wanderer();
kill_daemon(rollwand); kill_daemon(rollwand);
fuse(swander, (VOID *)NULL, WANDERTIME, BEFORE); fuse(swander, NULL, WANDERTIME, BEFORE);
} }
between = 0; between = 0;
} }
@ -222,13 +222,12 @@ unphase(void)
* Player can no longer fly * Player can no longer fly
*/ */
int void
land(void) land(void)
{ {
turn_off(player, ISFLY); turn_off(player, ISFLY);
msg("You regain your normal weight"); msg("You regain your normal weight");
running = FALSE; running = FALSE;
return(0);
} }
/* /*
@ -253,7 +252,7 @@ sight(void)
* Restore player's strength * Restore player's strength
*/ */
int void
res_strength(long howmuch) res_strength(long howmuch)
{ {
@ -271,7 +270,6 @@ res_strength(long howmuch)
min(pstats.s_str + howmuch, max_stats.s_str + ring_value(R_ADDSTR)); min(pstats.s_str + howmuch, max_stats.s_str + ring_value(R_ADDSTR));
updpack(TRUE, &player); updpack(TRUE, &player);
return(0);
} }
/* /*
@ -507,12 +505,11 @@ alchemy(struct object *obj)
* otto's irresistable dance wears off * otto's irresistable dance wears off
*/ */
int void
undance(void) undance(void)
{ {
turn_off(player, ISDANCE); turn_off(player, ISDANCE);
msg ("Your feet take a break.....whew!"); msg ("Your feet take a break.....whew!");
return(0);
} }
/* /*
@ -615,7 +612,7 @@ quill_charge(void)
return; return;
if (tobj->o_charges < QUILLCHARGES) if (tobj->o_charges < QUILLCHARGES)
tobj->o_charges++; tobj->o_charges++;
fuse (quill_charge, (VOID *)NULL, player.t_ctype == C_MAGICIAN ? 4 : 8, AFTER); fuse (quill_charge, NULL, player.t_ctype == C_MAGICIAN ? 4 : 8, AFTER);
} }
/* /*
@ -637,12 +634,11 @@ unskill(void)
* charge up the cloak of Emori * charge up the cloak of Emori
*/ */
int void
cloak_charge(struct object *obj) cloak_charge(struct object *obj)
{ {
if (obj->o_charges < 1) if (obj->o_charges < 1)
obj->o_charges = 1; obj->o_charges = 1;
return(0);
} }
/* /*
@ -723,7 +719,7 @@ spell_recovery(void)
time = SPELLTIME - max(17-pstats.s_intel, 0); time = SPELLTIME - max(17-pstats.s_intel, 0);
time = max(time, 5); time = max(time, 5);
if (spell_power > 0) spell_power--; if (spell_power > 0) spell_power--;
fuse(spell_recovery, (VOID *)NULL, time, AFTER); fuse(spell_recovery, NULL, time, AFTER);
} }
/* /*
@ -738,7 +734,7 @@ prayer_recovery(void)
time = SPELLTIME - max(17-pstats.s_wisdom, 0); time = SPELLTIME - max(17-pstats.s_wisdom, 0);
time = max(time, 5); time = max(time, 5);
if (pray_time > 0) pray_time--; if (pray_time > 0) pray_time--;
fuse(prayer_recovery, (VOID *)NULL, time, AFTER); fuse(prayer_recovery, NULL, time, AFTER);
} }
/* /*
@ -753,6 +749,6 @@ chant_recovery(void)
time = SPELLTIME - max(17-pstats.s_wisdom, 0); time = SPELLTIME - max(17-pstats.s_wisdom, 0);
time = max(time, 5); time = max(time, 5);
if (chant_time > 0) chant_time--; if (chant_time > 0) chant_time--;
fuse(chant_recovery, (VOID *)NULL, time, AFTER); fuse(chant_recovery, NULL, time, AFTER);
} }

View file

@ -153,7 +153,7 @@ eat(void)
} }
else { else {
turn_on(player, HASDISEASE); turn_on(player, HASDISEASE);
fuse(cure_disease, (VOID *)NULL, roll(HEALTIME,SICKTIME),AFTER); fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME),AFTER);
msg("You become ill. "); msg("You become ill. ");
} }
} }

View file

@ -309,7 +309,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
if (on(player, HASSTINK)) lengthen(unstink, STINKTIME); if (on(player, HASSTINK)) lengthen(unstink, STINKTIME);
else { else {
turn_on(player, HASSTINK); turn_on(player, HASSTINK);
fuse(unstink, (VOID *)NULL, STINKTIME, AFTER); fuse(unstink, NULL, STINKTIME, AFTER);
} }
} }
} }
@ -323,8 +323,10 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
msg("You cringe at %s's chilling touch.", msg("You cringe at %s's chilling touch.",
prname(attname, FALSE)); prname(attname, FALSE));
chg_str(-1); chg_str(-1);
if (lost_str++ == 0) if (lost_str++ == 0) {
fuse(res_strength, (VOID *)NULL, CHILLTIME, AFTER); int temp_arg = 0;
fuse(res_strength, &temp_arg, CHILLTIME, AFTER);
}
else lengthen(res_strength, CHILLTIME); else lengthen(res_strength, CHILLTIME);
} }
} }
@ -359,7 +361,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
} }
else { else {
turn_on(*def, HASDISEASE); turn_on(*def, HASDISEASE);
fuse(cure_disease, (VOID *)NULL, roll(HEALTIME,SICKTIME), AFTER); fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME), AFTER);
msg(terse ? "You have been diseased!" msg(terse ? "You have been diseased!"
: "You have contracted an annoying disease!"); : "You have contracted an annoying disease!");
} }
@ -491,7 +493,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
turn_off(*att, CANDANCE); turn_off(*att, CANDANCE);
turn_on(*def, ISDANCE); turn_on(*def, ISDANCE);
msg("You begin to dance uncontrollably!"); msg("You begin to dance uncontrollably!");
fuse(undance, (VOID *)NULL, roll(2,4), AFTER); fuse(undance, NULL, roll(2,4), AFTER);
} }
/* /*
@ -504,7 +506,7 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
(find_slot(suffocate) == 0)) { (find_slot(suffocate) == 0)) {
turn_on(*att, DIDSUFFOCATE); turn_on(*att, DIDSUFFOCATE);
msg("%s is beginning to suffocate you!", prname(attname, TRUE)); msg("%s is beginning to suffocate you!", prname(attname, TRUE));
fuse(suffocate, (VOID *)NULL, roll(9,3), AFTER); fuse(suffocate, NULL, roll(9,3), AFTER);
} }
/* /*
@ -548,11 +550,12 @@ effect(struct thing *att, struct thing *def, struct object *weap, bool thrown,
else { else {
int odor_str = -(rnd(6)+1); int odor_str = -(rnd(6)+1);
int temp_arg2 = 0;
msg("You are overcome by a foul odor!"); msg("You are overcome by a foul odor!");
if (lost_str == 0) { if (lost_str == 0) {
chg_str(odor_str); chg_str(odor_str);
fuse(res_strength, (VOID *)NULL, SMELLTIME, AFTER); fuse(res_strength, &temp_arg2, SMELLTIME, AFTER);
lost_str -= odor_str; lost_str -= odor_str;
} }
else lengthen(res_strength, SMELLTIME); else lengthen(res_strength, SMELLTIME);

View file

@ -169,7 +169,7 @@ wghtchk(void)
ch = mvwinch(stdscr, hero.y, hero.x); ch = mvwinch(stdscr, hero.y, hero.x);
if((ch != FLOOR && ch != PASSAGE)) { if((ch != FLOOR && ch != PASSAGE)) {
extinguish(wghtchk); extinguish(wghtchk);
fuse(wghtchk, (VOID *)NULL, 1, AFTER); fuse(wghtchk, NULL, 1, AFTER);
inwhgt = FALSE; inwhgt = FALSE;
return; return;
} }

View file

@ -564,7 +564,7 @@ roll_em(struct thing *att_er, struct thing *def_er, struct object *weap,
if (find_slot(unconfuse)) if (find_slot(unconfuse))
lengthen(unconfuse, HUHDURATION); lengthen(unconfuse, HUHDURATION);
else else
fuse(unconfuse, (VOID *)NULL, HUHDURATION, AFTER); fuse(unconfuse, NULL, HUHDURATION, AFTER);
turn_on(player, ISHUH); turn_on(player, ISHUH);
} }
else msg("You feel dizzy, but it quickly passes."); else msg("You feel dizzy, but it quickly passes.");
@ -966,7 +966,6 @@ killed(struct linked_list *item, bool pr, bool points, bool treasure)
register struct linked_list *pitem, *nexti, *mitem; register struct linked_list *pitem, *nexti, *mitem;
char *monst; char *monst;
int adj; /* used for hit point adj. below. */ int adj; /* used for hit point adj. below. */
long temp;
tp = THINGPTR(item); tp = THINGPTR(item);
@ -1029,8 +1028,7 @@ killed(struct linked_list *item, bool pr, bool points, bool treasure)
if (roll(1,100) < killed_chance) { if (roll(1,100) < killed_chance) {
msg("You had a feeling this was going to happen... "); msg("You had a feeling this was going to happen... ");
msg("**POOF** "); msg("**POOF** ");
temp = C_ASSASSIN; /* make him pay */ changeclass(C_ASSASSIN); /* make him pay */
changeclass(&temp);
} }
else { else {
switch (rnd(9)) { switch (rnd(9)) {

View file

@ -244,19 +244,19 @@ main(int argc, char *argv[], char *envp[])
* Start up daemons and fuses * Start up daemons and fuses
*/ */
start_daemon(doctor, &player, AFTER); start_daemon(doctor, &player, AFTER);
fuse(swander, (VOID *)NULL, WANDERTIME, AFTER); fuse(swander, NULL, WANDERTIME, AFTER);
/* Give characters their innate abilities */ /* Give characters their innate abilities */
if (player.t_ctype == C_MAGICIAN || player.t_ctype == C_RANGER) if (player.t_ctype == C_MAGICIAN || player.t_ctype == C_RANGER)
fuse(spell_recovery, (VOID *)NULL, SPELLTIME, AFTER); fuse(spell_recovery, NULL, SPELLTIME, AFTER);
if (player.t_ctype == C_DRUID || player.t_ctype == C_MONK) if (player.t_ctype == C_DRUID || player.t_ctype == C_MONK)
fuse(chant_recovery, (VOID *)NULL, SPELLTIME, AFTER); fuse(chant_recovery, NULL, SPELLTIME, AFTER);
if (player.t_ctype == C_CLERIC || player.t_ctype == C_PALADIN) if (player.t_ctype == C_CLERIC || player.t_ctype == C_PALADIN)
fuse(prayer_recovery, (VOID *)NULL, SPELLTIME, AFTER); fuse(prayer_recovery, NULL, SPELLTIME, AFTER);
start_daemon(stomach, (VOID *)NULL, AFTER); start_daemon(stomach, NULL, AFTER);
if (player.t_ctype == C_THIEF || if (player.t_ctype == C_THIEF ||
player.t_ctype == C_ASSASSIN || player.t_ctype == C_ASSASSIN ||
player.t_ctype == C_MONK) player.t_ctype == C_MONK)
start_daemon(trap_look, (VOID *)NULL, AFTER); start_daemon(trap_look, NULL, AFTER);
/* Does this character have any special knowledge? */ /* Does this character have any special knowledge? */
switch (player.t_ctype) { switch (player.t_ctype) {

View file

@ -24,9 +24,9 @@
*/ */
void void
changeclass(long *newclass) changeclass(int newclass)
{ {
if (*newclass == player.t_ctype) { if (newclass == player.t_ctype) {
msg("You feel more skillful."); msg("You feel more skillful.");
raise_level(); raise_level();
} }
@ -38,19 +38,19 @@ changeclass(long *newclass)
*/ */
long save; long save;
msg("You are transformed into a %s! ", char_class[*newclass].name); msg("You are transformed into a %s! ", char_class[newclass].name);
/* /*
* if he becomes a thief or an assassin give him studded leather armor * if he becomes a thief or an assassin give him studded leather armor
*/ */
if ((*newclass == C_THIEF || *newclass == C_ASSASSIN) && if ((newclass == C_THIEF || newclass == C_ASSASSIN) &&
cur_armor != NULL && cur_armor->o_which != STUDDED_LEATHER) cur_armor != NULL && cur_armor->o_which != STUDDED_LEATHER)
cur_armor->o_which = STUDDED_LEATHER; cur_armor->o_which = STUDDED_LEATHER;
/* /*
* if he becomes a monk he can't wear any armor * if he becomes a monk he can't wear any armor
* so give him a cloak of protection * so give him a cloak of protection
*/ */
if (*newclass == C_MONK && cur_armor != NULL) { if (newclass == C_MONK && cur_armor != NULL) {
cur_armor->o_ac = armors[cur_armor->o_which].a_class - cur_armor->o_ac = armors[cur_armor->o_which].a_class -
cur_armor->o_ac; cur_armor->o_ac;
cur_armor->o_type = MM; cur_armor->o_type = MM;
@ -62,8 +62,8 @@ changeclass(long *newclass)
/* /*
* otherwise give him plate armor * otherwise give him plate armor
*/ */
if ((*newclass != C_THIEF || if ((newclass != C_THIEF ||
*newclass != C_ASSASSIN || *newclass != C_MONK) && newclass != C_ASSASSIN || newclass != C_MONK) &&
cur_armor != NULL && cur_armor->o_which != PLATE_ARMOR) cur_armor != NULL && cur_armor->o_which != PLATE_ARMOR)
cur_armor->o_which = PLATE_ARMOR; cur_armor->o_which = PLATE_ARMOR;
@ -81,12 +81,12 @@ changeclass(long *newclass)
/* /*
* if he becomes a spell caster of some kind, give him a fuse * if he becomes a spell caster of some kind, give him a fuse
*/ */
if (*newclass == C_MAGICIAN || *newclass == C_RANGER) if (newclass == C_MAGICIAN || newclass == C_RANGER)
fuse(spell_recovery, (VOID *)NULL, SPELLTIME, AFTER); fuse(spell_recovery, NULL, SPELLTIME, AFTER);
if (*newclass == C_DRUID || *newclass == C_MONK) if (newclass == C_DRUID || newclass == C_MONK)
fuse(chant_recovery, (VOID *)NULL, SPELLTIME, AFTER); fuse(chant_recovery, NULL, SPELLTIME, AFTER);
if ((*newclass==C_CLERIC || *newclass==C_PALADIN) && !cur_misc[HEIL_ANKH]) if ((newclass==C_CLERIC || newclass==C_PALADIN) && !cur_misc[HEIL_ANKH])
fuse(prayer_recovery, (VOID *)NULL, SPELLTIME, AFTER); fuse(prayer_recovery, NULL, SPELLTIME, AFTER);
/* /*
* if he's changing from a fighter, ranger, or paladin then we * if he's changing from a fighter, ranger, or paladin then we
* may have to change his sword since only these types can wield * may have to change his sword since only these types can wield
@ -98,8 +98,8 @@ changeclass(long *newclass)
cur_weapon != NULL && cur_weapon->o_type == WEAPON && cur_weapon != NULL && cur_weapon->o_type == WEAPON &&
(cur_weapon->o_which == BASWORD || (cur_weapon->o_which == BASWORD ||
cur_weapon->o_which == TWOSWORD) && cur_weapon->o_which == TWOSWORD) &&
!(*newclass == C_FIGHTER || *newclass == C_RANGER || !(newclass == C_FIGHTER || newclass == C_RANGER ||
*newclass == C_PALADIN) && newclass == C_PALADIN) &&
cur_weapon->o_which == TWOSWORD) cur_weapon->o_which == TWOSWORD)
cur_weapon->o_which = SWORD; cur_weapon->o_which = SWORD;
@ -113,8 +113,8 @@ changeclass(long *newclass)
cur_weapon != NULL && cur_weapon->o_type == WEAPON && cur_weapon != NULL && cur_weapon->o_type == WEAPON &&
(cur_weapon->o_which == BASWORD || (cur_weapon->o_which == BASWORD ||
cur_weapon->o_which == TWOSWORD) && cur_weapon->o_which == TWOSWORD) &&
!(*newclass == C_THIEF || *newclass == C_ASSASSIN || !(newclass == C_THIEF || newclass == C_ASSASSIN ||
*newclass == C_MONK) && newclass == C_MONK) &&
cur_weapon->o_which == BASWORD) cur_weapon->o_which == BASWORD)
cur_weapon->o_which = SWORD; cur_weapon->o_which = SWORD;
@ -130,12 +130,12 @@ changeclass(long *newclass)
* if he becomes a thief, assassin, or monk then add * if he becomes a thief, assassin, or monk then add
* the trap_look() daemon * the trap_look() daemon
*/ */
if (*newclass == C_THIEF || *newclass == C_ASSASSIN || if (newclass == C_THIEF || newclass == C_ASSASSIN ||
*newclass == C_MONK) newclass == C_MONK)
start_daemon(trap_look, (VOID *)NULL, AFTER); start_daemon(trap_look, NULL, AFTER);
/* adjust stats */ /* adjust stats */
char_type = player.t_ctype = *newclass; char_type = player.t_ctype = newclass;
save = pstats.s_hpt; save = pstats.s_hpt;
max_stats.s_hpt = pstats.s_hpt = 0; max_stats.s_hpt = pstats.s_hpt = 0;
max_stats.s_lvl = pstats.s_lvl = 0; max_stats.s_lvl = pstats.s_lvl = 0;
@ -1029,7 +1029,7 @@ use_mm(int which)
else msg("Ahh.. Ahh... Choo!! "); else msg("Ahh.. Ahh... Choo!! ");
if (!find_slot(dust_appear)) { if (!find_slot(dust_appear)) {
turn_on(player, ISINVIS); turn_on(player, ISINVIS);
fuse(dust_appear, (VOID *)NULL, DUSTTIME, AFTER); fuse(dust_appear, NULL, DUSTTIME, AFTER);
PLAYER = IPLAYER; PLAYER = IPLAYER;
light(&hero); light(&hero);
} }
@ -1059,7 +1059,7 @@ use_mm(int which)
if (find_slot(unchoke)) if (find_slot(unchoke))
lengthen(unchoke, DUSTTIME); lengthen(unchoke, DUSTTIME);
else else
fuse(unchoke, (VOID *)NULL, DUSTTIME, AFTER); fuse(unchoke, NULL, DUSTTIME, AFTER);
turn_on(player, ISHUH); turn_on(player, ISHUH);
turn_on(player, ISBLIND); turn_on(player, ISBLIND);
light(&hero); light(&hero);
@ -1103,7 +1103,7 @@ use_mm(int which)
when MM_SKILLS: when MM_SKILLS:
detach (pack, item); detach (pack, item);
inpack--; inpack--;
changeclass(&obj->o_ac); changeclass(obj->o_ac);
when MM_CRYSTAL: when MM_CRYSTAL:
{ {
register char *str; register char *str;

View file

@ -685,7 +685,7 @@ wake_monster(int y, int x)
if (find_slot(unconfuse)) if (find_slot(unconfuse))
lengthen(unconfuse, HUHDURATION); lengthen(unconfuse, HUHDURATION);
else { else {
fuse(unconfuse, (VOID *)NULL, HUHDURATION, AFTER); fuse(unconfuse, NULL, HUHDURATION, AFTER);
msg("%s's gaze has confused you.",prname(mname, TRUE)); msg("%s's gaze has confused you.",prname(mname, TRUE));
turn_on(player, ISHUH); turn_on(player, ISHUH);
} }
@ -727,7 +727,7 @@ wake_monster(int y, int x)
if (!save(VS_WAND, &player, 0)) { if (!save(VS_WAND, &player, 0)) {
msg("The gaze of %s blinds you! ", prname(mname, FALSE)); msg("The gaze of %s blinds you! ", prname(mname, FALSE));
turn_on(player, ISBLIND); turn_on(player, ISBLIND);
fuse(sight, (VOID *)NULL, rnd(30)+20, AFTER); fuse(sight, NULL, rnd(30)+20, AFTER);
light(&hero); light(&hero);
} }
} }

View file

@ -34,8 +34,8 @@
struct optstruct { struct optstruct {
char *o_name; /* option name */ char *o_name; /* option name */
char *o_prompt; /* prompt for interactive entry */ char *o_prompt; /* prompt for interactive entry */
int *o_opt; /* pointer to thing to set */ void *o_opt; /* pointer to thing to set */
int (*o_putfunc)(); /* function to print value */ void (*o_putfunc)(); /* function to print value */
int (*o_getfunc)(); /* function to get value interactively */ int (*o_getfunc)(); /* function to get value interactively */
}; };
@ -47,83 +47,83 @@ int get_bool(bool *bp, WINDOW *win);
void put_str(char *str, WINDOW *win); void put_str(char *str, WINDOW *win);
int get_str(char *opt, WINDOW *win); int get_str(char *opt, WINDOW *win);
void put_abil(int *ability, WINDOW *win); void put_abil(int *ability, WINDOW *win);
void get_abil(int *abil, WINDOW *win); int get_abil(int *abil, WINDOW *win);
void put_quest(int *quest, WINDOW *win); void put_quest(int *quest, WINDOW *win);
void get_quest(int *quest, WINDOW *win); int get_quest(int *quest, WINDOW *win);
void get_default(bool *bp, WINDOW *win); int get_default(bool *bp, WINDOW *win);
int get_str_prot(char *opt, WINDOW *win); int get_str_prot(char *opt, WINDOW *win);
int get_score(char *opt, WINDOW *win); int get_score(char *opt, WINDOW *win);
bool allowchange(OPTION *op); bool allowchange(OPTION *op);
OPTION optlist[] = { OPTION optlist[] = {
{"terse", "Terse output: ", {"terse", "Terse output: ",
(int *) &terse, put_bool, get_bool }, (void *) &terse, put_bool, get_bool },
{"flush", "Flush typeahead during battle: ", {"flush", "Flush typeahead during battle: ",
(int *) &fight_flush, put_bool, get_bool }, (void *) &fight_flush, put_bool, get_bool },
{"jump", "Show position only at end of run: ", {"jump", "Show position only at end of run: ",
(int *) &jump, put_bool, get_bool }, (void *) &jump, put_bool, get_bool },
{"step", "Do inventories one line at a time: ", {"step", "Do inventories one line at a time: ",
(int *) &slow_invent, put_bool, get_bool }, (void *) &slow_invent, put_bool, get_bool },
{"askme", "Ask me about unidentified things: ", {"askme", "Ask me about unidentified things: ",
(int *) &askme, put_bool, get_bool }, (void *) &askme, put_bool, get_bool },
{"pickup", "Pick things up automatically: ", {"pickup", "Pick things up automatically: ",
(int *) &auto_pickup, put_bool, get_bool }, (void *) &auto_pickup, put_bool, get_bool },
{"overlay", "Overlay menu: ", {"overlay", "Overlay menu: ",
(int *) &menu_overlay, put_bool, get_bool }, (void *) &menu_overlay, put_bool, get_bool },
{"name", "Name: ", {"name", "Name: ",
(int *) whoami, put_str, get_str_prot }, (void *) whoami, put_str, get_str_prot },
{"file", "Save file: ", {"file", "Save file: ",
(int *) file_name, put_str, get_str_prot }, (void *) file_name, put_str, get_str_prot },
{"score", "Score file: ", {"score", "Score file: ",
(int *) score_file, put_str, get_score }, (void *) score_file, put_str, get_score },
{"class", "Character type: ", {"class", "Character type: ",
(int *) &char_type, put_abil, get_abil }, (void *) &char_type, put_abil, get_abil },
{"quest", "Quest item: ", {"quest", "Quest item: ",
(int *) &quest_item, put_quest, get_quest }, (void *) &quest_item, put_quest, get_quest },
{"default", "Default Attributes: ", {"default", "Default Attributes: ",
(int *) &def_attr, put_bool, get_default } (void *) &def_attr, put_bool, get_default }
}; };
/* /*
* The default attribute field is read-only * The default attribute field is read-only
*/ */
void int
get_default(bool *bp, WINDOW *win) get_default(bool *bp, WINDOW *win)
{ {
register int oy, ox; register int oy, ox;
getyx(win, oy, ox); getyx(win, oy, ox);
put_bool(bp, win); put_bool(bp, win);
get_ro(win, oy, ox); return get_ro(win, oy, ox);
} }
/* /*
* The ability (class) field is read-only * The ability (class) field is read-only
*/ */
void int
get_abil(int *abil, WINDOW *win) get_abil(int *abil, WINDOW *win)
{ {
register int oy, ox; register int oy, ox;
getyx(win, oy, ox); getyx(win, oy, ox);
put_abil(abil, win); put_abil(abil, win);
get_ro(win, oy, ox); return get_ro(win, oy, ox);
} }
/* /*
* The quest field is read-only * The quest field is read-only
*/ */
void int
get_quest(int *quest, WINDOW *win) get_quest(int *quest, WINDOW *win)
{ {
register int oy, ox; register int oy, ox;
getyx(win, oy, ox); getyx(win, oy, ox);
waddstr(win, rel_magic[*quest].mi_name); waddstr(win, rel_magic[*quest].mi_name);
get_ro(win, oy, ox); return get_ro(win, oy, ox);
} }
/* /*
@ -411,13 +411,14 @@ parse_opts(char *str)
strcpy((char *)op->o_opt, value); strcpy((char *)op->o_opt, value);
} }
else if (*op->o_opt == -1) { /* Only init ability once */ else if (*(int *)op->o_opt == -1) {
/* Only init ability once */
register int len = strlen(value); register int len = strlen(value);
register int i; register int i;
for (i=0; i<NUM_CHARTYPES-1; i++) { for (i=0; i<NUM_CHARTYPES-1; i++) {
if (EQSTR(value, char_class[i].name, len)) { if (EQSTR(value, char_class[i].name, len)) {
*op->o_opt = i; *(int *)op->o_opt = i;
break; break;
} }
} }

View file

@ -36,15 +36,7 @@ add_pack(struct linked_list *item, bool silent)
register struct object *obj, *op = NULL; register struct object *obj, *op = NULL;
register bool exact, from_floor; register bool exact, from_floor;
bool giveflag = 0; bool giveflag = 0;
static long cleric = C_CLERIC, int newclass;
monk = C_MONK,
magician = C_MAGICIAN,
assassin = C_ASSASSIN,
druid = C_DRUID,
thief = C_THIEF,
fighter = C_FIGHTER,
ranger = C_RANGER,
paladin = C_PALADIN;
if (item == NULL) if (item == NULL)
{ {
@ -259,12 +251,14 @@ picked_up:
case HEIL_ANKH: case HEIL_ANKH:
msg("The ankh welds itself into your hand. "); msg("The ankh welds itself into your hand. ");
if (player.t_ctype != C_CLERIC && player.t_ctype != C_PALADIN) if (player.t_ctype != C_CLERIC && player.t_ctype != C_PALADIN)
fuse(prayer_recovery, (VOID *)NULL, SPELLTIME, AFTER); fuse(prayer_recovery, NULL, SPELLTIME, AFTER);
/* start a fuse to change player into a paladin */ /* start a fuse to change player into a paladin */
if (quest_item != HEIL_ANKH) { if (quest_item != HEIL_ANKH) {
msg("You hear a strange, distant hypnotic calling... "); msg("You hear a strange, distant hypnotic calling... ");
if (player.t_ctype != C_PALADIN && obj->o_which ==HEIL_ANKH) if (player.t_ctype != C_PALADIN && obj->o_which ==HEIL_ANKH) {
fuse(changeclass, &paladin, roll(8, 8), AFTER); newclass = C_PALADIN;
fuse(changeclass, &newclass, roll(8, 8), AFTER);
}
} }
/* A cloak must be worn. */ /* A cloak must be worn. */
@ -287,8 +281,10 @@ picked_up:
/* start a fuse to change player into a monk */ /* start a fuse to change player into a monk */
if (quest_item != EMORI_CLOAK) { if (quest_item != EMORI_CLOAK) {
msg("You suddenly become calm and quiet. "); msg("You suddenly become calm and quiet. ");
if (player.t_ctype != C_MONK && obj->o_which == EMORI_CLOAK) if (player.t_ctype != C_MONK && obj->o_which == EMORI_CLOAK) {
fuse(changeclass, &monk, roll(8, 8), AFTER); newclass = C_MONK;
fuse(changeclass, &newclass, roll(8, 8), AFTER);
}
} }
/* The amulet must be worn. */ /* The amulet must be worn. */
@ -312,7 +308,8 @@ picked_up:
if (player.t_ctype != C_MAGICIAN && if (player.t_ctype != C_MAGICIAN &&
obj->o_which == STONEBONES_AMULET) { obj->o_which == STONEBONES_AMULET) {
msg("You sense approaching etheric forces... "); msg("You sense approaching etheric forces... ");
fuse(changeclass, &magician, roll(8, 8), AFTER); newclass = C_MAGICIAN;
fuse(changeclass, &newclass, roll(8, 8), AFTER);
} }
} }
@ -331,17 +328,21 @@ picked_up:
/* start a fuse to change player into an assassin */ /* start a fuse to change player into an assassin */
if (quest_item != EYE_VECNA) { if (quest_item != EYE_VECNA) {
msg("Your blood rushes and you begin to sweat profusely... "); msg("Your blood rushes and you begin to sweat profusely... ");
if (player.t_ctype != C_ASSASSIN && obj->o_which == EYE_VECNA) if (player.t_ctype != C_ASSASSIN && obj->o_which == EYE_VECNA) {
fuse(changeclass, &assassin, roll(8, 8), AFTER); newclass = C_ASSASSIN;
fuse(changeclass, &newclass, roll(8, 8), AFTER);
}
} }
when QUILL_NAGROM: when QUILL_NAGROM:
fuse(quill_charge,(VOID *)NULL, 8, AFTER); fuse(quill_charge, NULL, 8, AFTER);
/* start a fuse to change player into a druid */ /* start a fuse to change player into a druid */
if (quest_item != QUILL_NAGROM) { if (quest_item != QUILL_NAGROM) {
msg("You begin to see things differently... "); msg("You begin to see things differently... ");
if (player.t_ctype != C_DRUID && obj->o_which == QUILL_NAGROM) if (player.t_ctype != C_DRUID && obj->o_which == QUILL_NAGROM) {
fuse(changeclass, &druid, roll(8, 8), AFTER); newclass = C_DRUID;
fuse(changeclass, &newclass, roll(8, 8), AFTER);
}
} }
/* Weapons will insist on being wielded. */ /* Weapons will insist on being wielded. */
@ -362,7 +363,8 @@ picked_up:
if (player.t_ctype != C_THIEF && if (player.t_ctype != C_THIEF &&
obj->o_which == MUSTY_DAGGER) { obj->o_which == MUSTY_DAGGER) {
msg("You look about furtively. "); msg("You look about furtively. ");
fuse(changeclass, &thief, roll(8, 8), AFTER); newclass = C_THIEF;
fuse(changeclass, &newclass, roll(8, 8), AFTER);
} }
} }
/* start a fuse to change player into a fighter */ /* start a fuse to change player into a fighter */
@ -370,7 +372,8 @@ picked_up:
if (player.t_ctype != C_FIGHTER && if (player.t_ctype != C_FIGHTER &&
obj->o_which == AXE_AKLAD) { obj->o_which == AXE_AKLAD) {
msg("Your bones feel strengthened. "); msg("Your bones feel strengthened. ");
fuse(changeclass, &fighter, roll(8, 8), AFTER); newclass = C_FIGHTER;
fuse(changeclass, &newclass, roll(8, 8), AFTER);
} }
} }
if (cur_weapon != NULL) { if (cur_weapon != NULL) {
@ -405,8 +408,10 @@ picked_up:
/* start a fuse to change player into a ranger */ /* start a fuse to change player into a ranger */
if (quest_item != BRIAN_MANDOLIN) { if (quest_item != BRIAN_MANDOLIN) {
msg("You are transfixed with empathy. "); msg("You are transfixed with empathy. ");
if (player.t_ctype != C_RANGER && obj->o_which == BRIAN_MANDOLIN) if (player.t_ctype != C_RANGER && obj->o_which == BRIAN_MANDOLIN) {
fuse(changeclass, &ranger, roll(8, 8), AFTER); newclass = C_RANGER;
fuse(changeclass, &newclass, roll(8, 8), AFTER);
}
} }
/* add to the music */ /* add to the music */
@ -415,8 +420,10 @@ picked_up:
/* start a fuse to change player into a cleric */ /* start a fuse to change player into a cleric */
if (quest_item != GERYON_HORN) { if (quest_item != GERYON_HORN) {
msg("You follow their calling. "); msg("You follow their calling. ");
if (player.t_ctype != C_CLERIC && obj->o_which == GERYON_HORN) if (player.t_ctype != C_CLERIC && obj->o_which == GERYON_HORN) {
fuse(changeclass, &cleric, roll(8, 8), AFTER); newclass = C_CLERIC;
fuse(changeclass, &newclass, roll(8, 8), AFTER);
}
} }
/* the card can not be picked up, it must be traded for */ /* the card can not be picked up, it must be traded for */

View file

@ -510,7 +510,7 @@ give(struct thing *th)
/* just let him roam around */ /* just let him roam around */
turn_on(*th, ISRUN); turn_on(*th, ISRUN);
if (on(*th, ISFLEE)) turn_off(*th, ISFLEE); if (on(*th, ISFLEE)) turn_off(*th, ISFLEE);
runto(th, &player); runto(th, &hero);
th->t_action = A_NIL; th->t_action = A_NIL;
return; return;
} }
@ -537,7 +537,7 @@ give(struct thing *th)
turn_on(*th, ISRUN); turn_on(*th, ISRUN);
if (on(*th, ISFLEE)) if (on(*th, ISFLEE))
turn_off(*th, ISFLEE); turn_off(*th, ISFLEE);
runto(th, &player); runto(th, &hero);
th->t_action = A_NIL; th->t_action = A_NIL;
return; return;
} }

View file

@ -27,11 +27,11 @@ int add_intelligence(int change);
int add_strength(int change); int add_strength(int change);
int add_wisdom(int change); int add_wisdom(int change);
int res_charisma(int howmuch); void res_charisma(int howmuch);
int res_constitution(int howmuch); void res_constitution(int howmuch);
int res_dexterity(int howmuch); void res_dexterity(int howmuch);
int res_intelligence(int howmuch); void res_intelligence(int howmuch);
int res_wisdom(int howmuch); void res_wisdom(int howmuch);
/* /*
* add_abil is an array of functions used to change attributes. It must be * add_abil is an array of functions used to change attributes. It must be
@ -48,7 +48,7 @@ int (*add_abil[NUMABILITIES])() = {
* ordered according to the attribute definitions in rogue.h. * ordered according to the attribute definitions in rogue.h.
*/ */
int (*res_abil[NUMABILITIES])() = { void (*res_abil[NUMABILITIES])() = {
res_intelligence, res_strength, res_wisdom, res_dexterity, res_intelligence, res_strength, res_wisdom, res_dexterity,
res_constitution, res_charisma res_constitution, res_charisma
}; };
@ -172,7 +172,7 @@ add_haste(bool blessed)
else { else {
msg("You feel yourself moving %sfaster.", blessed ? "much " : ""); msg("You feel yourself moving %sfaster.", blessed ? "much " : "");
turn_on(player, ISHASTE); turn_on(player, ISHASTE);
fuse(nohaste, (VOID *)NULL, roll(hasttime, hasttime), AFTER); fuse(nohaste, NULL, roll(hasttime, hasttime), AFTER);
} }
} }
@ -232,7 +232,7 @@ add_slow(void)
lengthen(noslow, roll(HASTETIME,HASTETIME)); lengthen(noslow, roll(HASTETIME,HASTETIME));
else { else {
turn_on(player, ISSLOW); turn_on(player, ISSLOW);
fuse(noslow, (VOID *)NULL, roll(HASTETIME,HASTETIME), AFTER); fuse(noslow, NULL, roll(HASTETIME,HASTETIME), AFTER);
} }
} }
} }
@ -353,7 +353,7 @@ quaff(int which, int kind, int flags, bool is_potion)
} }
else { /* Just light a fuse for how long player is safe */ else { /* Just light a fuse for how long player is safe */
if (off(player, ISCLEAR)) { if (off(player, ISCLEAR)) {
fuse(unclrhead, (VOID *)NULL, CLRDURATION, AFTER); fuse(unclrhead, NULL, CLRDURATION, AFTER);
msg("A faint blue aura surrounds your head."); msg("A faint blue aura surrounds your head.");
} }
else { /* If we have a fuse lengthen it, else we else { /* If we have a fuse lengthen it, else we
@ -518,7 +518,7 @@ quaff(int which, int kind, int flags, bool is_potion)
{ {
msg("A cloak of darkness falls around you."); msg("A cloak of darkness falls around you.");
turn_on(player, ISBLIND); turn_on(player, ISBLIND);
fuse(sight, (VOID *)NULL, SEEDURATION, AFTER); fuse(sight, NULL, SEEDURATION, AFTER);
light(&hero); light(&hero);
} }
else else
@ -529,7 +529,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (off(player, CANSEE)) { if (off(player, CANSEE)) {
turn_on(player, CANSEE); turn_on(player, CANSEE);
msg("Your eyes begin to tingle."); msg("Your eyes begin to tingle.");
fuse(unsee, (VOID *)NULL, blessed ? SEEDURATION*3 :SEEDURATION, AFTER); fuse(unsee, NULL, blessed ? SEEDURATION*3 :SEEDURATION, AFTER);
light(&hero); light(&hero);
} }
else if (find_slot(unsee) != 0) { else if (find_slot(unsee) != 0) {
@ -553,7 +553,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (on(player, CANINWALL)) if (on(player, CANINWALL))
lengthen(unphase, duration*PHASEDURATION); lengthen(unphase, duration*PHASEDURATION);
else { else {
fuse(unphase, (VOID *)NULL, duration*PHASEDURATION, AFTER); fuse(unphase, NULL, duration*PHASEDURATION, AFTER);
turn_on(player, CANINWALL); turn_on(player, CANINWALL);
} }
msg("You feel %slight-headed!", msg("You feel %slight-headed!",
@ -577,7 +577,7 @@ quaff(int which, int kind, int flags, bool is_potion)
} }
} }
else { else {
fuse(land, (VOID *)NULL, duration*FLYTIME, AFTER); fuse(land, NULL, duration*FLYTIME, AFTER);
turn_on(player, ISFLY); turn_on(player, ISFLY);
} }
if (say_message) { if (say_message) {
@ -641,7 +641,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (off(player, ISINVIS)) { if (off(player, ISINVIS)) {
turn_on(player, ISINVIS); turn_on(player, ISINVIS);
msg("You have a tingling feeling all over your body"); msg("You have a tingling feeling all over your body");
fuse(appear, (VOID *)NULL, blessed ? GONETIME*3 : GONETIME, AFTER); fuse(appear, NULL, blessed ? GONETIME*3 : GONETIME, AFTER);
PLAYER = IPLAYER; PLAYER = IPLAYER;
light(&hero); light(&hero);
} }
@ -703,7 +703,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (!find_slot(unskill)) { /* No skill */ if (!find_slot(unskill)) { /* No skill */
pstats.s_lvladj = -2; pstats.s_lvladj = -2;
pstats.s_lvl += pstats.s_lvladj; pstats.s_lvl += pstats.s_lvladj;
fuse(unskill, (VOID *)NULL, SKILLDURATION, AFTER); fuse(unskill, NULL, SKILLDURATION, AFTER);
} }
else { /* Has an artifical skill */ else { /* Has an artifical skill */
/* Is the skill beneficial? */ /* Is the skill beneficial? */
@ -759,7 +759,7 @@ quaff(int which, int kind, int flags, bool is_potion)
if (!find_slot(unskill)) { if (!find_slot(unskill)) {
pstats.s_lvladj = adjust; pstats.s_lvladj = adjust;
pstats.s_lvl += pstats.s_lvladj; pstats.s_lvl += pstats.s_lvladj;
fuse(unskill, (VOID *)NULL, fuse(unskill, NULL,
blessed ? SKILLDURATION*2 : SKILLDURATION, AFTER); blessed ? SKILLDURATION*2 : SKILLDURATION, AFTER);
} }
else { /* Has an artifical skill */ else { /* Has an artifical skill */
@ -819,7 +819,7 @@ quaff(int which, int kind, int flags, bool is_potion)
say_message = FALSE; say_message = FALSE;
} }
else { else {
fuse(nofire, (VOID *)NULL, duration*FIRETIME, AFTER); fuse(nofire, NULL, duration*FIRETIME, AFTER);
turn_on(player, NOFIRE); turn_on(player, NOFIRE);
} }
if (say_message) { if (say_message) {
@ -856,7 +856,7 @@ quaff(int which, int kind, int flags, bool is_potion)
say_message = FALSE; say_message = FALSE;
} }
else { else {
fuse(nocold, (VOID *)NULL, duration*COLDTIME, AFTER); fuse(nocold, NULL, duration*COLDTIME, AFTER);
turn_on(player, NOCOLD); turn_on(player, NOCOLD);
} }
if (say_message) { if (say_message) {
@ -890,7 +890,7 @@ quaff(int which, int kind, int flags, bool is_potion)
say_message = FALSE; say_message = FALSE;
} }
else { else {
fuse(nobolt, (VOID *)NULL, duration*BOLTTIME, AFTER); fuse(nobolt, NULL, duration*BOLTTIME, AFTER);
turn_on(player, NOBOLT); turn_on(player, NOBOLT);
} }
if (say_message) { if (say_message) {
@ -945,13 +945,13 @@ quaff(int which, int kind, int flags, bool is_potion)
* if called with zero the restore fully * if called with zero the restore fully
*/ */
int void
res_dexterity(int howmuch) res_dexterity(int howmuch)
{ {
short save_max; short save_max;
int ring_str; int ring_str;
if (howmuch < 0) return(0); if (howmuch < 0) return;
/* Discount the ring value */ /* Discount the ring value */
ring_str = ring_value(R_ADDHIT); ring_str = ring_value(R_ADDHIT);
@ -970,7 +970,7 @@ res_dexterity(int howmuch)
pstats.s_dext += ring_str; pstats.s_dext += ring_str;
max_stats.s_dext = save_max; max_stats.s_dext = save_max;
} }
return(0); return;
} }
/* /*
@ -978,13 +978,13 @@ res_dexterity(int howmuch)
* Restore player's intelligence * Restore player's intelligence
*/ */
int void
res_intelligence(int howmuch) res_intelligence(int howmuch)
{ {
short save_max; short save_max;
int ring_str; int ring_str;
if (howmuch <= 0) return(0); if (howmuch <= 0) return;
/* Discount the ring value */ /* Discount the ring value */
ring_str = ring_value(R_ADDINTEL); ring_str = ring_value(R_ADDINTEL);
@ -998,7 +998,7 @@ res_intelligence(int howmuch)
pstats.s_intel += ring_str; pstats.s_intel += ring_str;
max_stats.s_intel = save_max; max_stats.s_intel = save_max;
} }
return(0); return;
} }
/* /*
@ -1006,13 +1006,13 @@ res_intelligence(int howmuch)
* Restore player's wisdom * Restore player's wisdom
*/ */
int void
res_wisdom(int howmuch) res_wisdom(int howmuch)
{ {
short save_max; short save_max;
int ring_str; int ring_str;
if (howmuch <= 0) return(0); if (howmuch <= 0) return;
/* Discount the ring value */ /* Discount the ring value */
ring_str = ring_value(R_ADDWISDOM); ring_str = ring_value(R_ADDWISDOM);
@ -1026,7 +1026,7 @@ res_wisdom(int howmuch)
pstats.s_wisdom += ring_str; pstats.s_wisdom += ring_str;
max_stats.s_wisdom = save_max; max_stats.s_wisdom = save_max;
} }
return(0); return;
} }
/* /*
@ -1034,13 +1034,13 @@ res_wisdom(int howmuch)
* Restore the players constitution. * Restore the players constitution.
*/ */
int void
res_constitution(int howmuch) res_constitution(int howmuch)
{ {
if (howmuch > 0) if (howmuch > 0)
pstats.s_const = min(pstats.s_const + howmuch, max_stats.s_const); pstats.s_const = min(pstats.s_const + howmuch, max_stats.s_const);
return(0); return;
} }
/* /*
@ -1048,12 +1048,12 @@ res_constitution(int howmuch)
* Restore the players charisma. * Restore the players charisma.
*/ */
int void
res_charisma(int howmuch) res_charisma(int howmuch)
{ {
if (howmuch > 0) if (howmuch > 0)
pstats.s_charisma = pstats.s_charisma =
min(pstats.s_charisma + howmuch, max_stats.s_charisma); min(pstats.s_charisma + howmuch, max_stats.s_charisma);
return(0); return;
} }

View file

@ -100,9 +100,9 @@ ring_on(struct linked_list *item)
} }
} }
when R_SEARCH: when R_SEARCH:
start_daemon(ring_search, (VOID *)NULL, AFTER); start_daemon(ring_search, NULL, AFTER);
when R_TELEPORT: when R_TELEPORT:
start_daemon(ring_teleport, (VOID *)NULL, AFTER); start_daemon(ring_teleport, NULL, AFTER);
} }
status(FALSE); status(FALSE);
if (r_know[obj->o_which] && r_guess[obj->o_which]) { if (r_know[obj->o_which] && r_guess[obj->o_which]) {

View file

@ -20,12 +20,8 @@
#include "config.h" #include "config.h"
#endif #endif
/*
* some compiler don't handle void pointers well so
*/
#include <assert.h> #include <assert.h>
#define reg register #define reg register
#define VOID long
#undef lines #undef lines
#define ENCREAD encread #define ENCREAD encread
#define ENCWRITE encwrite #define ENCWRITE encwrite
@ -933,9 +929,9 @@
struct delayed_action { struct delayed_action {
int d_type; int d_type;
int (*d_func)(); void (*d_func)();
union { union {
VOID *vp; void *vp;
int i; int i;
} d_arg; } d_arg;
int d_time; int d_time;
@ -1249,7 +1245,7 @@ int can_shoot(coord *er, coord *ee, coord *shoot_dir);
bool cansee(int y, int x); bool cansee(int y, int x);
void carry_obj(struct thing *mp, int chance); void carry_obj(struct thing *mp, int chance);
void cast(void); void cast(void);
void changeclass(long *newclass); void changeclass(int newclass);
void chant(void); void chant(void);
void chant_recovery(void); void chant_recovery(void);
void chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree, void chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree,
@ -1258,7 +1254,7 @@ long check_level(void);
void check_residue(struct thing *tp); void check_residue(struct thing *tp);
void chg_str(int amt); void chg_str(int amt);
void choose_qst(void); void choose_qst(void);
int cloak_charge(struct object *obj); void cloak_charge(struct object *obj);
void command(void); void command(void);
void confus_player(void); void confus_player(void);
int const_bonus(void); int const_bonus(void);
@ -1310,19 +1306,19 @@ void endit(int sig);
void endmsg(void); void endmsg(void);
void exit_game(int flag); void exit_game(int flag);
void explode(struct thing *tp); void explode(struct thing *tp);
void extinguish(int (*dfunc)()); void extinguish(void (*dfunc)());
void fall(struct linked_list *item, bool pr); void fall(struct linked_list *item, bool pr);
coord *fallpos(coord *pos, bool be_clear, int range); coord *fallpos(coord *pos, bool be_clear, int range);
void fatal(char *s); void fatal(char *s);
bool fight(coord *mp, struct object *weap, bool thrown); bool fight(coord *mp, struct object *weap, bool thrown);
struct linked_list *find_mons(int y, int x); struct linked_list *find_mons(int y, int x);
struct linked_list *find_obj(int y, int x); struct linked_list *find_obj(int y, int x);
struct delayed_action *find_slot(int (*func)()); struct delayed_action *find_slot(void (*func)());
int findmindex(char *name); int findmindex(char *name);
void fix_stick(struct object *cur); void fix_stick(struct object *cur);
void fright(struct thing *th); void fright(struct thing *th);
void fumble(void); void fumble(void);
void fuse(int (*dfunc)(), VOID *arg, int time, int type); void fuse(void (*dfunc)(), void *arg, int time, int type);
void genmonsters(int least, bool treas); void genmonsters(int least, bool treas);
coord get_coordinates(void); coord get_coordinates(void);
bool get_dir(coord *direction); bool get_dir(coord *direction);
@ -1359,10 +1355,10 @@ bool is_current(struct object *obj);
bool is_magic(struct object *obj); bool is_magic(struct object *obj);
bool isatrap(char ch); bool isatrap(char ch);
int itemweight(struct object *wh); int itemweight(struct object *wh);
void kill_daemon(int (*dfunc)()); void kill_daemon(void (*dfunc)());
void killed(struct linked_list *item, bool pr, bool points, bool treasure); void killed(struct linked_list *item, bool pr, bool points, bool treasure);
int land(void); void land(void);
void lengthen(int (*dfunc)(), int xtime); void lengthen(void (*dfunc)(), int xtime);
void light(coord *cp); void light(coord *cp);
bool lit_room(struct room *rp); bool lit_room(struct room *rp);
void look(bool wakeup, bool runend); void look(bool wakeup, bool runend);
@ -1415,7 +1411,7 @@ void raise_level(void);
short randmonster(bool wander, bool no_unique); short randmonster(bool wander, bool no_unique);
void read_scroll(int which, int flag, bool is_scroll); void read_scroll(int which, int flag, bool is_scroll);
void reap(void); void reap(void);
int res_strength(long howmuch); void res_strength(long howmuch);
bool restore(char *file, char *envp[]); bool restore(char *file, char *envp[]);
void restscr(WINDOW *scr); void restscr(WINDOW *scr);
int ring_eat(int hand); int ring_eat(int hand);
@ -1452,7 +1448,7 @@ bool skirmish(struct thing *attacker, coord *mp, struct object *weap,
bool thrown); bool thrown);
struct linked_list *spec_item(int type, int which, int hit, int damage); struct linked_list *spec_item(int type, int which, int hit, int damage);
void spell_recovery(void); void spell_recovery(void);
void start_daemon(int (*dfunc)(), VOID *arg, int type); void start_daemon(void (*dfunc)(), void *arg, int type);
void status(bool display); void status(bool display);
void steal(void); void steal(void);
bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr); bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr);
@ -1475,7 +1471,7 @@ void trap_look(void);
void unchoke(void); void unchoke(void);
void unclrhead(void); void unclrhead(void);
void unconfuse(void); void unconfuse(void);
int undance(void); void undance(void);
void unphase(void); void unphase(void);
void unsee(void); void unsee(void);
void unskill(void); void unskill(void);
@ -1648,7 +1644,6 @@ extern FILE *scorefi;
extern FILE *logfile; extern FILE *logfile;
extern LEVTYPE levtype; extern LEVTYPE levtype;
extern int (*add_abil[NUMABILITIES])(int); /* Functions to change abilities */ extern int (*add_abil[NUMABILITIES])(int); /* Functions to change abilities */
extern int (*res_abil[NUMABILITIES])(); /* Functions to change abilities */
extern int mf_count; /* move_free counter - see actions.c(m_act()) */ extern int mf_count; /* move_free counter - see actions.c(m_act()) */
extern int mf_jmpcnt; /* move_free counter for # of jumps */ extern int mf_jmpcnt; /* move_free counter for # of jumps */
extern int killed_chance; /* cumulative chance for goodies to loose it, fight.c */ extern int killed_chance; /* cumulative chance for goodies to loose it, fight.c */

View file

@ -57,7 +57,6 @@
#include <Lmcons.h> #include <Lmcons.h>
#include <shlobj.h> #include <shlobj.h>
#include <Shlwapi.h> #include <Shlwapi.h>
#undef VOID
#undef MOUSE_MOVED #undef MOUSE_MOVED
#elif defined(__DJGPP__) #elif defined(__DJGPP__)
#include <process.h> #include <process.h>

View file

@ -513,7 +513,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
pstats.s_hpt = -1; pstats.s_hpt = -1;
msg("Your life has been sucked out from you! --More--"); msg("Your life has been sucked out from you! --More--");
wait_for(' '); wait_for(' ');
death(zapper); death(zapper->t_index);
} }
else else
msg("You feel a great drain on your system."); msg("You feel a great drain on your system.");
@ -613,7 +613,7 @@ do_zap(struct thing *zapper, struct object *obj, coord *direction, int which,
turn_on(player, HASDISEASE); turn_on(player, HASDISEASE);
turn_on(player, HASINFEST); turn_on(player, HASINFEST);
turn_on(player, DOROT); turn_on(player, DOROT);
fuse(cure_disease, (VOID *)NULL, roll(HEALTIME,SICKTIME), AFTER); fuse(cure_disease, NULL, roll(HEALTIME,SICKTIME), AFTER);
infest_dam++; infest_dam++;
} }
else if (sick == FALSE) msg("You feel momentarily sick"); else if (sick == FALSE) msg("You feel momentarily sick");

View file

@ -203,7 +203,7 @@ confus_player(void)
if (find_slot(unconfuse)) if (find_slot(unconfuse))
lengthen(unconfuse, HUHDURATION); lengthen(unconfuse, HUHDURATION);
else else
fuse(unconfuse, (VOID *)NULL, HUHDURATION, AFTER); fuse(unconfuse, NULL, HUHDURATION, AFTER);
turn_on(player, ISHUH); turn_on(player, ISHUH);
} }
else msg("You feel dizzy for a moment, but it quickly passes."); else msg("You feel dizzy for a moment, but it quickly passes.");

View file

@ -328,7 +328,7 @@ wear(void)
msg("Wearing %s", inv_name(obj,TRUE)); msg("Wearing %s", inv_name(obj,TRUE));
cur_misc[WEAR_GAUNTLET] = obj; cur_misc[WEAR_GAUNTLET] = obj;
if (obj->o_which == MM_FUMBLE) if (obj->o_which == MM_FUMBLE)
start_daemon(fumble, (VOID *)NULL, AFTER); start_daemon(fumble, NULL, AFTER);
/* /*
* the jewel of attacks does an aggavate monster * the jewel of attacks does an aggavate monster
*/ */
@ -358,7 +358,7 @@ wear(void)
msg("Wearing %s",inv_name(obj,TRUE)); msg("Wearing %s",inv_name(obj,TRUE));
cur_misc[WEAR_NECKLACE] = obj; cur_misc[WEAR_NECKLACE] = obj;
msg("The necklace is beginning to strangle you!"); msg("The necklace is beginning to strangle you!");
start_daemon(strangle, (VOID *)NULL, AFTER); start_daemon(strangle, NULL, AFTER);
otherwise: otherwise:
msg("What a strange item you have!"); msg("What a strange item you have!");
} }