Mercurial > hg > early-roguelike
changeset 228:b67b99f6c92b
Daemons and fuses now return void.
Functions for starting and stopping daemons and fuses now expect the
type 'void (*func)()'.  Only a few functions in XRogue needed to be
modified to fit.  Determining the type of the argument is left for a
later date.
Building with GCC5 should now produce less than 200 lines of warnings
per game.
| author | John "Elwin" Edwards | 
|---|---|
| date | Sat, 05 Mar 2016 20:49:37 -0500 | 
| parents | 696277507a2e | 
| children | 50b89f165a34 | 
| files | arogue5/daemon.c arogue5/rogue.h arogue7/daemon.c arogue7/rogue.h arogue7/state.c rogue4/daemon.c rogue4/rogue.h srogue/daemon.c srogue/rogue.ext srogue/rogue.h xrogue/daemon.c xrogue/daemons.c xrogue/potions.c xrogue/rogue.h | 
| diffstat | 14 files changed, 91 insertions(+), 96 deletions(-) [+] | 
line wrap: on
 line diff
--- a/arogue5/daemon.c Sat Mar 05 12:10:20 2016 -0500 +++ b/arogue5/daemon.c Sat Mar 05 20:49:37 2016 -0500 @@ -70,7 +70,7 @@ * Find a particular slot in the table */ struct delayed_action * -find_slot(int (*func)()) +find_slot(void (*func)()) { reg int i; reg struct delayed_action *dev; @@ -87,7 +87,7 @@ * Start a daemon, takes a function. */ void -start_daemon(int (*func)(), void *arg, int type) +start_daemon(void (*func)(), void *arg, int type) { reg struct delayed_action *dev; @@ -107,7 +107,7 @@ * Remove a daemon from the list */ void -kill_daemon(int (*func)()) +kill_daemon(void (*func)()) { reg struct delayed_action *dev; reg int i; @@ -155,7 +155,7 @@ * Start a fuse to go off in a certain number of turns */ void -fuse(int (*func)(), void *arg, int time, int type) +fuse(void (*func)(), void *arg, int time, int type) { reg struct delayed_action *wire; @@ -175,7 +175,7 @@ * Increase the time until a fuse goes off */ void -lengthen(int (*func)(), int xtime) +lengthen(void (*func)(), int xtime) { reg struct delayed_action *wire; @@ -190,7 +190,7 @@ * Put out a fuse */ void -extinguish(int (*func)()) +extinguish(void (*func)()) { reg struct delayed_action *wire;
--- a/arogue5/rogue.h Sat Mar 05 12:10:20 2016 -0500 +++ b/arogue5/rogue.h Sat Mar 05 20:49:37 2016 -0500 @@ -724,7 +724,7 @@ struct delayed_action { int d_type; - int (*d_func)(); + void (*d_func)(); void *d_arg; int d_time; }; @@ -1013,17 +1013,17 @@ int encwrite(char *start, unsigned int size, FILE *outf); void endit(int sig); void endmsg(void); -void extinguish(int (*func)()); +void extinguish(void (*func)()); void fall(struct linked_list *item, bool pr); coord *fallpos(coord *pos, bool be_clear, int range); void fatal(char *s); bool fight(coord *mp, struct object *weap, bool thrown); struct linked_list *find_mons(int y, int x);
