Skip to content

Commit

Permalink
Make keynames array static const
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-drexler committed Dec 22, 2023
1 parent 67df9da commit 13a00f1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Quake/keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ typedef struct
int keynum;
} keyname_t;

keyname_t keynames[] =
static const keyname_t keynames[] =
{
{"TAB", K_TAB},
{"ENTER", K_ENTER},
Expand Down Expand Up @@ -630,7 +630,7 @@ the K_* names are matched up.
*/
int Key_StringToKeynum (const char *str)
{
keyname_t *kn;
const keyname_t *kn;

if (!str || !str[0])
return -1;
Expand All @@ -657,7 +657,7 @@ FIXME: handle quote special (general escape sequence?)
const char *Key_KeynumToString (int keynum)
{
static char tinystr[128][2];
keyname_t *kn;
const keyname_t *kn;

if (keynum == -1)
return "<KEY NOT FOUND>";
Expand Down

0 comments on commit 13a00f1

Please sign in to comment.