comparison rogue4/fight.c @ 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 0990adf580ee
children e7aab31362af
comparison
equal deleted inserted replaced
232:bac2c81fec78 239:837044d2c362
20 10L,20L,40L,80L,160L,320L,640L,1280L,2560L,5120L,10240L,20480L, 20 10L,20L,40L,80L,160L,320L,640L,1280L,2560L,5120L,10240L,20480L,
21 40920L, 81920L, 163840L, 327680L, 655360L, 1310720L, 2621440L, 0L 21 40920L, 81920L, 163840L, 327680L, 655360L, 1310720L, 2621440L, 0L
22 }; 22 };
23 23
24 bool roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl); 24 bool roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl);
25 void hit(char *er, char *ee); 25 void hit(const char *er, const char *ee);
26 void miss(char *er, char *ee); 26 void miss(const char *er, const char *ee);
27 int str_plus(str_t str); 27 int str_plus(str_t str);
28 int add_dam(str_t str); 28 int add_dam(str_t str);
29 void thunk(THING *weap, const char *mname); 29 void thunk(THING *weap, const char *mname);
30 void bounce(THING *weap, const char *mname); 30 void bounce(THING *weap, const char *mname);
31 31
444 /* 444 /*
445 * prname: 445 * prname:
446 * The print name of a combatant 446 * The print name of a combatant
447 */ 447 */
448 char * 448 char *
449 prname(char *who, bool upper) 449 prname(const char *who, bool upper)
450 { 450 {
451 static char tbuf[MAXSTR]; 451 static char tbuf[MAXSTR];
452 452
453 *tbuf = '\0'; 453 *tbuf = '\0';
454 if (who == 0) 454 if (who == 0)
468 /* 468 /*
469 * hit: 469 * hit:
470 * Print a message to indicate a succesful hit 470 * Print a message to indicate a succesful hit
471 */ 471 */
472 void 472 void
473 hit(char *er, char *ee) 473 hit(const char *er, const char *ee)
474 { 474 {
475 register char *s = ""; 475 register char *s = "";
476 476
477 addmsg(prname(er, TRUE)); 477 addmsg(prname(er, TRUE));
478 if (terse) 478 if (terse)
494 /* 494 /*
495 * miss: 495 * miss:
496 * Print a message to indicate a poor swing 496 * Print a message to indicate a poor swing
497 */ 497 */
498 void 498 void
499 miss(char *er, char *ee) 499 miss(const char *er, const char *ee)
500 { 500 {
501 register char *s = ""; 501 register char *s = "";
502 502
503 addmsg(prname(er, TRUE)); 503 addmsg(prname(er, TRUE));
504 switch (terse ? 0 : rnd(4)) 504 switch (terse ? 0 : rnd(4))