comparison xrogue/rogue.h @ 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 f54901b9c39b
children 7c1cb43f346e
comparison
equal deleted inserted replaced
227:696277507a2e 228:b67b99f6c92b
931 #define MAXDAEMONS 10 931 #define MAXDAEMONS 10
932 #define MAXFUSES 20 932 #define MAXFUSES 20
933 933
934 struct delayed_action { 934 struct delayed_action {
935 int d_type; 935 int d_type;
936 int (*d_func)(); 936 void (*d_func)();
937 union { 937 union {
938 VOID *vp; 938 VOID *vp;
939 int i; 939 int i;
940 } d_arg; 940 } d_arg;
941 int d_time; 941 int d_time;
1256 bool flee); 1256 bool flee);
1257 long check_level(void); 1257 long check_level(void);
1258 void check_residue(struct thing *tp); 1258 void check_residue(struct thing *tp);
1259 void chg_str(int amt); 1259 void chg_str(int amt);
1260 void choose_qst(void); 1260 void choose_qst(void);
1261 int cloak_charge(struct object *obj); 1261 void cloak_charge(struct object *obj);
1262 void command(void); 1262 void command(void);
1263 void confus_player(void); 1263 void confus_player(void);
1264 int const_bonus(void); 1264 int const_bonus(void);
1265 void corr_move(int dy, int dx); 1265 void corr_move(int dy, int dx);
1266 struct linked_list *creat_item(void); 1266 struct linked_list *creat_item(void);
1308 long encwrite(char *start, unsigned long size, FILE *outf); 1308 long encwrite(char *start, unsigned long size, FILE *outf);
1309 void endit(int sig); 1309 void endit(int sig);
1310 void endmsg(void); 1310 void endmsg(void);
1311 void exit_game(int flag); 1311 void exit_game(int flag);
1312 void explode(struct thing *tp); 1312 void explode(struct thing *tp);
1313 void extinguish(int (*dfunc)()); 1313 void extinguish(void (*dfunc)());
1314 void fall(struct linked_list *item, bool pr); 1314 void fall(struct linked_list *item, bool pr);
1315 coord *fallpos(coord *pos, bool be_clear, int range); 1315 coord *fallpos(coord *pos, bool be_clear, int range);
1316 void fatal(char *s); 1316 void fatal(char *s);
1317 bool fight(coord *mp, struct object *weap, bool thrown); 1317 bool fight(coord *mp, struct object *weap, bool thrown);
1318 struct linked_list *find_mons(int y, int x); 1318 struct linked_list *find_mons(int y, int x);
1319 struct linked_list *find_obj(int y, int x); 1319 struct linked_list *find_obj(int y, int x);
1320 struct delayed_action *find_slot(int (*func)()); 1320 struct delayed_action *find_slot(void (*func)());
1321 int findmindex(char *name); 1321 int findmindex(char *name);
1322 void fix_stick(struct object *cur); 1322 void fix_stick(struct object *cur);
1323 void fright(struct thing *th); 1323 void fright(struct thing *th);
1324 void fumble(void); 1324 void fumble(void);
1325 void fuse(int (*dfunc)(), VOID *arg, int time, int type); 1325 void fuse(void (*dfunc)(), VOID *arg, int time, int type);
1326 void genmonsters(int least, bool treas); 1326 void genmonsters(int least, bool treas);
1327 coord get_coordinates(void); 1327 coord get_coordinates(void);
1328 bool get_dir(coord *direction); 1328 bool get_dir(coord *direction);
1329 struct linked_list *get_hurl(struct thing *tp); 1329 struct linked_list *get_hurl(struct thing *tp);
1330 struct linked_list *get_item(struct linked_list *list, char *purpose, int type, 1330 struct linked_list *get_item(struct linked_list *list, char *purpose, int type,
1357 bool invisible(struct thing *monst); 1357 bool invisible(struct thing *monst);
1358 bool is_current(struct object *obj); 1358 bool is_current(struct object *obj);
1359 bool is_magic(struct object *obj); 1359 bool is_magic(struct object *obj);
1360 bool isatrap(char ch); 1360 bool isatrap(char ch);
1361 int itemweight(struct object *wh); 1361 int itemweight(struct object *wh);
1362 void kill_daemon(int (*dfunc)()); 1362 void kill_daemon(void (*dfunc)());
1363 void killed(struct linked_list *item, bool pr, bool points, bool treasure); 1363 void killed(struct linked_list *item, bool pr, bool points, bool treasure);
1364 int land(void); 1364 void land(void);
1365 void lengthen(int (*dfunc)(), int xtime); 1365 void lengthen(void (*dfunc)(), int xtime);
1366 void light(coord *cp); 1366 void light(coord *cp);
1367 bool lit_room(struct room *rp); 1367 bool lit_room(struct room *rp);
1368 void look(bool wakeup, bool runend); 1368 void look(bool wakeup, bool runend);
1369 void lower_level(short who); 1369 void lower_level(short who);
1370 void m_use_relic(struct thing *monster); 1370 void m_use_relic(struct thing *monster);
1413 void quit(int sig); 1413 void quit(int sig);
1414 void raise_level(void); 1414 void raise_level(void);
1415 short randmonster(bool wander, bool no_unique); 1415 short randmonster(bool wander, bool no_unique);
1416 void read_scroll(int which, int flag, bool is_scroll); 1416 void read_scroll(int which, int flag, bool is_scroll);
1417 void reap(void); 1417 void reap(void);
1418 int res_strength(long howmuch); 1418 void res_strength(long howmuch);
1419 bool restore(char *file, char *envp[]); 1419 bool restore(char *file, char *envp[]);
1420 void restscr(WINDOW *scr); 1420 void restscr(WINDOW *scr);
1421 int ring_eat(int hand); 1421 int ring_eat(int hand);
1422 char *ring_num(struct object *obj); 1422 char *ring_num(struct object *obj);
1423 void ring_on(struct linked_list *item); 1423 void ring_on(struct linked_list *item);
1450 void sight(void); 1450 void sight(void);
1451 bool skirmish(struct thing *attacker, coord *mp, struct object *weap, 1451 bool skirmish(struct thing *attacker, coord *mp, struct object *weap,
1452 bool thrown); 1452 bool thrown);
1453 struct linked_list *spec_item(int type, int which, int hit, int damage); 1453 struct linked_list *spec_item(int type, int which, int hit, int damage);
1454 void spell_recovery(void); 1454 void spell_recovery(void);
1455 void start_daemon(int (*dfunc)(), VOID *arg, int type); 1455 void start_daemon(void (*dfunc)(), VOID *arg, int type);
1456 void status(bool display); 1456 void status(bool display);
1457 void steal(void); 1457 void steal(void);
1458 bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr); 1458 bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr);
1459 void stomach(void); 1459 void stomach(void);
1460 int str_compute(void); 1460 int str_compute(void);
1473 struct trap *trap_at(int y, int x); 1473 struct trap *trap_at(int y, int x);
1474 void trap_look(void); 1474 void trap_look(void);
1475 void unchoke(void); 1475 void unchoke(void);
1476 void unclrhead(void); 1476 void unclrhead(void);
1477 void unconfuse(void); 1477 void unconfuse(void);
1478 int undance(void); 1478 void undance(void);
1479 void unphase(void); 1479 void unphase(void);
1480 void unsee(void); 1480 void unsee(void);
1481 void unskill(void); 1481 void unskill(void);
1482 void unstink(void); 1482 void unstink(void);
1483 void updpack(int getmax, struct thing *tp); 1483 void updpack(int getmax, struct thing *tp);
1646 extern char *retstr; 1646 extern char *retstr;
1647 extern FILE *scorefi; 1647 extern FILE *scorefi;
1648 extern FILE *logfile; 1648 extern FILE *logfile;
1649 extern LEVTYPE levtype; 1649 extern LEVTYPE levtype;
1650 extern int (*add_abil[NUMABILITIES])(int); /* Functions to change abilities */ 1650 extern int (*add_abil[NUMABILITIES])(int); /* Functions to change abilities */
1651 extern int (*res_abil[NUMABILITIES])(); /* Functions to change abilities */
1652 extern int mf_count; /* move_free counter - see actions.c(m_act()) */ 1651 extern int mf_count; /* move_free counter - see actions.c(m_act()) */
1653 extern int mf_jmpcnt; /* move_free counter for # of jumps */ 1652 extern int mf_jmpcnt; /* move_free counter for # of jumps */
1654 extern int killed_chance; /* cumulative chance for goodies to loose it, fight.c */ 1653 extern int killed_chance; /* cumulative chance for goodies to loose it, fight.c */
1655 extern coord move_nh; /* move.c */ 1654 extern coord move_nh; /* move.c */
1656 #define NCOLORS 32 1655 #define NCOLORS 32