add missing const

If you want to declare a pointer which the address pointed to is constant,
you should declare it as like `static const char *const var = "...";`.

This commit supplies missing `const` and prevents some programming
error in the future.
This commit is contained in:
SHIRAKATA Kentaro
2021-10-28 00:27:03 +09:00
committed by PatR
parent 893d11f7d5
commit cf810630de
28 changed files with 60 additions and 60 deletions

View File

@@ -480,7 +480,7 @@ dxdy_to_dist_descr(int dx, int dy, boolean fulldir)
/* explicit direction; 'one step' is implicit */
Sprintf(buf, "%s", directionname(dst));
} else {
static const char *dirnames[4][2] = {
static const char *const dirnames[4][2] = {
{ "n", "north" },
{ "s", "south" },
{ "w", "west" },
@@ -2380,8 +2380,8 @@ coyotename(struct monst *mtmp, char *buf)
char *
rndorcname(char *s)
{
static const char *v[] = { "a", "ai", "og", "u" };
static const char *snd[] = { "gor", "gris", "un", "bane", "ruk",
static const char *const v[] = { "a", "ai", "og", "u" };
static const char *const snd[] = { "gor", "gris", "un", "bane", "ruk",
"oth","ul", "z", "thos","akh","hai" };
int i, iend = rn1(2, 3), vstart = rn2(2);