mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Prefer [[maybe_unused]] over UNUSED2
`[[maybe_unused]]` is in the C++ standard.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user