aboutsummaryrefslogtreecommitdiff
path: root/pp.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2021-10-28 16:37:38 -0700
committerMichael Forney <mforney@mforney.org>2024-03-24 02:22:23 -0700
commit7585cbb758b7bc2169cba42b7665d46f0c57db93 (patch)
tree96f76517c06e5f0bc5ff4c310a15872c32520f46 /pp.c
parent0ab9f3793fa43afd7d941ff674cc642e20188d45 (diff)
map: Use separately allocated struct map
Diffstat (limited to 'pp.c')
-rw-r--r--pp.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/pp.c b/pp.c
index 361cf69..09d1a06 100644
--- a/pp.c
+++ b/pp.c
@@ -51,14 +51,14 @@ struct frame {
enum ppflags ppflags;
static struct array ctx;
-static struct map *macros;
+static struct map macros;
/* number of macros currently undergoing expansion */
static size_t macrodepth;
void
ppinit(void)
{
- macros = mkmap(64);
+ mapinit(&macros, 64);
next();
}
@@ -112,7 +112,7 @@ macroget(char *name)
struct mapkey k;
mapkey(&k, name, strlen(name));
- return mapget(macros, &k);
+ return mapget(&macros, &k);
}
static void
@@ -272,7 +272,7 @@ define(void)
tok = *t;
mapkey(&k, m->name, strlen(m->name));
- entry = mapput(macros, &k);
+ entry = mapput(&macros, &k);
if (*entry && !macroequal(m, *entry))
error(&tok.loc, "redefinition of macro '%s'", m->name);
*entry = m;
@@ -288,7 +288,7 @@ undef(void)
name = tokencheck(&tok, TIDENT, "after #undef");
mapkey(&k, name, strlen(name));
- entry = mapput(macros, &k);
+ entry = mapput(&macros, &k);
m = *entry;
if (m) {
free(name);