LookupStructFull() constify call-site

txInput.c: LookupStructFull() constify call-site
DBlabel.c: LookupStructFull() constify call-site
This commit is contained in:
Darryl L. Miles 2024-10-10 20:11:37 +01:00 committed by Tim Edwards
parent f5b41a06d6
commit fb8f7b94aa
2 changed files with 7 additions and 7 deletions

View File

@ -1549,7 +1549,7 @@ DBLoadFont(fontfile, scale)
float scale; float scale;
{ {
FILE *ff; FILE *ff;
char *ascii_names[] = { const char * const ascii_names[] = {
"space", "exclam", "quotedbl", "numbersign", "dollar", "space", "exclam", "quotedbl", "numbersign", "dollar",
"percent", "ampersand", "quoteright", "parenleft", "parenright", "percent", "ampersand", "quoteright", "parenleft", "parenright",
"asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero",
@ -1654,7 +1654,7 @@ DBLoadFont(fontfile, scale)
{ {
if (psname != NULL) if (psname != NULL)
{ {
asciiidx = LookupStructFull(psname, ascii_names, sizeof(char *)); asciiidx = LookupStructFull(psname, ascii_names, sizeof(const char *));
if (asciiidx >= 0) if (asciiidx >= 0)
chardef = 2; chardef = 2;
} }

View File

@ -105,11 +105,11 @@ char *magic_direction_list[] = {
#define DIRECT_COMPL 10 #define DIRECT_COMPL 10
/* Can only accommodate 32 arg options, increase as necessary */ /* Can only accommodate 32 arg options, increase as necessary */
static struct cmd_spec { static const struct cmd_spec {
char *cmd; const char *cmd;
int type; int type;
char *args[32]; char *args[32];
} magic_cmd_spec[] = { } const magic_cmd_spec[] = {
{ "", COMMAND_COMPL, {(char *)NULL} }, { "", COMMAND_COMPL, {(char *)NULL} },
{ "help", COMMAND_COMPL, {(char *)NULL} }, { "help", COMMAND_COMPL, {(char *)NULL} },
@ -595,13 +595,13 @@ magic_completion_function(char *text, int start, int end)
strcat(line, " "); strcat(line, " ");
} }
entry = LookupStructFull(line, (char **)&magic_cmd_spec, entry = LookupStructFull(line, (const char * const *)&magic_cmd_spec,
sizeof(struct cmd_spec)); sizeof(struct cmd_spec));
if (entry == -1 && num_tokens >= 1) if (entry == -1 && num_tokens >= 1)
{ {
sprintf(line, "%s*", tokens[0]); 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)); sizeof(struct cmd_spec));
} }