diff --git a/database/DBlabel.c b/database/DBlabel.c index 388c9da6..1766496d 100644 --- a/database/DBlabel.c +++ b/database/DBlabel.c @@ -1549,7 +1549,7 @@ DBLoadFont(fontfile, scale) float scale; { FILE *ff; - char *ascii_names[] = { + const char * const ascii_names[] = { "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", @@ -1654,7 +1654,7 @@ DBLoadFont(fontfile, scale) { if (psname != NULL) { - asciiidx = LookupStructFull(psname, ascii_names, sizeof(char *)); + asciiidx = LookupStructFull(psname, ascii_names, sizeof(const char *)); if (asciiidx >= 0) chardef = 2; } diff --git a/textio/txInput.c b/textio/txInput.c index 7a22eafb..3a6ef16d 100644 --- a/textio/txInput.c +++ b/textio/txInput.c @@ -105,11 +105,11 @@ char *magic_direction_list[] = { #define DIRECT_COMPL 10 /* Can only accommodate 32 arg options, increase as necessary */ -static struct cmd_spec { - char *cmd; +static const struct cmd_spec { + const char *cmd; int type; char *args[32]; -} magic_cmd_spec[] = { +} const magic_cmd_spec[] = { { "", COMMAND_COMPL, {(char *)NULL} }, { "help", COMMAND_COMPL, {(char *)NULL} }, @@ -595,13 +595,13 @@ magic_completion_function(char *text, int start, int end) strcat(line, " "); } - entry = LookupStructFull(line, (char **)&magic_cmd_spec, + entry = LookupStructFull(line, (const char * const *)&magic_cmd_spec, sizeof(struct cmd_spec)); if (entry == -1 && num_tokens >= 1) { sprintf(line, "%s*", tokens[0]); - entry = LookupStructFull(line, (char **)&magic_cmd_spec, + entry = LookupStructFull(line, (const char * const *)&magic_cmd_spec, sizeof(struct cmd_spec)); }