Prefer [[maybe_unused]] over UNUSED2

`[[maybe_unused]]` is in the C++ standard.
This commit is contained in:
phosit
2025-05-21 12:29:47 +02:00
committed by Phosit
parent 5be02743fa
commit eb3f0166f8
27 changed files with 83 additions and 196 deletions
+2 -6
View File
@@ -46,7 +46,7 @@ public:
{
}
void Put(const char* name, const u8* data, size_t len)
void Put([[maybe_unused]] const char* name, const u8* data, size_t len)
{
#if DEBUG_SERIALIZER_ANNOTATE
std::string tag = "<";
@@ -54,8 +54,6 @@ public:
tag.append(">");
memcpy(m_Buffer, tag.c_str(), tag.length());
m_Buffer += tag.length();
#else
UNUSED2(name);
#endif
memcpy(m_Buffer, data, len);
m_Buffer += len;
@@ -89,13 +87,11 @@ public:
{
}
void Put(const char* name, const u8* /*data*/, size_t len)
void Put([[maybe_unused]] const char* name, const u8* /*data*/, size_t len)
{
#if DEBUG_SERIALIZER_ANNOTATE
m_Length += 2; // '<' and '>'
m_Length += strlen(name);
#else
UNUSED2(name);
#endif
m_Length += len;
}