Don't use new as a variable name

It conflicts with the C++ keyword
This commit is contained in:
Rangi
2021-11-24 22:48:28 -05:00
parent 8435a29c4e
commit d073cffa74

View File

@@ -400,16 +400,16 @@ uint32_t lexer_GetIFDepth(void)
void lexer_IncIFDepth(void) void lexer_IncIFDepth(void)
{ {
struct IfStack *new = malloc(sizeof(*new)); struct IfStack *ifStack = malloc(sizeof(*ifStack));
if (!new) if (!ifStack)
fatalerror("Unable to allocate new IF depth: %s\n", strerror(errno)); fatalerror("Unable to allocate new IF depth: %s\n", strerror(errno));
new->ranIfBlock = false; ifStack->ranIfBlock = false;
new->reachedElseBlock = false; ifStack->reachedElseBlock = false;
new->next = lexerState->ifStack; ifStack->next = lexerState->ifStack;
lexerState->ifStack = new; lexerState->ifStack = ifStack;
} }
void lexer_DecIFDepth(void) void lexer_DecIFDepth(void)
@@ -677,19 +677,19 @@ static void beginExpansion(char const *str, bool owned, char const *name)
} }
} }
struct Expansion *new = malloc(sizeof(*new)); struct Expansion *exp = malloc(sizeof(*exp));
if (!new) if (!exp)
fatalerror("Unable to allocate new expansion: %s\n", strerror(errno)); fatalerror("Unable to allocate new expansion: %s\n", strerror(errno));
new->parent = lexerState->expansions; exp->parent = lexerState->expansions;
new->name = name ? strdup(name) : NULL; exp->name = name ? strdup(name) : NULL;
new->contents.unowned = str; exp->contents.unowned = str;
new->size = size; exp->size = size;
new->offset = 0; exp->offset = 0;
new->owned = owned; exp->owned = owned;
lexerState->expansions = new; lexerState->expansions = exp;
} }
static void freeExpansion(struct Expansion *expansion) static void freeExpansion(struct Expansion *expansion)