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:
@@ -60,7 +60,7 @@ void CStdDeserializer::TraceMember(JSTracer *trc)
|
||||
JS::TraceEdge(trc, &backref, "StdDeserializer::m_ScriptBackrefs");
|
||||
}
|
||||
|
||||
void CStdDeserializer::Get(const char* name, u8* data, size_t len)
|
||||
void CStdDeserializer::Get([[maybe_unused]] const char* name, u8* data, size_t len)
|
||||
{
|
||||
#if DEBUG_SERIALIZER_ANNOTATE
|
||||
std::string strName;
|
||||
@@ -75,8 +75,6 @@ void CStdDeserializer::Get(const char* name, u8* data, size_t len)
|
||||
strName += c;
|
||||
}
|
||||
ENSURE(strName == name);
|
||||
#else
|
||||
UNUSED2(name);
|
||||
#endif
|
||||
m_Stream.read((char*)data, (std::streamsize)len);
|
||||
if (!m_Stream.good())
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2017 Wildfire Games.
|
||||
/* Copyright (C) 2025 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@@ -35,14 +35,12 @@ public:
|
||||
m_Stream.flush();
|
||||
}
|
||||
|
||||
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_Stream.put('<');
|
||||
m_Stream.write(name, strlen(name));
|
||||
m_Stream.put('>');
|
||||
#else
|
||||
UNUSED2(name);
|
||||
#endif
|
||||
m_Stream.write((const char*)data, (std::streamsize)len);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user