Pass std::string references to symbol functions

This commit is contained in:
Rangi42
2024-03-18 13:29:09 -04:00
committed by Sylvie
parent 6cabb8c9af
commit 472d1bde06
9 changed files with 174 additions and 153 deletions

View File

@@ -558,7 +558,7 @@ static uint32_t readBracketedMacroArgNum() {
shiftChar();
}
Symbol const *sym = sym_FindScopedValidSymbol(symName.c_str());
Symbol const *sym = sym_FindScopedValidSymbol(symName);
if (!sym) {
error("Bracketed symbol \"%s\" does not exist\n", symName.c_str());
@@ -1188,7 +1188,7 @@ static char const *readInterpolation(size_t depth) {
static char buf[MAXSTRLEN + 1];
Symbol const *sym = sym_FindScopedValidSymbol(fmtBuf.c_str());
Symbol const *sym = sym_FindScopedValidSymbol(fmtBuf);
if (!sym) {
error("Interpolated symbol \"%s\" does not exist\n", fmtBuf.c_str());
@@ -1820,8 +1820,7 @@ static Token yylex_NORMAL() {
// Local symbols cannot be string expansions
if (token.type == T_(ID) && lexerState->expandStrings) {
// Attempt string expansion
Symbol const *sym =
sym_FindExactSymbol(std::get<std::string>(token.value).c_str());
Symbol const *sym = sym_FindExactSymbol(std::get<std::string>(token.value));
if (sym && sym->type == SYM_EQUS) {
char const *str = sym->getEqus()->c_str();