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.
This commit is contained in:
parent
6dfde944f0
commit
0a354903e0
14 changed files with 91 additions and 96 deletions
|
|
@ -34,7 +34,7 @@ struct delayed_action d_list[MAXDAEMONS] = {
|
|||
* Insert a function in the daemon list.
|
||||
*/
|
||||
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;
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ d_delete(struct delayed_action *wire)
|
|||
* Find a particular slot in the table
|
||||
*/
|
||||
struct delayed_action *
|
||||
find_slot(int (*func)())
|
||||
find_slot(void (*func)())
|
||||
{
|
||||
reg struct delayed_action *dev;
|
||||
|
||||
|
|
@ -87,7 +87,7 @@ find_slot(int (*func)())
|
|||
* Start a daemon, takes a function.
|
||||
*/
|
||||
void
|
||||
start_daemon(int (*func)(), int arg, int type)
|
||||
start_daemon(void (*func)(), int arg, int type)
|
||||
{
|
||||
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
|
||||
*/
|
||||
void
|
||||
fuse(int (*func)(), int arg, int time)
|
||||
fuse(void (*func)(), int arg, int 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
|
||||
*/
|
||||
void
|
||||
lengthen(int (*func)(), int xtime)
|
||||
lengthen(void (*func)(), int xtime)
|
||||
{
|
||||
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.
|
||||
*/
|
||||
void
|
||||
extinguish(int (*func)())
|
||||
extinguish(void (*func)())
|
||||
{
|
||||
reg struct delayed_action *dev;
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ int encread(void *starta, unsigned int size, int inf);
|
|||
void encwrite(void *starta, unsigned int size, FILE *outf);
|
||||
void endit(int a);
|
||||
void endmsg(void);
|
||||
void extinguish(int (*func)());
|
||||
void extinguish(void (*func)());
|
||||
int extras(void);
|
||||
void fall(struct linked_list *item, bool pr);
|
||||
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_obj(int y, int x);
|
||||
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 genocide(void);
|
||||
bool get_dir(void);
|
||||
|
|
@ -140,7 +140,7 @@ bool isatrap(char ch);
|
|||
bool isring(int hand, int ring);
|
||||
bool iswearing(int ring);
|
||||
void killed(struct linked_list *item, bool pr);
|
||||
void lengthen(int (*func)(), int xtime);
|
||||
void lengthen(void (*func)(), int xtime);
|
||||
void lev_mon(void);
|
||||
void light(struct coord *cp);
|
||||
void look(bool wakeup);
|
||||
|
|
@ -215,7 +215,7 @@ void setup(void);
|
|||
char show(int y, int x);
|
||||
bool showtop(int showname);
|
||||
void sight(int fromfuse);
|
||||
void start_daemon(int (*func)(), int arg, int type);
|
||||
void start_daemon(void (*func)(), int arg, int type);
|
||||
void status(int fromfuse);
|
||||
bool step_ok(unsigned char ch);
|
||||
void stomach(int fromfuse);
|
||||
|
|
|
|||
|
|
@ -531,7 +531,7 @@ char *xcrypt(const char *key, const char *setting);
|
|||
|
||||
struct delayed_action {
|
||||
int d_type;
|
||||
int (*d_func)();
|
||||
void (*d_func)();
|
||||
int d_arg;
|
||||
int d_time;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue