comparison xrogue/rogue.h @ 239:837044d2c362

Merge the GCC5 and build fix branches. This fixes all warnings produced by GCC 5, except the ones related to system functions. Those could be fixed by including the proper headers, but it would be better to replace the system-dependent code with functions from mdport.c.
author John "Elwin" Edwards
date Fri, 11 Mar 2016 19:47:52 -0500
parents e1cd27c5464f
children 3d4252fa2ed3
comparison
equal deleted inserted replaced
232:bac2c81fec78 239:837044d2c362
18 18
19 #ifdef HAVE_CONFIG_H 19 #ifdef HAVE_CONFIG_H
20 #include "config.h" 20 #include "config.h"
21 #endif 21 #endif
22 22
23 /*
24 * some compiler don't handle void pointers well so
25 */
26 #include <assert.h> 23 #include <assert.h>
27 #define reg register 24 #define reg register
28 #define VOID long
29 #undef lines 25 #undef lines
30 #define ENCREAD encread 26 #define ENCREAD encread
31 #define ENCWRITE encwrite 27 #define ENCWRITE encwrite
32 #undef SCROLL /* UNIX/370 defines SCROLL for some bizarre reason */ 28 #undef SCROLL /* UNIX/370 defines SCROLL for some bizarre reason */
33 #define exfork fork /* Standard fork with no paging available */ 29 #define exfork fork /* Standard fork with no paging available */
931 #define MAXDAEMONS 10 927 #define MAXDAEMONS 10
932 #define MAXFUSES 20 928 #define MAXFUSES 20
933 929
934 struct delayed_action { 930 struct delayed_action {
935 int d_type; 931 int d_type;
936 int (*d_func)(); 932 void (*d_func)();
937 union { 933 union {
938 VOID *vp; 934 void *vp;
939 int i; 935 int i;
940 } d_arg; 936 } d_arg;
941 int d_time; 937 int d_time;
942 }; 938 };
943 939
1247 bool can_blink(struct thing *tp); 1243 bool can_blink(struct thing *tp);
1248 int can_shoot(coord *er, coord *ee, coord *shoot_dir); 1244 int can_shoot(coord *er, coord *ee, coord *shoot_dir);
1249 bool cansee(int y, int x); 1245 bool cansee(int y, int x);
1250 void carry_obj(struct thing *mp, int chance); 1246 void carry_obj(struct thing *mp, int chance);
1251 void cast(void); 1247 void cast(void);
1252 void changeclass(long *newclass); 1248 void changeclass(int newclass);
1253 void chant(void); 1249 void chant(void);
1254 void chant_recovery(void); 1250 void chant_recovery(void);
1255 void chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree, 1251 void chase(struct thing *tp, coord *ee, struct room *rer, struct room *ree,
1256 bool flee); 1252 bool flee);
1257 long check_level(void); 1253 long check_level(void);
1258 void check_residue(struct thing *tp); 1254 void check_residue(struct thing *tp);
1259 void chg_str(int amt); 1255 void chg_str(int amt);
1260 void choose_qst(void); 1256 void choose_qst(void);
1261 int cloak_charge(struct object *obj); 1257 void cloak_charge(struct object *obj);
1262 void command(void); 1258 void command(void);
1263 void confus_player(void); 1259 void confus_player(void);
1264 int const_bonus(void); 1260 int const_bonus(void);
1265 void corr_move(int dy, int dx); 1261 void corr_move(int dy, int dx);
1266 struct linked_list *creat_item(void); 1262 struct linked_list *creat_item(void);
1308 long encwrite(char *start, unsigned long size, FILE *outf); 1304 long encwrite(char *start, unsigned long size, FILE *outf);
1309 void endit(int sig); 1305 void endit(int sig);
1310 void endmsg(void); 1306 void endmsg(void);
1311 void exit_game(int flag); 1307 void exit_game(int flag);
1312 void explode(struct thing *tp); 1308 void explode(struct thing *tp);
1313 void extinguish(int (*dfunc)()); 1309 void extinguish(void (*dfunc)());
1314 void fall(struct linked_list *item, bool pr); 1310 void fall(struct linked_list *item, bool pr);
1315 coord *fallpos(coord *pos, bool be_clear, int range); 1311 coord *fallpos(coord *pos, bool be_clear, int range);
1316 void fatal(char *s); 1312 void fatal(char *s);
1317 bool fight(coord *mp, struct object *weap, bool thrown); 1313 bool fight(coord *mp, struct object *weap, bool thrown);
1318 struct linked_list *find_mons(int y, int x); 1314 struct linked_list *find_mons(int y, int x);
1319 struct linked_list *find_obj(int y, int x); 1315 struct linked_list *find_obj(int y, int x);
1320 struct delayed_action *find_slot(int (*func)()); 1316 struct delayed_action *find_slot(void (*func)());
1321 int findmindex(char *name); 1317 int findmindex(char *name);
1322 void fix_stick(struct object *cur); 1318 void fix_stick(struct object *cur);
1323 void fright(struct thing *th); 1319 void fright(struct thing *th);
1324 void fumble(void); 1320 void fumble(void);
1325 void fuse(int (*dfunc)(), VOID *arg, int time, int type); 1321 void fuse(void (*dfunc)(), void *arg, int time, int type);
1326 void genmonsters(int least, bool treas); 1322 void genmonsters(int least, bool treas);
1327 coord get_coordinates(void); 1323 coord get_coordinates(void);
1328 bool get_dir(coord *direction); 1324 bool get_dir(coord *direction);
1329 struct linked_list *get_hurl(struct thing *tp); 1325 struct linked_list *get_hurl(struct thing *tp);
1330 struct linked_list *get_item(struct linked_list *list, char *purpose, int type, 1326 struct linked_list *get_item(struct linked_list *list, char *purpose, int type,
1357 bool invisible(struct thing *monst); 1353 bool invisible(struct thing *monst);
1358 bool is_current(struct object *obj); 1354 bool is_current(struct object *obj);
1359 bool is_magic(struct object *obj); 1355 bool is_magic(struct object *obj);
1360 bool isatrap(char ch); 1356 bool isatrap(char ch);
1361 int itemweight(struct object *wh); 1357 int itemweight(struct object *wh);
1362 void kill_daemon(int (*dfunc)()); 1358 void kill_daemon(void (*dfunc)());
1363 void killed(struct linked_list *item, bool pr, bool points, bool treasure); 1359 void killed(struct linked_list *item, bool pr, bool points, bool treasure);
1364 int land(void); 1360 void land(void);
1365 void lengthen(int (*dfunc)(), int xtime); 1361 void lengthen(void (*dfunc)(), int xtime);
1366 void light(coord *cp); 1362 void light(coord *cp);
1367 bool lit_room(struct room *rp); 1363 bool lit_room(struct room *rp);
1368 void look(bool wakeup, bool runend); 1364 void look(bool wakeup, bool runend);
1369 void lower_level(short who); 1365 void lower_level(short who);
1370 void m_use_relic(struct thing *monster); 1366 void m_use_relic(struct thing *monster);
1413 void quit(int sig); 1409 void quit(int sig);
1414 void raise_level(void); 1410 void raise_level(void);
1415 short randmonster(bool wander, bool no_unique); 1411 short randmonster(bool wander, bool no_unique);
1416 void read_scroll(int which, int flag, bool is_scroll); 1412 void read_scroll(int which, int flag, bool is_scroll);
1417 void reap(void); 1413 void reap(void);
1418 int res_strength(long howmuch); 1414 void res_strength(long howmuch);
1419 bool restore(char *file, char *envp[]); 1415 bool restore(char *file, char *envp[]);
1420 void restscr(WINDOW *scr); 1416 void restscr(WINDOW *scr);
1421 int ring_eat(int hand); 1417 int ring_eat(int hand);
1422 char *ring_num(struct object *obj); 1418 char *ring_num(struct object *obj);
1423 void ring_on(struct linked_list *item); 1419 void ring_on(struct linked_list *item);
1450 void sight(void); 1446 void sight(void);
1451 bool skirmish(struct thing *attacker, coord *mp, struct object *weap, 1447 bool skirmish(struct thing *attacker, coord *mp, struct object *weap,
1452 bool thrown); 1448 bool thrown);
1453 struct linked_list *spec_item(int type, int which, int hit, int damage); 1449 struct linked_list *spec_item(int type, int which, int hit, int damage);
1454 void spell_recovery(void); 1450 void spell_recovery(void);
1455 void start_daemon(int (*dfunc)(), VOID *arg, int type); 1451 void start_daemon(void (*dfunc)(), void *arg, int type);
1456 void status(bool display); 1452 void status(bool display);
1457 void steal(void); 1453 void steal(void);
1458 bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr); 1454 bool step_ok(int y, int x, int can_on_monst, struct thing *flgptr);
1459 void stomach(void); 1455 void stomach(void);
1460 int str_compute(void); 1456 int str_compute(void);
1473 struct trap *trap_at(int y, int x); 1469 struct trap *trap_at(int y, int x);
1474 void trap_look(void); 1470 void trap_look(void);
1475 void unchoke(void); 1471 void unchoke(void);
1476 void unclrhead(void); 1472 void unclrhead(void);
1477 void unconfuse(void); 1473 void unconfuse(void);
1478 int undance(void); 1474 void undance(void);
1479 void unphase(void); 1475 void unphase(void);
1480 void unsee(void); 1476 void unsee(void);
1481 void unskill(void); 1477 void unskill(void);
1482 void unstink(void); 1478 void unstink(void);
1483 void updpack(int getmax, struct thing *tp); 1479 void updpack(int getmax, struct thing *tp);
1646 extern char *retstr; 1642 extern char *retstr;
1647 extern FILE *scorefi; 1643 extern FILE *scorefi;
1648 extern FILE *logfile; 1644 extern FILE *logfile;
1649 extern LEVTYPE levtype; 1645 extern LEVTYPE levtype;
1650 extern int (*add_abil[NUMABILITIES])(int); /* Functions to change abilities */ 1646 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()) */ 1647 extern int mf_count; /* move_free counter - see actions.c(m_act()) */
1653 extern int mf_jmpcnt; /* move_free counter for # of jumps */ 1648 extern int mf_jmpcnt; /* move_free counter for # of jumps */
1654 extern int killed_chance; /* cumulative chance for goodies to loose it, fight.c */ 1649 extern int killed_chance; /* cumulative chance for goodies to loose it, fight.c */
1655 extern coord move_nh; /* move.c */ 1650 extern coord move_nh; /* move.c */
1656 #define NCOLORS 32 1651 #define NCOLORS 32