diff options
author | Michael Forney <mforney@mforney.org> | 2021-10-28 16:37:38 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2024-03-24 02:22:23 -0700 |
commit | 7585cbb758b7bc2169cba42b7665d46f0c57db93 (patch) | |
tree | 96f76517c06e5f0bc5ff4c310a15872c32520f46 /pp.c | |
parent | 0ab9f3793fa43afd7d941ff674cc642e20188d45 (diff) |
map: Use separately allocated struct map
Diffstat (limited to 'pp.c')
-rw-r--r-- | pp.c | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -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(¯os, 64); next(); } @@ -112,7 +112,7 @@ macroget(char *name) struct mapkey k; mapkey(&k, name, strlen(name)); - return mapget(macros, &k); + return mapget(¯os, &k); } static void @@ -272,7 +272,7 @@ define(void) tok = *t; mapkey(&k, m->name, strlen(m->name)); - entry = mapput(macros, &k); + entry = mapput(¯os, &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(¯os, &k); m = *entry; if (m) { free(name); |