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;
{
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;
}

View File

@ -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));
}