mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
Remove UNUSED
The `UNUSED` macro is used to mark a variable as unused but with a name. Those usages are replaced with comments so that `UNUSED` can be removed. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-unused
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2024 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
|
||||
@@ -653,7 +653,7 @@ QUERYHANDLER(VFSFileRealPath)
|
||||
msg->realPath = realPathname.string();
|
||||
}
|
||||
|
||||
static Status AddToFilenames(const VfsPath& pathname, const CFileInfo& UNUSED(fileInfo), const uintptr_t cbData)
|
||||
static Status AddToFilenames(const VfsPath& pathname, const CFileInfo& /*fileInfo*/, const uintptr_t cbData)
|
||||
{
|
||||
std::vector<std::wstring>& filenames = *(std::vector<std::wstring>*)cbData;
|
||||
filenames.push_back(pathname.string().c_str());
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2023 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
|
||||
@@ -356,7 +356,7 @@ BEGIN_COMMAND(SetObjectSettings)
|
||||
}
|
||||
|
||||
private:
|
||||
void Set(player_id_t player, const std::set<CStr>& UNUSED(selections))
|
||||
void Set(player_id_t player, const std::set<CStr>& /*selections*/)
|
||||
{
|
||||
AtlasView* view = AtlasView::GetView(msg->view);
|
||||
CSimulation2* simulation = view->GetSimulation2();
|
||||
|
||||
@@ -54,7 +54,7 @@ void MessagePasserImpl::Add(IMessage* msg)
|
||||
AtlasMessage::ShareableDelete(msg);
|
||||
}
|
||||
|
||||
void MessagePasserImpl::Query(QueryMessage* msg, void(* UNUSED(timeoutCallback) )())
|
||||
void MessagePasserImpl::Query(QueryMessage* msg, void(* /*timeoutCallback*/ )())
|
||||
{
|
||||
ENSURE(msg);
|
||||
ENSURE(msg->GetType() == IMessage::Query);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2023 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
|
||||
@@ -53,19 +53,19 @@ extern int g_xres, g_yres;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void AtlasView::SetParam(const std::wstring& UNUSED(name), bool UNUSED(value))
|
||||
void AtlasView::SetParam(const std::wstring& /*name*/, bool /*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
void AtlasView::SetParam(const std::wstring& UNUSED(name), const AtlasMessage::Color& UNUSED(value))
|
||||
void AtlasView::SetParam(const std::wstring& /*name*/, const AtlasMessage::Color& /*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
void AtlasView::SetParam(const std::wstring& UNUSED(name), const std::wstring& UNUSED(value))
|
||||
void AtlasView::SetParam(const std::wstring& /*name*/, const std::wstring& /*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
void AtlasView::SetParam(const std::wstring& UNUSED(name), int UNUSED(value))
|
||||
void AtlasView::SetParam(const std::wstring& /*name*/, int /*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ void AtlasViewActor::SetParam(const std::wstring& name, int value)
|
||||
m_ActorViewer->SetPropPointsMode(value);
|
||||
}
|
||||
|
||||
void AtlasViewActor::SetParam(const std::wstring& UNUSED(name), const AtlasMessage::Color& UNUSED(value))
|
||||
void AtlasViewActor::SetParam(const std::wstring& /*name*/, const AtlasMessage::Color& /*value*/)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2021 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
|
||||
@@ -40,19 +40,19 @@ class AtlasView
|
||||
{
|
||||
public:
|
||||
virtual ~AtlasView();
|
||||
virtual void Update(float UNUSED(realFrameLength)) { };
|
||||
virtual void Update(float /*realFrameLength*/) { };
|
||||
virtual void Render() { };
|
||||
virtual void DrawCinemaPathTool() { };
|
||||
virtual void DrawOverlays(CCanvas2D& UNUSED(canvas)) { };
|
||||
virtual void DrawOverlays(CCanvas2D& /*canvas*/) { };
|
||||
virtual CCamera& GetCamera() = 0;
|
||||
virtual CSimulation2* GetSimulation2() { return NULL; }
|
||||
virtual entity_id_t GetEntityId(AtlasMessage::ObjectID obj) { return (entity_id_t)obj; }
|
||||
virtual bool WantsHighFramerate() { return false; }
|
||||
virtual void SetEnabled(bool UNUSED(enabled)) {}
|
||||
virtual void SetEnabled(bool /*enabled*/) {}
|
||||
|
||||
virtual void SetParam(const std::wstring& name, bool value);
|
||||
virtual void SetParam(const std::wstring& name, int value);
|
||||
virtual void SetParam(const std::wstring& UNUSED(name), float UNUSED(value)) {}
|
||||
virtual void SetParam(const std::wstring& /*name*/, float /*value*/) {}
|
||||
virtual void SetParam(const std::wstring& name, const AtlasMessage::Color& value);
|
||||
virtual void SetParam(const std::wstring& name, const std::wstring& value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user