summaryrefslogtreecommitdiff
path: root/opcodes/mep-asm.c
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2021-06-27 02:17:27 -0400
committerMike Frysinger <vapier@gentoo.org>2021-07-01 18:04:16 -0400
commitf375d32b35cef9813410107430963d51600d6896 (patch)
tree944bd762589e74a7da1b388761c0b79ab962f588 /opcodes/mep-asm.c
parent9b2beaf7788e328f5a954da24b4db13f9ba40465 (diff)
downloadbinutils-gdb-f375d32b35cef9813410107430963d51600d6896.tar.gz
opcodes: constify & local meps macros
Avoid exporting this common variable name into writable data.
Diffstat (limited to 'opcodes/mep-asm.c')
-rw-r--r--opcodes/mep-asm.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/opcodes/mep-asm.c b/opcodes/mep-asm.c
index 78c4066049c..b2fae277733 100644
--- a/opcodes/mep-asm.c
+++ b/opcodes/mep-asm.c
@@ -582,7 +582,7 @@ typedef struct
int len;
} arg;
-macro macros[] =
+static macro const macros[] =
{
{ "sizeof", "(`1.end + (- `1))"},
{ "startof", "(`1 | 0)" },
@@ -615,10 +615,10 @@ str_append (char *dest, const char *input, int len)
return strncat (new_dest, input, len);
}
-static macro *
+static const macro *
lookup_macro (const char *name)
{
- macro *m;
+ const macro *m;
for (m = macros; m->name; ++m)
if (strncmp (m->name, name, strlen(m->name)) == 0)
@@ -628,7 +628,7 @@ lookup_macro (const char *name)
}
static char *
-expand_macro (arg *args, int narg, macro *mac)
+expand_macro (arg *args, int narg, const macro *mac)
{
char *result = 0, *rescanned_result = 0;
char *e = mac->expansion;
@@ -678,7 +678,7 @@ expand_string (const char *in, int first_only)
arg args[MAXARGS];
int state = IN_TEXT;
const char *mark = in;
- macro *pmacro = NULL;
+ const macro *pmacro = NULL;
char *expansion = 0;
char *result = 0;