mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-23 22:27:06 +00:00
Avoid allocating for our linkdef names (#2111)
This reverts a change introduced in fd78a9ae8, though it wasn't that commit's main point
so I'm feeling okay with undoing that.
This feels like an overkill change, using a static string is good enough for this
since we never modify this. I have considered using `string_view` instead, to have
the best of both worlds, but that's not NUL-terminated so our print functions
get a little grumpy.
This commit is contained in:
@@ -115,8 +115,8 @@ static void mergeSections(Section &target, std::unique_ptr<Section> &&other) {
|
||||
*other,
|
||||
"Section \"%s\" is defined with type `%s`, but also with type `%s`",
|
||||
target.name.c_str(),
|
||||
target.typeInfo().name.c_str(),
|
||||
other->typeInfo().name.c_str()
|
||||
target.typeInfo().name,
|
||||
other->typeInfo().name
|
||||
);
|
||||
}
|
||||
|
||||
@@ -190,7 +190,7 @@ void sect_AddSection(std::unique_ptr<Section> &§ion) {
|
||||
fatal(
|
||||
"Section \"%s\" is of type `%s`, which cannot be `UNION`ized",
|
||||
section->name.c_str(),
|
||||
section->typeInfo().name.c_str()
|
||||
section->typeInfo().name
|
||||
);
|
||||
} else {
|
||||
sections.add(section->name, std::move(section));
|
||||
@@ -262,7 +262,7 @@ static void doSanityChecks(Section §ion) {
|
||||
error(
|
||||
"Section \"%s\" has type `%s`, which cannot be aligned to $%04x bytes",
|
||||
section.name.c_str(),
|
||||
typeInfo.name.c_str(),
|
||||
typeInfo.name,
|
||||
section.alignMask + 1
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user