ref: 708606ab83aee502a7c10dada1c25b47cb98fa1c
parent: ceb3249242e24256e060f24f99de47d35f36a1a5
author: Jonathan Dowland <jon@dow.land>
date: Thu Feb 28 17:11:58 EST 2019
add const to const static arrays and members pre-empting turol at Fabian's suggestion ;) Although I've gone one const deeper than we seem to have elsewhere!
--- a/src/net_petname.c
+++ b/src/net_petname.c
@@ -21,7 +21,7 @@
#include "doomtype.h"
#include "m_misc.h"
-static char *adjectives[] = {
+static const char * const adjectives [] = {
"Grumpy",
"Ecstatic",
"Surly",
@@ -65,7 +65,7 @@
"Baby",
};
-static char *nouns[] = {
+static const char * const nouns[] = {
"Frad",
// Doom
"Cacodemon",
@@ -109,7 +109,7 @@
char *NET_GetRandomPetName()
{
- char *a, *n;
+ const char *a, *n;
InitPetName();
a = adjectives[rand() % arrlen(adjectives)];