Mercurial > hg > early-roguelike
comparison arogue7/rogue.h @ 238:e1cd27c5464f
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.
author | John "Elwin" Edwards |
---|---|
date | Fri, 11 Mar 2016 17:40:00 -0500 |
parents | b67b99f6c92b |
children | 3d4252fa2ed3 |
comparison
equal
deleted
inserted
replaced
237:2236ef808bcb | 238:e1cd27c5464f |
---|---|
1221 struct linked_list *find_obj(int y, int x); | 1221 struct linked_list *find_obj(int y, int x); |
1222 struct delayed_action *find_slot(void (*func)()); | 1222 struct delayed_action *find_slot(void (*func)()); |
1223 int findmindex(char *name); | 1223 int findmindex(char *name); |
1224 void fix_stick(struct object *cur); | 1224 void fix_stick(struct object *cur); |
1225 void fumble(void); | 1225 void fumble(void); |
1226 void fuse(void (*func)(), int arg, int time, int type); | 1226 void fuse(void (*func)(), void *arg, int time, int type); |
1227 void genmonsters(int least, bool treas); | 1227 void genmonsters(int least, bool treas); |
1228 coord get_coordinates(void); | 1228 coord get_coordinates(void); |
1229 bool get_dir(coord *direction); | 1229 bool get_dir(coord *direction); |
1230 struct linked_list *get_hurl(struct thing *tp); | 1230 struct linked_list *get_hurl(struct thing *tp); |
1231 struct linked_list *get_item(struct linked_list *list, char *purpose, int type, | 1231 struct linked_list *get_item(struct linked_list *list, char *purpose, int type, |
1355 void sight(void); | 1355 void sight(void); |
1356 bool skirmish(struct thing *attacker, coord *mp, struct object *weap, | 1356 bool skirmish(struct thing *attacker, coord *mp, struct object *weap, |
1357 bool thrown); | 1357 bool thrown); |
1358 struct linked_list *spec_item(int type, int which, int hit, int damage); | 1358 struct linked_list *spec_item(int type, int which, int hit, int damage); |
1359 void spell_recovery(void); | 1359 void spell_recovery(void); |
1360 void start_daemon(void (*func)(), int arg, int type); | 1360 void start_daemon(void (*func)(), void *arg, int type); |
1361 void status(bool display); | 1361 void status(bool display); |
1362 void steal(void); | 1362 void steal(void); |
1363 bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr); | 1363 bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr); |
1364 void stomach(void); | 1364 void stomach(void); |
1365 int str_compute(void); | 1365 int str_compute(void); |