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:
phosit
2025-06-03 14:13:41 +02:00
committed by phosit
parent dd26f3a802
commit 891908b801
127 changed files with 355 additions and 340 deletions
@@ -30,29 +30,29 @@ public:
ICmpObstructionManager::tag_t GetObstruction() const override { return ICmpObstructionManager::tag_t(); }
bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const override { out = obstruction; return true; }
bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& UNUSED(out)) const override { return true; }
bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& /*out*/) const override { return true; }
entity_pos_t GetSize() const override { return entity_pos_t::Zero(); }
CFixedVector2D GetStaticSize() const override { return CFixedVector2D(); }
EObstructionType GetObstructionType() const override { return ICmpObstruction::STATIC; }
void SetUnitClearance(const entity_pos_t& UNUSED(clearance)) override { }
void SetUnitClearance(const entity_pos_t& /*clearance*/) override { }
bool IsControlPersistent() const override { return true; }
bool CheckShorePlacement() const override { return true; }
EFoundationCheck CheckFoundation(const std::string& UNUSED(className)) const override { return EFoundationCheck(); }
EFoundationCheck CheckFoundation(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const override { return EFoundationCheck(); }
std::string CheckFoundation_wrapper(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const override { return std::string(); }
EFoundationCheck CheckFoundation(const std::string& /*className*/) const override { return EFoundationCheck(); }
EFoundationCheck CheckFoundation(const std::string& /*className*/, bool /*onlyCenterPoint*/) const override { return EFoundationCheck(); }
std::string CheckFoundation_wrapper(const std::string& /*className*/, bool /*onlyCenterPoint*/) const override { return std::string(); }
bool CheckDuplicateFoundation() const override { return true; }
std::vector<entity_id_t> GetEntitiesByFlags(ICmpObstructionManager::flags_t) const override { return std::vector<entity_id_t>(); }
std::vector<entity_id_t> GetEntitiesBlockingMovement() const override { return std::vector<entity_id_t>(); }
std::vector<entity_id_t> GetEntitiesBlockingConstruction() const override { return std::vector<entity_id_t>(); }
std::vector<entity_id_t> GetEntitiesDeletedUponConstruction() const override { return std::vector<entity_id_t>(); }
void ResolveFoundationCollisions() const override { }
void SetActive(bool UNUSED(active)) override { }
void SetMovingFlag(bool UNUSED(enabled)) override { }
void SetDisableBlockMovementPathfinding(bool UNUSED(movementDisabled), bool UNUSED(pathfindingDisabled), int32_t UNUSED(shape)) override { }
void SetActive(bool /*active*/) override { }
void SetMovingFlag(bool /*enabled*/) override { }
void SetDisableBlockMovementPathfinding(bool /*movementDisabled*/, bool /*pathfindingDisabled*/, int32_t /*shape*/) override { }
bool GetBlockMovementFlag(bool) const override { return true; }
void SetControlGroup(entity_id_t UNUSED(group)) override { }
void SetControlGroup(entity_id_t /*group*/) override { }
entity_id_t GetControlGroup() const override { return INVALID_ENTITY; }
void SetControlGroup2(entity_id_t UNUSED(group2)) override { }
void SetControlGroup2(entity_id_t /*group2*/) override { }
entity_id_t GetControlGroup2() const override { return INVALID_ENTITY; }
};
@@ -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
@@ -26,12 +26,12 @@ class MockWater : public ICmpWaterManager
public:
DEFAULT_MOCK_COMPONENT()
entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override
entity_pos_t GetWaterLevel(entity_pos_t /*x*/, entity_pos_t /*z*/) const override
{
return entity_pos_t::FromInt(100);
}
float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const override
float GetExactWaterLevel(float /*x*/, float /*z*/) const override
{
return 100.f;
}
@@ -40,7 +40,7 @@ public:
{
}
void SetWaterLevel(entity_pos_t UNUSED(h)) override
void SetWaterLevel(entity_pos_t /*h*/) override
{
}
};
@@ -41,39 +41,39 @@ class MockPositionRgm : public ICmpPosition
public:
DEFAULT_MOCK_COMPONENT()
void SetTurretParent(entity_id_t UNUSED(id), const CFixedVector3D& UNUSED(pos)) override {}
void SetTurretParent(entity_id_t /*id*/, const CFixedVector3D& /*pos*/) override {}
entity_id_t GetTurretParent() const override {return INVALID_ENTITY;}
void UpdateTurretPosition() override {}
std::set<entity_id_t>* GetTurrets() override { return nullptr; }
bool IsInWorld() const override { return true; }
void MoveOutOfWorld() override { }
void MoveTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) override { }
void MoveAndTurnTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z), entity_angle_t UNUSED(a)) override { }
void JumpTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) override { }
void SetHeightOffset(entity_pos_t UNUSED(dy)) override { }
void MoveTo(entity_pos_t /*x*/, entity_pos_t /*z*/) override { }
void MoveAndTurnTo(entity_pos_t /*x*/, entity_pos_t /*z*/, entity_angle_t /*a*/) override { }
void JumpTo(entity_pos_t /*x*/, entity_pos_t /*z*/) override { }
void SetHeightOffset(entity_pos_t /*dy*/) override { }
entity_pos_t GetHeightOffset() const override { return entity_pos_t::Zero(); }
void SetHeightFixed(entity_pos_t UNUSED(y)) override { }
void SetHeightFixed(entity_pos_t /*y*/) override { }
entity_pos_t GetHeightFixed() const override { return entity_pos_t::Zero(); }
entity_pos_t GetHeightAtFixed(entity_pos_t, entity_pos_t) const override { return entity_pos_t::Zero(); }
bool IsHeightRelative() const override { return true; }
void SetHeightRelative(bool UNUSED(relative)) override { }
void SetHeightRelative(bool /*relative*/) override { }
bool CanFloat() const override { return false; }
void SetFloating(bool UNUSED(flag)) override { }
void SetActorFloating(bool UNUSED(flag)) override { }
void SetActorAnchor(const CStr& UNUSED(anchor)) override { }
void SetConstructionProgress(fixed UNUSED(progress)) override { }
void SetFloating(bool /*flag*/) override { }
void SetActorFloating(bool /*flag*/) override { }
void SetActorAnchor(const CStr& /*anchor*/) override { }
void SetConstructionProgress(fixed /*progress*/) override { }
CFixedVector3D GetPosition() const override { return m_Pos; }
CFixedVector2D GetPosition2D() const override { return CFixedVector2D(m_Pos.X, m_Pos.Z); }
CFixedVector3D GetPreviousPosition() const override { return CFixedVector3D(); }
CFixedVector2D GetPreviousPosition2D() const override { return CFixedVector2D(); }
fixed GetTurnRate() const override { return fixed::Zero(); }
void TurnTo(entity_angle_t UNUSED(y)) override { }
void SetYRotation(entity_angle_t UNUSED(y)) override { }
void SetXZRotation(entity_angle_t UNUSED(x), entity_angle_t UNUSED(z)) override { }
void TurnTo(entity_angle_t /*y*/) override { }
void SetYRotation(entity_angle_t /*y*/) override { }
void SetXZRotation(entity_angle_t /*x*/, entity_angle_t /*z*/) override { }
CFixedVector3D GetRotation() const override { return CFixedVector3D(); }
fixed GetDistanceTravelled() const override { return fixed::Zero(); }
void GetInterpolatedPosition2D(float UNUSED(frameOffset), float& x, float& z, float& rotY) const override { x = z = rotY = 0; }
CMatrix3D GetInterpolatedTransform(float UNUSED(frameOffset)) const override { return CMatrix3D(); }
void GetInterpolatedPosition2D(float /*frameOffset*/, float& x, float& z, float& rotY) const override { x = z = rotY = 0; }
CMatrix3D GetInterpolatedTransform(float /*frameOffset*/) const override { return CMatrix3D(); }
CFixedVector3D m_Pos;
};