aboutsummaryrefslogtreecommitdiff
path: root/source/Ires.cpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-05-06 19:52:12 -0700
committerrtk0c <[email protected]>2022-05-06 19:52:12 -0700
commitcde94efdd44553f3f6575ce84b44c6799e1a1425 (patch)
tree593b9f280f2e223268f8d5c73f5d1dd1aba50c36 /source/Ires.cpp
parent4c9f5ee706faa1435b7dc2f3b6d4753e1289c351 (diff)
Changeset: 22 Improved camera and various cleanups
Diffstat (limited to 'source/Ires.cpp')
-rw-r--r--source/Ires.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/Ires.cpp b/source/Ires.cpp
index 346e6e6..0421a54 100644
--- a/source/Ires.cpp
+++ b/source/Ires.cpp
@@ -303,10 +303,12 @@ std::pair<IresObject*, bool> IresManager::Add(IresObject* ires) {
auto& name = ires->mName;
if (name.empty()) {
int n = std::rand();
+#define IRES_NAME_ERR_MESSAGE "Unnamed %s #%d", IresObject::ToString(ires->GetKind()).data(), n
// NOTE: does not include null-terminator
- int size = snprintf(nullptr, 0, "Unnamed %s #%d", IresObject::ToString(ires->GetKind()).data(), n);
+ int size = snprintf(nullptr, 0, IRES_NAME_ERR_MESSAGE);
name.resize(size); // std::string::resize handles storage for null-terminator alreaedy
- snprintf(name.data(), size, "Unnamed %s #%d", IresObject::ToString(ires->GetKind()).data(), n);
+ snprintf(name.data(), size, IRES_NAME_ERR_MESSAGE);
+#undef IRES_NAME_ERR_MESSAGE
}
auto& uid = ires->mUid;