mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 01:43:00 +02:00
LookupStructFull() constify call-site
txInput.c: LookupStructFull() constify call-site DBlabel.c: LookupStructFull() constify call-site
This commit is contained in:
committed by
Tim Edwards
parent
f5b41a06d6
commit
fb8f7b94aa
+2
-2
@@ -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;
|
||||
}
|
||||
|
||||
+5
-5
@@ -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));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user