Replace some [[maybe_unused]] annotations with commented names

Remove the [[maybe_unused]] annotation from various parameters that are
unconditionally unused and comment out their names instead. This makes
it unambiguous that the variables are unused, while making the remaining
[[maybe_unused]] annotations more reliable indicators that those
variables are in fact used in some contexts.

These parameters are mostly in overridden functions where the override
doesn't need that particular variable.
This commit is contained in:
Dentomologist
2026-05-03 17:09:59 -07:00
parent eb44b64c9e
commit 34646cb9a9
8 changed files with 25 additions and 22 deletions
@@ -15,7 +15,7 @@ ConsoleListener::~ConsoleListener()
{
}
void ConsoleListener::Log([[maybe_unused]] Common::Log::LogLevel level, const char* text)
void ConsoleListener::Log(Common::Log::LogLevel, const char* text)
{
::OutputDebugStringW(UTF8ToWString(text).c_str());
}
@@ -57,7 +57,7 @@ void Microphone::StreamInit()
{
}
void Microphone::StreamStart([[maybe_unused]] u32 sampling_rate)
void Microphone::StreamStart(u32 /* sampling_rate */)
{
}
+8 -7
View File
@@ -34,7 +34,7 @@ bool NullGfx::SupportsUtilityDrawing() const
}
std::unique_ptr<AbstractTexture> NullGfx::CreateTexture(const TextureConfig& config,
[[maybe_unused]] std::string_view name)
std::string_view /* name */)
{
return std::make_unique<NullTexture>(config);
}
@@ -52,16 +52,17 @@ public:
};
std::unique_ptr<AbstractShader>
NullGfx::CreateShaderFromSource(ShaderStage stage, [[maybe_unused]] std::string_view source,
[[maybe_unused]] VideoCommon::ShaderIncluder* shader_includer,
[[maybe_unused]] std::string_view name)
NullGfx::CreateShaderFromSource(ShaderStage stage, std::string_view /* source */,
VideoCommon::ShaderIncluder* /* shader_includer */,
std::string_view /* name */)
{
return std::make_unique<NullShader>(stage);
}
std::unique_ptr<AbstractShader>
NullGfx::CreateShaderFromBinary(ShaderStage stage, const void* data, size_t length,
[[maybe_unused]] std::string_view name)
std::unique_ptr<AbstractShader> NullGfx::CreateShaderFromBinary(ShaderStage stage,
const void* /* data */,
size_t /* length */,
std::string_view /* name */)
{
return std::make_unique<NullShader>(stage);
}
+4 -3
View File
@@ -235,9 +235,10 @@ OGLGfx::CreateShaderFromSource(ShaderStage stage, std::string_view source,
return OGLShader::CreateFromSource(stage, source, shader_includer, name);
}
std::unique_ptr<AbstractShader>
OGLGfx::CreateShaderFromBinary(ShaderStage stage, const void* data, size_t length,
[[maybe_unused]] std::string_view name)
std::unique_ptr<AbstractShader> OGLGfx::CreateShaderFromBinary(ShaderStage /* stage */,
const void* /* data */,
size_t /* length */,
std::string_view /* name */)
{
return nullptr;
}
+8 -7
View File
@@ -35,7 +35,7 @@ bool SWGfx::SupportsUtilityDrawing() const
}
std::unique_ptr<AbstractTexture> SWGfx::CreateTexture(const TextureConfig& config,
[[maybe_unused]] std::string_view name)
std::string_view /* name */)
{
return std::make_unique<SWTexture>(config);
}
@@ -77,16 +77,17 @@ public:
};
std::unique_ptr<AbstractShader>
SWGfx::CreateShaderFromSource(ShaderStage stage, [[maybe_unused]] std::string_view source,
[[maybe_unused]] VideoCommon::ShaderIncluder* shader_includer,
[[maybe_unused]] std::string_view name)
SWGfx::CreateShaderFromSource(ShaderStage stage, std::string_view /* source */,
VideoCommon::ShaderIncluder* /* shader_includer */,
std::string_view /* name */)
{
return std::make_unique<SWShader>(stage);
}
std::unique_ptr<AbstractShader>
SWGfx::CreateShaderFromBinary(ShaderStage stage, const void* data, size_t length,
[[maybe_unused]] std::string_view name)
std::unique_ptr<AbstractShader> SWGfx::CreateShaderFromBinary(ShaderStage stage,
const void* /* data */,
size_t /* length */,
std::string_view /* name */)
{
return std::make_unique<SWShader>(stage);
}
+1 -1
View File
@@ -143,7 +143,7 @@ void InvalidateAll()
// On invalidate cache:
// 1. invalidate all texture units.
void Invalidate([[maybe_unused]] u32 param)
void Invalidate(u32 /* param */)
{
// The exact arguments of Invalidate commands is currently unknown.
// It appears to contain the TMEM address and a size.
@@ -24,7 +24,7 @@ constexpr float PosScale(T val, float scale)
}
template <>
constexpr float PosScale(float val, [[maybe_unused]] float scale)
constexpr float PosScale(float val, float /* scale */)
{
return val;
}
@@ -26,7 +26,7 @@ constexpr float TCScale(T val, float scale)
}
template <>
constexpr float TCScale(float val, [[maybe_unused]] float scale)
constexpr float TCScale(float val, float /* scale */)
{
return val;
}