Declare some function arguments as const.

Some functions, mostly in fight.c, declared variables as pointers to
const char but passed them to functions that took pointers to ordinary
char.  The strings did not actually get modified, so adding 'const' to
the function definitions removed the warnings.
This commit is contained in:
John "Elwin" Edwards 2016-03-06 19:32:47 -05:00
parent 35bea2ba0d
commit 5cf0194676
4 changed files with 23 additions and 21 deletions

View file

@ -22,8 +22,8 @@ long e_levels[] = {
};
bool roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl);
void hit(char *er, char *ee);
void miss(char *er, char *ee);
void hit(const char *er, const char *ee);
void miss(const char *er, const char *ee);
int str_plus(str_t str);
int add_dam(str_t str);
void thunk(THING *weap, const char *mname);
@ -446,7 +446,7 @@ roll_em(THING *thatt, THING *thdef, THING *weap, bool hurl)
* The print name of a combatant
*/
char *
prname(char *who, bool upper)
prname(const char *who, bool upper)
{
static char tbuf[MAXSTR];
@ -470,7 +470,7 @@ prname(char *who, bool upper)
* Print a message to indicate a succesful hit
*/
void
hit(char *er, char *ee)
hit(const char *er, const char *ee)
{
register char *s = "";
@ -496,7 +496,7 @@ hit(char *er, char *ee)
* Print a message to indicate a poor swing
*/
void
miss(char *er, char *ee)
miss(const char *er, const char *ee)
{
register char *s = "";