arogue7, xrogue: improve the handling of the arguments to fuses.
fuse() now expects a pointer as the argument to a fuse function. If this is one of the functions that takes int, fuse() follows the pointer and stores that value in the f_list slot, in the integer field of the argument union. When the fuse goes off, do_fuses() recognizes the function and passes it the integer field instead of the pointer. This has the disadvantage of hard-coding the functions that require int in daemon.c, but since the int is copied into f_list, it no longer has to be in static or global memory, which simplifies several files.
This commit is contained in:
parent
dafa5cc722
commit
758c6b1bf0
21 changed files with 147 additions and 124 deletions
|
|
@ -1223,7 +1223,7 @@ struct delayed_action *find_slot(void (*func)());
|
|||
int findmindex(char *name);
|
||||
void fix_stick(struct object *cur);
|
||||
void fumble(void);
|
||||
void fuse(void (*func)(), int arg, int time, int type);
|
||||
void fuse(void (*func)(), void *arg, int time, int type);
|
||||
void genmonsters(int least, bool treas);
|
||||
coord get_coordinates(void);
|
||||
bool get_dir(coord *direction);
|
||||
|
|
@ -1357,7 +1357,7 @@ bool skirmish(struct thing *attacker, coord *mp, struct object *weap,
|
|||
bool thrown);
|
||||
struct linked_list *spec_item(int type, int which, int hit, int damage);
|
||||
void spell_recovery(void);
|
||||
void start_daemon(void (*func)(), int arg, int type);
|
||||
void start_daemon(void (*func)(), void *arg, int type);
|
||||
void status(bool display);
|
||||
void steal(void);
|
||||
bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue