From 13904dc536ec652111aab1ec99e3a203369a8e9c Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Sun, 3 Mar 2024 21:26:44 -0500 Subject: [PATCH] Remove EQUS callbacks for symbols They're no longer used since `__FILE__` was removed --- include/asm/symbol.hpp | 2 -- src/asm/lexer.cpp | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/asm/symbol.hpp b/include/asm/symbol.hpp index 390aee0c..b239bb49 100644 --- a/include/asm/symbol.hpp +++ b/include/asm/symbol.hpp @@ -40,7 +40,6 @@ struct Symbol { int32_t (*numCallback)(); // If isNumeric() and hasCallback std::string_view *macro; // For SYM_MACRO std::string *equs; // For SYM_EQUS - char const *(*strCallback)(); // For SYM_EQUS if hasCallback }; uint32_t ID; // ID of the symbol in the object file (-1 if none) @@ -61,7 +60,6 @@ struct Symbol { int32_t getValue() const; uint32_t getConstantValue() const; - char const *getStringValue() const { return hasCallback ? strCallback() : equs->c_str(); } }; void sym_ForEach(void (*func)(Symbol &)); diff --git a/src/asm/lexer.cpp b/src/asm/lexer.cpp index 673c589f..321f1e25 100644 --- a/src/asm/lexer.cpp +++ b/src/asm/lexer.cpp @@ -1262,7 +1262,7 @@ static char const *readInterpolation(size_t depth) if (!sym) { error("Interpolated symbol \"%s\" does not exist\n", symName); } else if (sym->type == SYM_EQUS) { - fmt.printString(buf, sizeof(buf), sym->getStringValue()); + fmt.printString(buf, sizeof(buf), sym->equs->c_str()); return buf; } else if (sym->isNumeric()) { fmt.printNumber(buf, sizeof(buf), sym->getConstantValue()); @@ -1894,7 +1894,7 @@ static int yylex_NORMAL() Symbol const *sym = sym_FindExactSymbol(yylval.symName); if (sym && sym->type == SYM_EQUS) { - char const *s = sym->getStringValue(); + char const *s = sym->equs->c_str(); assert(s); if (s[0])