From 7585cbb758b7bc2169cba42b7665d46f0c57db93 Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 28 Oct 2021 16:37:38 -0700 Subject: map: Use separately allocated struct map --- pp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'pp.c') 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(¯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); -- cgit v1.2.3