mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-21 10:42:07 +00:00
Use std::string for symbol/section/node names and assertion messages
This commit is contained in:
@@ -16,8 +16,9 @@ std::map<std::string, struct Symbol *> symbols;
|
||||
void sym_AddSymbol(struct Symbol *symbol)
|
||||
{
|
||||
// Check if the symbol already exists
|
||||
if (struct Symbol *other = sym_GetSymbol(symbol->name); other) {
|
||||
fprintf(stderr, "error: \"%s\" both in %s from ", symbol->name, symbol->objFileName);
|
||||
if (struct Symbol *other = sym_GetSymbol(*symbol->name); other) {
|
||||
fprintf(stderr, "error: \"%s\" both in %s from ", symbol->name->c_str(),
|
||||
symbol->objFileName);
|
||||
dumpFileStack(symbol->src);
|
||||
fprintf(stderr, "(%" PRIu32 ") and in %s from ",
|
||||
symbol->lineNo, other->objFileName);
|
||||
@@ -27,10 +28,10 @@ void sym_AddSymbol(struct Symbol *symbol)
|
||||
}
|
||||
|
||||
// If not, add it
|
||||
symbols[symbol->name] = symbol;
|
||||
symbols[*symbol->name] = symbol;
|
||||
}
|
||||
|
||||
struct Symbol *sym_GetSymbol(char const *name)
|
||||
struct Symbol *sym_GetSymbol(std::string const &name)
|
||||
{
|
||||
auto search = symbols.find(name);
|
||||
return search != symbols.end() ? search->second : NULL;
|
||||
|
||||
Reference in New Issue
Block a user