From d9795d29fe17a9499a54f829ee3b7bfff467cc2c Mon Sep 17 00:00:00 2001 From: phosit Date: Wed, 4 Jun 2025 08:10:15 +0200 Subject: [PATCH] Remove the name of some unused arguments Remove some usage of the `UNUSED` macro. Remove only those cases where the names can be deduced from their type. https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-unused --- source/collada/CommonConvert.cpp | 4 +-- source/graphics/MapWriter.cpp | 10 +++--- source/graphics/ParticleEmitterType.cpp | 22 ++++++------ source/graphics/ParticleManager.cpp | 4 +-- source/graphics/TerrainProperties.cpp | 4 +-- source/graphics/TerrainTextureManager.cpp | 2 +- source/gui/GUIStringConversions.cpp | 36 +++++++++---------- source/gui/ObjectBases/IGUIObject.h | 6 ++-- source/gui/ObjectTypes/CGUIDummyObject.h | 4 +-- source/gui/ObjectTypes/CHotkeyPicker.h | 4 +-- source/gui/Scripting/GuiScriptConversions.cpp | 3 +- source/gui/Scripting/JSInterface_GUIProxy.h | 27 ++++++++------ source/lib/adts/cache_adt.h | 4 +-- source/lib/allocators/DynamicArena.h | 4 +-- source/lib/allocators/stateless_allocators.h | 6 ++-- source/lib/app_hooks.cpp | 4 +-- .../lib/file/archive/tests/test_archive_zip.h | 7 ++-- source/lib/file/common/file_stats.h | 2 +- source/lib/file/common/trace.cpp | 10 +++--- source/lib/file/io/io.h | 2 +- source/lib/sysdep/os/bsd/dir_watch.cpp | 6 ++-- source/lib/sysdep/os/osx/dir_watch.cpp | 11 ++---- source/lib/sysdep/os/unix/udbg.cpp | 4 +-- source/lib/sysdep/os/unix/uvm.cpp | 4 +-- source/lib/sysdep/os/win/wdbg_sym.cpp | 6 ++-- source/lib/sysdep/os/win/wposix/waio.cpp | 4 +-- .../lib/sysdep/os/win/wposix/wfilesystem.cpp | 4 +-- source/lib/sysdep/os/win/wposix/wmman.cpp | 4 +-- source/lib/sysdep/os/win/wposix/wpthread.cpp | 12 +++---- source/lib/sysdep/os/win/wvm.cpp | 6 ++-- source/lib/sysdep/smbios.cpp | 4 +-- source/lib/tex/tex_bmp.cpp | 4 +-- source/lib/tex/tex_dds.cpp | 4 +-- source/lib/tex/tex_png.cpp | 8 ++--- source/lib/tex/tex_tga.cpp | 4 +-- source/lobby/XmppClient.cpp | 14 ++++---- source/ps/ArchiveBuilder.cpp | 4 +-- source/ps/Replay.h | 6 ++-- source/ps/TemplateLoader.cpp | 8 ++--- source/ps/scripting/JSInterface_VFS.cpp | 4 +-- source/renderer/CPUSkinnedModelRenderer.cpp | 9 +++-- source/renderer/GPUSkinnedModelRenderer.cpp | 11 +++--- source/renderer/InstancingModelRenderer.cpp | 17 ++++----- source/renderer/MikktspaceWrap.cpp | 4 +-- source/renderer/SilhouetteRenderer.cpp | 3 +- source/renderer/TerrainOverlay.h | 5 ++- source/renderer/backend/dummy/Device.cpp | 8 ++--- source/renderer/backend/gl/ShaderProgram.cpp | 12 ++++--- source/scriptinterface/ScriptContext.cpp | 2 +- source/scriptinterface/ScriptConversions.cpp | 16 ++++----- source/scriptinterface/ScriptConversions.h | 14 +++++--- .../simulation2/components/CCmpAIManager.cpp | 6 ++-- .../components/CCmpCinemaManager.cpp | 6 ++-- .../components/CCmpCommandQueue.cpp | 8 ++--- source/simulation2/components/CCmpDecay.cpp | 6 ++-- .../simulation2/components/CCmpFootprint.cpp | 6 ++-- .../simulation2/components/CCmpMotionBall.cpp | 4 +-- .../components/CCmpObstructionManager.cpp | 4 +-- .../components/CCmpOverlayRenderer.cpp | 8 ++--- .../simulation2/components/CCmpOwnership.cpp | 6 ++-- .../components/CCmpParticleManager.cpp | 8 ++--- .../simulation2/components/CCmpPathfinder.cpp | 2 +- .../components/CCmpProjectileManager.cpp | 4 +-- .../components/CCmpRallyPointRenderer.cpp | 4 +-- .../components/CCmpRallyPointRenderer.h | 4 +-- .../components/CCmpRangeManager.cpp | 6 ++-- .../components/CCmpRangeOverlayRenderer.cpp | 8 ++--- .../simulation2/components/CCmpSelectable.cpp | 4 +-- .../components/CCmpSoundManager.cpp | 10 +++--- .../components/CCmpTemplateManager.cpp | 4 +-- source/simulation2/components/CCmpTerrain.cpp | 10 +++--- .../components/CCmpTerritoryInfluence.cpp | 8 ++--- .../components/CCmpTerritoryManager.cpp | 4 +-- source/simulation2/components/CCmpTest.cpp | 8 ++--- .../components/CCmpUnitMotionManager.h | 4 +-- .../components/CCmpUnitRenderer.cpp | 8 ++--- source/simulation2/components/CCmpVision.cpp | 6 ++-- .../components/CCmpWaterManager.cpp | 4 +-- .../simulation2/components/ICmpAIManager.cpp | 2 +- .../components/ICmpObstructionManager.h | 12 +++---- .../tests/test_ObstructionManager.h | 4 +-- source/simulation2/docs/SimulationDocs.h | 6 ++-- source/simulation2/helpers/Selection.h | 4 +-- .../simulation2/helpers/VertexPathfinder.cpp | 5 +-- .../scripting/EngineScriptConversions.cpp | 5 +-- .../scripting/MessageTypeConversions.cpp | 32 ++++++++--------- .../simulation2/scripting/ScriptComponent.h | 2 +- source/simulation2/system/Component.h | 8 ++--- .../simulation2/system/ComponentManager.cpp | 2 +- source/simulation2/system/IComponent.cpp | 2 +- .../simulation2/system/LocalTurnManager.cpp | 4 +-- source/soundmanager/SoundManager.cpp | 2 +- source/tools/atlas/GameInterface/View.cpp | 2 +- 93 files changed, 320 insertions(+), 319 deletions(-) diff --git a/source/collada/CommonConvert.cpp b/source/collada/CommonConvert.cpp index e29d5ff49b..ea0d7b5630 100644 --- a/source/collada/CommonConvert.cpp +++ b/source/collada/CommonConvert.cpp @@ -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 @@ -361,7 +361,7 @@ MERGED_WEIGHTS: ; } -void FixSkeletonRoots(FCDControllerInstance& UNUSED(controllerInstance)) +void FixSkeletonRoots(FCDControllerInstance&) { // TODO: Need to reintroduce XSI support at some point #if 0 diff --git a/source/graphics/MapWriter.cpp b/source/graphics/MapWriter.cpp index 9def9cb343..37b36539e8 100644 --- a/source/graphics/MapWriter.cpp +++ b/source/graphics/MapWriter.cpp @@ -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 @@ -56,11 +56,9 @@ CMapWriter::CMapWriter() /////////////////////////////////////////////////////////////////////////////////////////////////// // SaveMap: try to save the current map to the given file -void CMapWriter::SaveMap(const VfsPath& pathname, CTerrain* pTerrain, - WaterManager* pWaterMan, SkyManager* pSkyMan, - CLightEnv* pLightEnv, CCamera* pCamera, CCinemaManager* UNUSED(pCinema), - CPostprocManager* pPostproc, - CSimulation2* pSimulation2) +void CMapWriter::SaveMap(const VfsPath& pathname, CTerrain* pTerrain, WaterManager* pWaterMan, + SkyManager* pSkyMan, CLightEnv* pLightEnv, CCamera* pCamera, CCinemaManager*, + CPostprocManager* pPostproc, CSimulation2* pSimulation2) { CFilePacker packer(FILE_VERSION, "PSMP"); diff --git a/source/graphics/ParticleEmitterType.cpp b/source/graphics/ParticleEmitterType.cpp index bde95d36d8..d14b81105c 100644 --- a/source/graphics/ParticleEmitterType.cpp +++ b/source/graphics/ParticleEmitterType.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -87,17 +87,17 @@ public: { } - virtual float Compute(CParticleEmitterType& UNUSED(type), CParticleEmitter& UNUSED(emitter)) + virtual float Compute(CParticleEmitterType&, CParticleEmitter&) { return m_Value; } - virtual float Min(CParticleEmitterType& UNUSED(type)) + virtual float Min(CParticleEmitterType&) { return m_Value; } - virtual float Max(CParticleEmitterType& UNUSED(type)) + virtual float Max(CParticleEmitterType&) { return m_Value; } @@ -117,17 +117,17 @@ public: { } - virtual float Compute(CParticleEmitterType& type, CParticleEmitter& UNUSED(emitter)) + virtual float Compute(CParticleEmitterType& type, CParticleEmitter&) { return boost::random::uniform_real_distribution(m_Min, m_Max)(type.m_Manager.m_RNG); } - virtual float Min(CParticleEmitterType& UNUSED(type)) + virtual float Min(CParticleEmitterType&) { return m_Min; } - virtual float Max(CParticleEmitterType& UNUSED(type)) + virtual float Max(CParticleEmitterType&) { return m_Max; } @@ -149,7 +149,7 @@ public: { } - virtual float Compute(CParticleEmitterType& type, CParticleEmitter& UNUSED(emitter)) + virtual float Compute(CParticleEmitterType& type, CParticleEmitter&) { return type.m_Variables[m_From]->LastValue(); } @@ -180,17 +180,17 @@ public: { } - virtual float Compute(CParticleEmitterType& UNUSED(type), CParticleEmitter& emitter) + virtual float Compute(CParticleEmitterType&, CParticleEmitter& emitter) { return std::min(m_Max, emitter.m_EntityVariables[m_From] * m_Mul); } - virtual float Min(CParticleEmitterType& UNUSED(type)) + virtual float Min(CParticleEmitterType&) { return 0.f; } - virtual float Max(CParticleEmitterType& UNUSED(type)) + virtual float Max(CParticleEmitterType&) { return m_Max; } diff --git a/source/graphics/ParticleManager.cpp b/source/graphics/ParticleManager.cpp index 61ca43091c..16a143913b 100644 --- a/source/graphics/ParticleManager.cpp +++ b/source/graphics/ParticleManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 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 @@ -82,7 +82,7 @@ struct EmitterHasNoParticles } }; -void CParticleManager::RenderSubmit(SceneCollector& collector, const CFrustum& UNUSED(frustum)) +void CParticleManager::RenderSubmit(SceneCollector& collector, const CFrustum&) { PROFILE("submit unattached particles"); diff --git a/source/graphics/TerrainProperties.cpp b/source/graphics/TerrainProperties.cpp index 5444f42c92..9d5bb8671d 100644 --- a/source/graphics/TerrainProperties.cpp +++ b/source/graphics/TerrainProperties.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -87,7 +87,7 @@ CTerrainPropertiesPtr CTerrainProperties::FromXML(const CTerrainPropertiesPtr& p return CTerrainPropertiesPtr(); } -void CTerrainProperties::LoadXml(XMBElement node, CXeromyces *pFile, const VfsPath& UNUSED(pathname)) +void CTerrainProperties::LoadXml(XMBElement node, CXeromyces *pFile, const VfsPath&) { #define ELMT(x) int elmt_##x = pFile->GetElementID(#x) #define ATTR(x) int attr_##x = pFile->GetAttributeID(#x) diff --git a/source/graphics/TerrainTextureManager.cpp b/source/graphics/TerrainTextureManager.cpp index 77a61cc035..9edaccc55e 100644 --- a/source/graphics/TerrainTextureManager.cpp +++ b/source/graphics/TerrainTextureManager.cpp @@ -118,7 +118,7 @@ static Status AddTextureDirCallback(const VfsPath& pathname, const uintptr_t cbD return INFO::OK; } -static Status AddTextureCallback(const VfsPath& pathname, const CFileInfo& UNUSED(fileInfo), const uintptr_t cbData) +static Status AddTextureCallback(const VfsPath& pathname, const CFileInfo&, const uintptr_t cbData) { AddTextureCallbackData& data = *(AddTextureCallbackData*)cbData; if (pathname.Basename() != L"terrains") diff --git a/source/gui/GUIStringConversions.cpp b/source/gui/GUIStringConversions.cpp index eb9b9f3e68..d833fa2009 100644 --- a/source/gui/GUIStringConversions.cpp +++ b/source/gui/GUIStringConversions.cpp @@ -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,7 +26,7 @@ class CGUIList; class CGUISeries; template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, bool& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, bool& Output) { if (Value == L"true") Output = true; @@ -39,28 +39,28 @@ bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, bool& } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, int& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, int& Output) { Output = Value.ToInt(); return true; } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, u32& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, u32& Output) { Output = Value.ToUInt(); return true; } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, float& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, float& Output) { Output = Value.ToFloat(); return true; } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CRect& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, CRect& Output) { const unsigned int NUM_COORDS = 4; float coords[NUM_COORDS]; @@ -95,7 +95,7 @@ bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CRec } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CGUISize& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, CGUISize& Output) { return Output.FromString(Value.ToUTF8()); } @@ -107,7 +107,7 @@ bool CGUI::ParseString(const CGUI* pGUI, const CStrW& Value, CGUIColo } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CSize2D& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, CSize2D& Output) { const unsigned int NUM_COORDS = 2; float coords[NUM_COORDS]; @@ -142,7 +142,7 @@ bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CS } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CVector2D& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, CVector2D& Output) { const unsigned int NUM_COORDS = 2; float coords[NUM_COORDS]; @@ -177,7 +177,7 @@ bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, EAlign& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, EAlign& Output) { if (Value == L"left") Output = EAlign::LEFT; @@ -192,7 +192,7 @@ bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, EAl } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, EVAlign& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, EVAlign& Output) { if (Value == L"top") Output = EVAlign::TOP; @@ -207,47 +207,47 @@ bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, EV } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CGUIString& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, CGUIString& Output) { Output.SetValue(Value); return true; } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CStr& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, CStr& Output) { Output = Value.ToUTF8(); return true; } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CStrW& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, CStrW& Output) { Output = Value; return true; } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, CGUISpriteInstance& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, CGUISpriteInstance& Output) { Output = CGUISpriteInstance(Value.ToUTF8()); return true; } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& UNUSED(Value), CGUISeries& UNUSED(Output)) +bool CGUI::ParseString(const CGUI*, const CStrW& UNUSED(Value), CGUISeries& UNUSED(Output)) { return false; } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& UNUSED(Value), CGUIList& UNUSED(Output)) +bool CGUI::ParseString(const CGUI*, const CStrW& UNUSED(Value), CGUIList& UNUSED(Output)) { return false; } template <> -bool CGUI::ParseString(const CGUI* UNUSED(pGUI), const CStrW& Value, EScrollOrientation& Output) +bool CGUI::ParseString(const CGUI*, const CStrW& Value, EScrollOrientation& Output) { if (Value == L"vertical") Output = EScrollOrientation::VERTICAL; diff --git a/source/gui/ObjectBases/IGUIObject.h b/source/gui/ObjectBases/IGUIObject.h index 17a9bff851..f8aa757fd6 100644 --- a/source/gui/ObjectBases/IGUIObject.h +++ b/source/gui/ObjectBases/IGUIObject.h @@ -247,7 +247,7 @@ public: * * @param Message GUI Message */ - virtual void HandleMessage(SGUIMessage& UNUSED(Message)) {} + virtual void HandleMessage(SGUIMessage&) {} /** * Calls an IGUIObject member function recursively on this object and its children. @@ -287,7 +287,7 @@ protected: * Returns either IN_PASS or IN_HANDLED. If IN_HANDLED, then * the event won't be passed on and processed by other handlers. */ - virtual InReaction PreemptEvent(const SDL_Event_* UNUSED(ev)) { return IN_PASS; } + virtual InReaction PreemptEvent(const SDL_Event_*) { return IN_PASS; } /** * Some objects need to handle the text-related SDL_Event_ manually. @@ -299,7 +299,7 @@ protected: * the key won't be passed on and processed by other handlers. * This is used for keys that the GUI uses. */ - virtual InReaction ManuallyHandleKeys(const SDL_Event_* UNUSED(ev)) { return IN_PASS; } + virtual InReaction ManuallyHandleKeys(const SDL_Event_*) { return IN_PASS; } /** * Applies the given style to the object. diff --git a/source/gui/ObjectTypes/CGUIDummyObject.h b/source/gui/ObjectTypes/CGUIDummyObject.h index 9ee74d353e..70fedb17ab 100644 --- a/source/gui/ObjectTypes/CGUIDummyObject.h +++ b/source/gui/ObjectTypes/CGUIDummyObject.h @@ -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 @@ -35,7 +35,7 @@ class CGUIDummyObject : public IGUIObject public: CGUIDummyObject(CGUI& pGUI) : IGUIObject(pGUI) {} - virtual void Draw(CCanvas2D& UNUSED(canvas)) {} + virtual void Draw(CCanvas2D&) {} /** * Empty can never be hovered. It is only a category. diff --git a/source/gui/ObjectTypes/CHotkeyPicker.h b/source/gui/ObjectTypes/CHotkeyPicker.h index fc70097f15..c3f6391f49 100644 --- a/source/gui/ObjectTypes/CHotkeyPicker.h +++ b/source/gui/ObjectTypes/CHotkeyPicker.h @@ -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 @@ -41,7 +41,7 @@ public: virtual ~CHotkeyPicker(); // Do nothing. - virtual void Draw(CCanvas2D& UNUSED(canvas)) {}; + virtual void Draw(CCanvas2D&) {}; // Checks if the timer has passed and we need to fire a "combination" event. virtual void Tick(); diff --git a/source/gui/Scripting/GuiScriptConversions.cpp b/source/gui/Scripting/GuiScriptConversions.cpp index 3098efcc39..61e4baa544 100644 --- a/source/gui/Scripting/GuiScriptConversions.cpp +++ b/source/gui/Scripting/GuiScriptConversions.cpp @@ -130,7 +130,8 @@ template<> void Script::ToJSVal(const ScriptRequest& rq, JS::Mutable ret.setObject(*obj); } -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, IGUIObject* const& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, + IGUIObject* const& val) { if (val == nullptr) ret.setNull(); diff --git a/source/gui/Scripting/JSInterface_GUIProxy.h b/source/gui/Scripting/JSInterface_GUIProxy.h index b0d3d9a523..6b28bb42e8 100644 --- a/source/gui/Scripting/JSInterface_GUIProxy.h +++ b/source/gui/Scripting/JSInterface_GUIProxy.h @@ -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 @@ -169,43 +169,48 @@ protected: // We provide defaults that do nothing (some raise JS exceptions). // The JS code will see undefined when querying a property descriptor. - virtual bool getOwnPropertyDescriptor(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), JS::HandleId UNUSED(id), - JS::MutableHandle> UNUSED(desc)) const override + virtual bool getOwnPropertyDescriptor(JSContext*, JS::HandleObject UNUSED(proxy), JS::HandleId, + JS::MutableHandle>) const override { return true; } // Throw an exception is JS code attempts defining a property. - virtual bool defineProperty(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), JS::HandleId UNUSED(id), - JS::Handle UNUSED(desc), JS::ObjectOpResult& UNUSED(result)) const override + virtual bool defineProperty(JSContext*, JS::HandleObject UNUSED(proxy), JS::HandleId, + JS::Handle, JS::ObjectOpResult& UNUSED(result)) const override { return false; } // No accessible properties. - virtual bool ownPropertyKeys(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), JS::MutableHandleIdVector UNUSED(props)) const override + virtual bool ownPropertyKeys(JSContext*, JS::HandleObject UNUSED(proxy), + JS::MutableHandleIdVector UNUSED(props)) const override { return true; } // Nothing to enumerate. - virtual bool enumerate(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), JS::MutableHandleIdVector UNUSED(props)) const override + virtual bool enumerate(JSContext*, JS::HandleObject UNUSED(proxy), + JS::MutableHandleIdVector UNUSED(props)) const override { return true; } // Throw an exception is JS attempts to query the prototype. - virtual bool getPrototypeIfOrdinary(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), bool* UNUSED(isOrdinary), JS::MutableHandleObject UNUSED(protop)) const override + virtual bool getPrototypeIfOrdinary(JSContext*, JS::HandleObject UNUSED(proxy), + bool* UNUSED(isOrdinary), JS::MutableHandleObject UNUSED(protop)) const override { return false; } // Throw an exception - no prototype to set. - virtual bool setImmutablePrototype(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), bool* UNUSED(succeeded)) const override + virtual bool setImmutablePrototype(JSContext*, JS::HandleObject UNUSED(proxy), + bool* UNUSED(succeeded)) const override { return false; } // We are not extensible. - virtual bool preventExtensions(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), JS::ObjectOpResult& UNUSED(result)) const override + virtual bool preventExtensions(JSContext*, JS::HandleObject UNUSED(proxy), + JS::ObjectOpResult&) const override { return true; } - virtual bool isExtensible(JSContext* UNUSED(cx), JS::HandleObject UNUSED(proxy), bool* extensible) const override + virtual bool isExtensible(JSContext*, JS::HandleObject UNUSED(proxy), bool* extensible) const override { *extensible = false; return true; diff --git a/source/lib/adts/cache_adt.h b/source/lib/adts/cache_adt.h index 622bb035df..59eb951a41 100644 --- a/source/lib/adts/cache_adt.h +++ b/source/lib/adts/cache_adt.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -171,7 +171,7 @@ public: is_min_entry = feq(min_credit_density, entry.credit_density()); } - void notify_increased_or_removed(const Entry& UNUSED(entry)) + void notify_increased_or_removed(const Entry&) { // .. it did and was increased or removed. we must invalidate // MCD and recalculate it next time. diff --git a/source/lib/allocators/DynamicArena.h b/source/lib/allocators/DynamicArena.h index 678daaec23..b0bcfc90b2 100644 --- a/source/lib/allocators/DynamicArena.h +++ b/source/lib/allocators/DynamicArena.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -141,7 +141,7 @@ public: return reinterpret_cast(m_Blocks.back().Allocate(n, alignment)); } - void deallocate(void* UNUSED(p), size_t UNUSED(n)) + void deallocate(void*, size_t) { // ignored } diff --git a/source/lib/allocators/stateless_allocators.h b/source/lib/allocators/stateless_allocators.h index 3f20ec7eac..ea500c021e 100644 --- a/source/lib/allocators/stateless_allocators.h +++ b/source/lib/allocators/stateless_allocators.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -39,7 +39,7 @@ struct Allocator_Heap return malloc(size); } - void deallocate(void* p, size_t UNUSED(size)) + void deallocate(void* p, size_t) { return free(p); } @@ -53,7 +53,7 @@ struct Allocator_Aligned return rtl_AllocateAligned(size, alignment); } - void deallocate(void* p, size_t UNUSED(size)) + void deallocate(void* p, size_t) { return rtl_FreeAligned(p); } diff --git a/source/lib/app_hooks.cpp b/source/lib/app_hooks.cpp index d412d77786..529f4a5203 100644 --- a/source/lib/app_hooks.cpp +++ b/source/lib/app_hooks.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -41,7 +41,7 @@ static const OsPath& def_get_log_dir() } -static void def_bundle_logs(FILE* UNUSED(f)) +static void def_bundle_logs(FILE*) { } diff --git a/source/lib/file/archive/tests/test_archive_zip.h b/source/lib/file/archive/tests/test_archive_zip.h index 5f0e377dce..1901220495 100644 --- a/source/lib/file/archive/tests/test_archive_zip.h +++ b/source/lib/file/archive/tests/test_archive_zip.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2021 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -104,10 +104,7 @@ public: } private: - static void ArchiveEntryCallback( - const VfsPath& path, - const CFileInfo& UNUSED(fileInfo), - PIArchiveFile UNUSED(archiveFile), + static void ArchiveEntryCallback(const VfsPath& path, const CFileInfo&, PIArchiveFile, uintptr_t UNUSED(cbData)) { g_ResultBuffer = path.string8(); diff --git a/source/lib/file/common/file_stats.h b/source/lib/file/common/file_stats.h index 24c0bed390..a090c9fc92 100644 --- a/source/lib/file/common/file_stats.h +++ b/source/lib/file/common/file_stats.h @@ -103,7 +103,7 @@ class ScopedIoMonitor public: ScopedIoMonitor() {} ~ScopedIoMonitor() {} - void NotifyOfSuccess(FileIOImplentation UNUSED(fi), int UNUSED(opcode), off_t UNUSED(size)) {} + void NotifyOfSuccess(FileIOImplentation, int UNUSED(opcode), off_t UNUSED(size)) {} }; #define stats_cb_start() #define stats_cb_finish() diff --git a/source/lib/file/common/trace.cpp b/source/lib/file/common/trace.cpp index 9e701f2756..71366082a9 100644 --- a/source/lib/file/common/trace.cpp +++ b/source/lib/file/common/trace.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2023 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -109,20 +109,20 @@ public: } - virtual void NotifyLoad(const Path& UNUSED(pathname), size_t UNUSED(size)) + virtual void NotifyLoad(const Path&, size_t UNUSED(size)) { } - virtual void NotifyStore(const Path& UNUSED(pathname), size_t UNUSED(size)) + virtual void NotifyStore(const Path&, size_t UNUSED(size)) { } - virtual Status Load(const OsPath& UNUSED(pathname)) + virtual Status Load(const OsPath&) { return INFO::OK; } - virtual Status Store(const OsPath& UNUSED(pathname)) const + virtual Status Store(const OsPath&) const { return INFO::OK; } diff --git a/source/lib/file/io/io.h b/source/lib/file/io/io.h index cf3e34e345..8260314cda 100644 --- a/source/lib/file/io/io.h +++ b/source/lib/file/io/io.h @@ -181,7 +181,7 @@ struct DefaultIssueHook * allows generating the data to write while waiting for * previous I/Os to complete. **/ - Status operator()(aiocb& UNUSED(cb)) const + Status operator()(aiocb&) const { return INFO::OK; } diff --git a/source/lib/sysdep/os/bsd/dir_watch.cpp b/source/lib/sysdep/os/bsd/dir_watch.cpp index 749946e5bf..bf5c1f4a0c 100644 --- a/source/lib/sysdep/os/bsd/dir_watch.cpp +++ b/source/lib/sysdep/os/bsd/dir_watch.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2012 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -25,12 +25,12 @@ // stub implementations -Status dir_watch_Add(const OsPath& UNUSED(path), PDirWatch& UNUSED(dirWatch)) +Status dir_watch_Add(const OsPath&, PDirWatch&) { return INFO::OK; } -Status dir_watch_Poll(DirWatchNotifications& UNUSED(notifications)) +Status dir_watch_Poll(DirWatchNotifications&) { return INFO::OK; } diff --git a/source/lib/sysdep/os/osx/dir_watch.cpp b/source/lib/sysdep/os/osx/dir_watch.cpp index 1618ba73ba..f7f59c3bae 100644 --- a/source/lib/sysdep/os/osx/dir_watch.cpp +++ b/source/lib/sysdep/os/osx/dir_watch.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -74,13 +74,8 @@ static bool CanRunNotifications() #define kFSEventStreamEventFlagItemModified 0x00001000 #endif -static void fsevent_callback( - ConstFSEventStreamRef UNUSED(streamRef), - void * UNUSED(clientCallBackInfo), - size_t numEvents, - void *eventPaths, - const FSEventStreamEventFlags eventFlags[], - const FSEventStreamEventId UNUSED(eventIds)[] ) +static void fsevent_callback(ConstFSEventStreamRef, void * UNUSED(clientCallBackInfo), size_t numEvents, + void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId[]) { unsigned long i; char **paths = (char **)eventPaths; diff --git a/source/lib/sysdep/os/unix/udbg.cpp b/source/lib/sysdep/os/unix/udbg.cpp index 3b7410e621..afe50c27ff 100644 --- a/source/lib/sysdep/os/unix/udbg.cpp +++ b/source/lib/sysdep/os/unix/udbg.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -109,7 +109,7 @@ void debug_puts(const char* text) #endif -int debug_IsPointerBogus(const void* UNUSED(p)) +int debug_IsPointerBogus(const void*) { // TODO: maybe this should do some checks return false; diff --git a/source/lib/sysdep/os/unix/uvm.cpp b/source/lib/sysdep/os/unix/uvm.cpp index 8a3f81ec3b..fc3f05fa63 100644 --- a/source/lib/sysdep/os/unix/uvm.cpp +++ b/source/lib/sysdep/os/unix/uvm.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -56,7 +56,7 @@ void ReleaseAddressSpace(void* p, size_t size) } -bool Commit(uintptr_t address, size_t size, PageType UNUSED(pageType), int prot) +bool Commit(uintptr_t address, size_t size, PageType, int prot) { if(prot == PROT_NONE) // would be understood as a request to decommit { diff --git a/source/lib/sysdep/os/win/wdbg_sym.cpp b/source/lib/sysdep/os/win/wdbg_sym.cpp index 4c7325f0be..0e25e7053f 100644 --- a/source/lib/sysdep/os/win/wdbg_sym.cpp +++ b/source/lib/sysdep/os/win/wdbg_sym.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -1092,7 +1092,7 @@ static Status dump_sym_enum(DWORD type_id, const u8* p, DumpState& state) //----------------------------------------------------------------------------- -static Status dump_sym_function(DWORD UNUSED(type_id), const u8* UNUSED(p), DumpState& UNUSED(state)) +static Status dump_sym_function(DWORD UNUSED(type_id), const u8* UNUSED(p), DumpState&) { return INFO::SYM_SUPPRESS_OUTPUT; } @@ -1552,7 +1552,7 @@ done: //----------------------------------------------------------------------------- -static Status dump_sym_vtable(DWORD UNUSED(type_id), const u8* UNUSED(p), DumpState& UNUSED(state)) +static Status dump_sym_vtable(DWORD UNUSED(type_id), const u8* UNUSED(p), DumpState&) { // unsupported (vtable internals are undocumented; too much work). return INFO::SYM_SUPPRESS_OUTPUT; diff --git a/source/lib/sysdep/os/win/wposix/waio.cpp b/source/lib/sysdep/os/win/wposix/waio.cpp index f1e2a150ee..81c48b211c 100644 --- a/source/lib/sysdep/os/win/wposix/waio.cpp +++ b/source/lib/sysdep/os/win/wposix/waio.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -668,7 +668,7 @@ ssize_t aio_return(struct aiocb* cb) // Win32 limitation: cancel all I/Os this thread issued for the given file // (CancelIoEx can cancel individual operations, but is only // available starting with Vista) -int aio_cancel(int fd, struct aiocb* UNUSED(cb)) +int aio_cancel(int fd, struct aiocb*) { FileControlBlock* fcb = fileControlBlocks.FromDescriptor(fd); if(!fcb) diff --git a/source/lib/sysdep/os/win/wposix/wfilesystem.cpp b/source/lib/sysdep/os/win/wposix/wfilesystem.cpp index f28f7fffa9..fef392e3cd 100644 --- a/source/lib/sysdep/os/win/wposix/wfilesystem.cpp +++ b/source/lib/sysdep/os/win/wposix/wfilesystem.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -340,7 +340,7 @@ static int ErrnoFromCreateDirectory() } } -int wmkdir(const OsPath& path, mode_t UNUSED(mode)) +int wmkdir(const OsPath& path, mode_t) { if(!CreateDirectoryW(OsString(path).c_str(), (LPSECURITY_ATTRIBUTES)NULL)) { diff --git a/source/lib/sysdep/os/win/wposix/wmman.cpp b/source/lib/sysdep/os/win/wposix/wmman.cpp index 5a72a19d6b..b4cebf7f23 100644 --- a/source/lib/sysdep/os/win/wposix/wmman.cpp +++ b/source/lib/sysdep/os/win/wposix/wmman.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2011 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -219,7 +219,7 @@ void* mmap(void* start, size_t len, int prot, int flags, int fd, off_t ofs) } -int munmap(void* start, size_t UNUSED(len)) +int munmap(void* start, size_t) { // UnmapViewOfFile checks if start was returned by MapViewOfFile*; // if not, it will fail. diff --git a/source/lib/sysdep/os/win/wposix/wpthread.cpp b/source/lib/sysdep/os/win/wposix/wpthread.cpp index 3740313b8c..f152f68b2b 100644 --- a/source/lib/sysdep/os/win/wposix/wpthread.cpp +++ b/source/lib/sysdep/os/win/wposix/wpthread.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -272,23 +272,23 @@ again: // memory manager used a pthread_mutex. -int pthread_mutexattr_init(pthread_mutexattr_t* UNUSED(attr)) +int pthread_mutexattr_init(pthread_mutexattr_t*) { return 0; } -int pthread_mutexattr_destroy(pthread_mutexattr_t* UNUSED(attr)) +int pthread_mutexattr_destroy(pthread_mutexattr_t*) { return 0; } -int pthread_mutexattr_gettype(const pthread_mutexattr_t* UNUSED(attr), int* type) +int pthread_mutexattr_gettype(const pthread_mutexattr_t*, int* type) { *type = PTHREAD_MUTEX_RECURSIVE; return 0; } -int pthread_mutexattr_settype(pthread_mutexattr_t* UNUSED(attr), int type) +int pthread_mutexattr_settype(pthread_mutexattr_t*, int type) { return (type == PTHREAD_MUTEX_RECURSIVE)? 0 : -ENOSYS; } @@ -357,7 +357,7 @@ int pthread_mutex_unlock(pthread_mutex_t* m) // not implemented - pthread_mutex is based on CRITICAL_SECTION, // which doesn't support timeouts. use sem_timedwait instead. -int pthread_mutex_timedlock(pthread_mutex_t* UNUSED(m), const struct timespec* UNUSED(abs_timeout)) +int pthread_mutex_timedlock(pthread_mutex_t*, const struct timespec* UNUSED(abs_timeout)) { return -ENOSYS; } diff --git a/source/lib/sysdep/os/win/wvm.cpp b/source/lib/sysdep/os/win/wvm.cpp index c2fcd02780..24b983fef1 100644 --- a/source/lib/sysdep/os/win/wvm.cpp +++ b/source/lib/sysdep/os/win/wvm.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -336,7 +336,7 @@ void* ReserveAddressSpace(size_t size, size_t commitSize, PageType pageType, int } -void ReleaseAddressSpace(void* p, size_t UNUSED(size)) +void ReleaseAddressSpace(void* p, size_t) { // it is customary to ignore null pointers if(!p) @@ -383,7 +383,7 @@ void* Allocate(size_t size, PageType pageType, int prot) } -void Free(void* p, size_t UNUSED(size)) +void Free(void* p, size_t) { if(p) // otherwise, VirtualFree complains { diff --git a/source/lib/sysdep/smbios.cpp b/source/lib/sysdep/smbios.cpp index 8a83784d60..9afb23b73e 100644 --- a/source/lib/sysdep/smbios.cpp +++ b/source/lib/sysdep/smbios.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2024 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -244,7 +244,7 @@ void FieldInitializer::operator()(size_t flags, const char*& t, con // Fixup (e.g. compute derived fields) template -void Fixup(Structure& UNUSED(structure)) +void Fixup(Structure&) { // primary template: do nothing } diff --git a/source/lib/tex/tex_bmp.cpp b/source/lib/tex/tex_bmp.cpp index 5a6ae5c351..7bc2b226e5 100644 --- a/source/lib/tex/tex_bmp.cpp +++ b/source/lib/tex/tex_bmp.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -60,7 +60,7 @@ struct BmpHeader #define BI_RGB 0 // biCompression -Status TexCodecBmp::transform(Tex* UNUSED(t), size_t UNUSED(transforms)) const +Status TexCodecBmp::transform(Tex*, size_t UNUSED(transforms)) const { return INFO::TEX_CODEC_CANNOT_HANDLE; } diff --git a/source/lib/tex/tex_dds.cpp b/source/lib/tex/tex_dds.cpp index b61153e5e3..08048e20d2 100644 --- a/source/lib/tex/tex_dds.cpp +++ b/source/lib/tex/tex_dds.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -617,7 +617,7 @@ Status TexCodecDds::decode(u8* RESTRICT data, size_t UNUSED(size), Tex* RESTRICT } -Status TexCodecDds::encode(Tex* RESTRICT UNUSED(t), DynArray* RESTRICT UNUSED(da)) const +Status TexCodecDds::encode(Tex* RESTRICT, DynArray* RESTRICT) const { // note: do not return ERR::NOT_SUPPORTED et al. because that would // break tex_write (which assumes either this, 0 or errors are returned). diff --git a/source/lib/tex/tex_png.cpp b/source/lib/tex/tex_png.cpp index 1cd40842d7..4d54d5cce5 100644 --- a/source/lib/tex/tex_png.cpp +++ b/source/lib/tex/tex_png.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -99,7 +99,7 @@ static void io_write(png_struct* png_ptr, u8* data, png_size_t length) } -static void io_flush(png_structp UNUSED(png_ptr)) +static void io_flush(png_structp) { } @@ -107,7 +107,7 @@ static void io_flush(png_structp UNUSED(png_ptr)) //----------------------------------------------------------------------------- -Status TexCodecPng::transform(Tex* UNUSED(t), size_t UNUSED(transforms)) const +Status TexCodecPng::transform(Tex*, size_t UNUSED(transforms)) const { return INFO::TEX_CODEC_CANNOT_HANDLE; } @@ -257,7 +257,7 @@ size_t TexCodecPng::hdr_size(const u8* UNUSED(file)) const return 0; // libpng returns decoded image data; no header } -static void user_warning_fn(png_structp UNUSED(png_ptr), png_const_charp warning_msg) +static void user_warning_fn(png_structp, png_const_charp warning_msg) { // Suppress this warning because it's useless and occurs on a large number of files // see https://gitea.wildfiregames.com/0ad/0ad/issues/2184 diff --git a/source/lib/tex/tex_tga.cpp b/source/lib/tex/tex_tga.cpp index 015fb259ca..2cf9e1edf3 100644 --- a/source/lib/tex/tex_tga.cpp +++ b/source/lib/tex/tex_tga.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * * Permission is hereby granted, free of charge, to any person obtaining * a copy of this software and associated documentation files (the @@ -67,7 +67,7 @@ TgaHeader; #pragma pack(pop) -Status TexCodecTga::transform(Tex* UNUSED(t), size_t UNUSED(transforms)) const +Status TexCodecTga::transform(Tex*, size_t UNUSED(transforms)) const { return INFO::TEX_CODEC_CANNOT_HANDLE; } diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp index 697056cad9..6dd758e893 100644 --- a/source/lobby/XmppClient.cpp +++ b/source/lobby/XmppClient.cpp @@ -302,7 +302,7 @@ bool XmppClient::onTLSConnect(const gloox::CertInfo& info) /** * Handle MUC room errors */ -void XmppClient::handleMUCError(gloox::MUCRoom* UNUSED(room), gloox::StanzaError err) +void XmppClient::handleMUCError(gloox::MUCRoom*, gloox::StanzaError err) { DbgXMPP("MUC Error " << ": " << StanzaErrorToString(err)); CreateGUIMessage("system", "error", std::time(nullptr), "text", err); @@ -657,7 +657,7 @@ JS::Value XmppClient::GUIGetProfile(const ScriptRequest& rq) * Message interfaces * *****************************************************/ -void SetGUIMessageProperty(const ScriptRequest& UNUSED(rq), JS::HandleObject UNUSED(messageObj)) +void SetGUIMessageProperty(const ScriptRequest&, JS::HandleObject UNUSED(messageObj)) { } @@ -783,7 +783,7 @@ void XmppClient::SendMUCMessage(const std::string& message) /** * Handle a room message. */ -void XmppClient::handleMUCMessage(gloox::MUCRoom* UNUSED(room), const gloox::Message& msg, bool priv) +void XmppClient::handleMUCMessage(gloox::MUCRoom*, const gloox::Message& msg, bool priv) { DbgXMPP(msg.from().resource() << " said " << msg.body()); @@ -1015,7 +1015,8 @@ bool XmppClient::handleIq(const gloox::IQ& iq) /** * Update local data when a user changes presence. */ -void XmppClient::handleMUCParticipantPresence(gloox::MUCRoom* UNUSED(room), const gloox::MUCRoomParticipant participant, const gloox::Presence& presence) +void XmppClient::handleMUCParticipantPresence(gloox::MUCRoom*, const gloox::MUCRoomParticipant participant, + const gloox::Presence& presence) { const std::string& nick = participant.nick->resource(); @@ -1134,7 +1135,7 @@ void XmppClient::handleMUCParticipantPresence(gloox::MUCRoom* UNUSED(room), cons /** * Update local cache when subject changes. */ -void XmppClient::handleMUCSubject(gloox::MUCRoom* UNUSED(room), const std::string& nick, const std::string& subject) +void XmppClient::handleMUCSubject(gloox::MUCRoom*, const std::string& nick, const std::string& subject) { m_Subject = wstring_from_utf8(subject); @@ -1525,7 +1526,8 @@ void XmppClient::handleSessionAction(gloox::Jingle::Action action, gloox::Jingle handleSessionInitiation(session, jingle); } -void XmppClient::handleSessionInitiation(gloox::Jingle::Session* UNUSED(session), const gloox::Jingle::Session::Jingle* jingle) +void XmppClient::handleSessionInitiation(gloox::Jingle::Session*, + const gloox::Jingle::Session::Jingle* jingle) { gloox::Jingle::ICEUDP::Candidate candidate{}; diff --git a/source/ps/ArchiveBuilder.cpp b/source/ps/ArchiveBuilder.cpp index 37a51e5f01..30eefb9b36 100644 --- a/source/ps/ArchiveBuilder.cpp +++ b/source/ps/ArchiveBuilder.cpp @@ -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 @@ -176,7 +176,7 @@ void CArchiveBuilder::Build(const OsPath& archive, bool compress) debug_printf("Finished packaging \"%s\".", archive.string8().c_str()); } -Status CArchiveBuilder::CollectFileCB(const VfsPath& pathname, const CFileInfo& UNUSED(fileInfo), const uintptr_t cbData) +Status CArchiveBuilder::CollectFileCB(const VfsPath& pathname, const CFileInfo&, const uintptr_t cbData) { CArchiveBuilder* self = static_cast((void*)cbData); self->m_Files.push_back(pathname); diff --git a/source/ps/Replay.h b/source/ps/Replay.h index 646f84efc9..e7035064d8 100644 --- a/source/ps/Replay.h +++ b/source/ps/Replay.h @@ -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 @@ -71,9 +71,9 @@ class CDummyReplayLogger : public IReplayLogger { public: virtual void StartGame(JS::MutableHandleValue UNUSED(attribs)) { } - virtual void Turn(u32 UNUSED(n), u32 UNUSED(turnLength), std::vector& UNUSED(commands)) { } + virtual void Turn(u32 UNUSED(n), u32 UNUSED(turnLength), std::vector&) { } virtual void Hash(const std::string& UNUSED(hash), bool UNUSED(quick)) { } - virtual void SaveMetadata(const CSimulation2& UNUSED(simulation)) { }; + virtual void SaveMetadata(const CSimulation2&) { }; virtual OsPath GetDirectory() const { return OsPath(); } }; diff --git a/source/ps/TemplateLoader.cpp b/source/ps/TemplateLoader.cpp index cba5527a0a..e114707dad 100644 --- a/source/ps/TemplateLoader.cpp +++ b/source/ps/TemplateLoader.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -84,7 +84,7 @@ bool CTemplateLoader::LoadTemplateFile(CParamNode& node, std::string_view templa return true; } -static Status AddToTemplates(const VfsPath& pathname, const CFileInfo& UNUSED(fileInfo), const uintptr_t cbData) +static Status AddToTemplates(const VfsPath& pathname, const CFileInfo&, const uintptr_t cbData) { std::vector& templates = *(std::vector*)cbData; @@ -105,7 +105,7 @@ static Status AddToTemplates(const VfsPath& pathname, const CFileInfo& UNUSED(fi return INFO::OK; } -static Status AddToTemplatesUnrestricted(const VfsPath& pathname, const CFileInfo& UNUSED(fileInfo), const uintptr_t cbData) +static Status AddToTemplatesUnrestricted(const VfsPath& pathname, const CFileInfo&, const uintptr_t cbData) { std::vector& templates = *(std::vector*)cbData; @@ -120,7 +120,7 @@ static Status AddToTemplatesUnrestricted(const VfsPath& pathname, const CFileInf return INFO::OK; } -static Status AddActorToTemplates(const VfsPath& pathname, const CFileInfo& UNUSED(fileInfo), const uintptr_t cbData) +static Status AddActorToTemplates(const VfsPath& pathname, const CFileInfo&, const uintptr_t cbData) { std::vector& templates = *(std::vector*)cbData; diff --git a/source/ps/scripting/JSInterface_VFS.cpp b/source/ps/scripting/JSInterface_VFS.cpp index 52281bd5c2..7314dee746 100644 --- a/source/ps/scripting/JSInterface_VFS.cpp +++ b/source/ps/scripting/JSInterface_VFS.cpp @@ -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 @@ -103,7 +103,7 @@ struct BuildDirEntListState }; // called for each matching directory entry; add its full pathname to array. -static Status BuildDirEntListCB(const VfsPath& pathname, const CFileInfo& UNUSED(fileINfo), uintptr_t cbData) +static Status BuildDirEntListCB(const VfsPath& pathname, const CFileInfo&, uintptr_t cbData) { BuildDirEntListState* s = (BuildDirEntListState*)cbData; diff --git a/source/renderer/CPUSkinnedModelRenderer.cpp b/source/renderer/CPUSkinnedModelRenderer.cpp index b3cbb20fde..916c360774 100644 --- a/source/renderer/CPUSkinnedModelRenderer.cpp +++ b/source/renderer/CPUSkinnedModelRenderer.cpp @@ -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 @@ -188,8 +188,7 @@ CModelRData* CPUSkinnedModelVertexRenderer::CreateModelData(const void* key, CMo return modelRData; } -void CPUSkinnedModelVertexRenderer::UpdateModelsData( - Renderer::Backend::IDeviceCommandContext* UNUSED(deviceCommandContext), +void CPUSkinnedModelVertexRenderer::UpdateModelsData(Renderer::Backend::IDeviceCommandContext*, PS::span models) { for (CModel* model : models) @@ -264,8 +263,8 @@ void CPUSkinnedModelVertexRenderer::PrepareModelDef( // Render one model void CPUSkinnedModelVertexRenderer::RenderModel( - Renderer::Backend::IDeviceCommandContext* deviceCommandContext, - Renderer::Backend::IShaderProgram* UNUSED(shader), CModel* model, CModelRData* data) + Renderer::Backend::IDeviceCommandContext* deviceCommandContext, Renderer::Backend::IShaderProgram*, + CModel* model, CModelRData* data) { const CModelDefPtr& mdldef = model->GetModelDef(); ModelRData* modelRData = static_cast(data); diff --git a/source/renderer/GPUSkinnedModelRenderer.cpp b/source/renderer/GPUSkinnedModelRenderer.cpp index 75bc145f1c..b3da7f0928 100644 --- a/source/renderer/GPUSkinnedModelRenderer.cpp +++ b/source/renderer/GPUSkinnedModelRenderer.cpp @@ -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 @@ -433,9 +433,8 @@ void GPUSkinnedModelModelRenderer::UpdateModelData( } } -void GPUSkinnedModelModelRenderer::UploadModelsData( - Renderer::Backend::IDeviceCommandContext* UNUSED(deviceCommandContext), - PS::span UNUSED(models)) +void GPUSkinnedModelModelRenderer::UploadModelsData(Renderer::Backend::IDeviceCommandContext*, + PS::span) { } @@ -459,8 +458,8 @@ void GPUSkinnedModelModelRenderer::PrepareModelDef( } void GPUSkinnedModelModelRenderer::RenderModel( - Renderer::Backend::IDeviceCommandContext* deviceCommandContext, - Renderer::Backend::IShaderProgram* UNUSED(shader), CModel* model, CModelRData* data) + Renderer::Backend::IDeviceCommandContext* deviceCommandContext, Renderer::Backend::IShaderProgram*, + CModel* model, CModelRData* data) { ModelRData* modelRData{static_cast(data)}; diff --git a/source/renderer/InstancingModelRenderer.cpp b/source/renderer/InstancingModelRenderer.cpp index 2bddcb2914..b57580ef50 100644 --- a/source/renderer/InstancingModelRenderer.cpp +++ b/source/renderer/InstancingModelRenderer.cpp @@ -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 @@ -257,16 +257,14 @@ CModelRData* InstancingModelRenderer::CreateModelData(const void* key, CModel* m return new CModelRData(key); } -void InstancingModelRenderer::UpdateModelsData( - Renderer::Backend::IDeviceCommandContext* UNUSED(deviceCommandContext), - PS::span UNUSED(models)) +void InstancingModelRenderer::UpdateModelsData(Renderer::Backend::IDeviceCommandContext*, + PS::span) { // We have no per-CModel data } -void InstancingModelRenderer::UploadModelsData( - Renderer::Backend::IDeviceCommandContext* UNUSED(deviceCommandContext), - PS::span UNUSED(models)) +void InstancingModelRenderer::UploadModelsData(Renderer::Backend::IDeviceCommandContext*, + PS::span) { // Data uploaded once during creation as we don't update it dynamically. } @@ -292,9 +290,8 @@ void InstancingModelRenderer::PrepareModelDef( // Render one model -void InstancingModelRenderer::RenderModel( - Renderer::Backend::IDeviceCommandContext* deviceCommandContext, - Renderer::Backend::IShaderProgram* UNUSED(shader), CModel* model, CModelRData* UNUSED(data)) +void InstancingModelRenderer::RenderModel(Renderer::Backend::IDeviceCommandContext* deviceCommandContext, + Renderer::Backend::IShaderProgram*, CModel* model, CModelRData*) { const CModelDefPtr& mdldef = model->GetModelDef(); diff --git a/source/renderer/MikktspaceWrap.cpp b/source/renderer/MikktspaceWrap.cpp index 5a09378c46..22483e1390 100644 --- a/source/renderer/MikktspaceWrap.cpp +++ b/source/renderer/MikktspaceWrap.cpp @@ -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 @@ -49,7 +49,7 @@ int MikkTSpace::GetNumFaces(const SMikkTSpaceContext* pContext) return GetUserDataFromContext(pContext)->m_Model->GetNumFaces(); } -int MikkTSpace::GetNumVerticesOfFace(const SMikkTSpaceContext* UNUSED(pContext), const int UNUSED(iFace)) +int MikkTSpace::GetNumVerticesOfFace(const SMikkTSpaceContext*, const int UNUSED(iFace)) { return 3; } diff --git a/source/renderer/SilhouetteRenderer.cpp b/source/renderer/SilhouetteRenderer.cpp index df55470204..e9c9902aa2 100644 --- a/source/renderer/SilhouetteRenderer.cpp +++ b/source/renderer/SilhouetteRenderer.cpp @@ -444,8 +444,7 @@ void SilhouetteRenderer::RenderSubmitCasters(SceneCollector& collector) collector.SubmitNonRecursive(m_VisibleModelCasters[i]); } -void SilhouetteRenderer::RenderDebugBounds( - Renderer::Backend::IDeviceCommandContext* UNUSED(deviceCommandContext)) +void SilhouetteRenderer::RenderDebugBounds(Renderer::Backend::IDeviceCommandContext*) { if (m_DebugBounds.empty()) return; diff --git a/source/renderer/TerrainOverlay.h b/source/renderer/TerrainOverlay.h index b8337b2399..385d260534 100644 --- a/source/renderer/TerrainOverlay.h +++ b/source/renderer/TerrainOverlay.h @@ -47,10 +47,9 @@ class ITerrainOverlay public: virtual ~ITerrainOverlay(); - virtual void RenderBeforeWater(Renderer::Backend::IDeviceCommandContext* UNUSED(deviceCommandContext)) { } + virtual void RenderBeforeWater(Renderer::Backend::IDeviceCommandContext*) { } - virtual void RenderAfterWater( - Renderer::Backend::IDeviceCommandContext* UNUSED(deviceCommandContext), int UNUSED(cullGroup)) { } + virtual void RenderAfterWater(Renderer::Backend::IDeviceCommandContext*, int UNUSED(cullGroup)) { } /** * Draw all ITerrainOverlay objects that exist diff --git a/source/renderer/backend/dummy/Device.cpp b/source/renderer/backend/dummy/Device.cpp index e978f93dc8..083733903e 100644 --- a/source/renderer/backend/dummy/Device.cpp +++ b/source/renderer/backend/dummy/Device.cpp @@ -86,7 +86,7 @@ std::unique_ptr CDevice::CreateComputePipelineState( } std::unique_ptr CDevice::CreateVertexInputLayout( - const PS::span UNUSED(attributes)) + const PS::span) { return nullptr; } @@ -148,12 +148,12 @@ void CDevice::OnWindowResize(const uint32_t UNUSED(width), const uint32_t UNUSED { } -bool CDevice::IsTextureFormatSupported(const Format UNUSED(format)) const +bool CDevice::IsTextureFormatSupported(const Format) const { return true; } -bool CDevice::IsFramebufferFormatSupported(const Format UNUSED(format)) const +bool CDevice::IsFramebufferFormatSupported(const Format) const { return true; } @@ -183,7 +183,7 @@ uint64_t CDevice::GetQueryResult(const uint32_t UNUSED(handle)) return 0; } -std::unique_ptr CreateDevice(SDL_Window* UNUSED(window)) +std::unique_ptr CreateDevice(SDL_Window*) { return std::make_unique(); } diff --git a/source/renderer/backend/gl/ShaderProgram.cpp b/source/renderer/backend/gl/ShaderProgram.cpp index 0f66f0ecdb..ff2e81333d 100644 --- a/source/renderer/backend/gl/ShaderProgram.cpp +++ b/source/renderer/backend/gl/ShaderProgram.cpp @@ -1517,19 +1517,23 @@ std::unique_ptr CShaderProgram::Create(CDevice* device, const CS // These should all be overridden by CShaderProgramGLSL // (GLES doesn't support any other types of shader program): -void CShaderProgram::VertexPointer(const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer)) +void CShaderProgram::VertexPointer(const Renderer::Backend::Format, GLsizei UNUSED(stride), + const void* UNUSED(pointer)) { debug_warn("CShaderProgram::VertexPointer should be overridden"); } -void CShaderProgram::NormalPointer(const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer)) +void CShaderProgram::NormalPointer(const Renderer::Backend::Format, GLsizei UNUSED(stride), + const void* UNUSED(pointer)) { debug_warn("CShaderProgram::NormalPointer should be overridden"); } -void CShaderProgram::ColorPointer(const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer)) +void CShaderProgram::ColorPointer(const Renderer::Backend::Format, GLsizei UNUSED(stride), + const void* UNUSED(pointer)) { debug_warn("CShaderProgram::ColorPointer should be overridden"); } -void CShaderProgram::TexCoordPointer(GLenum UNUSED(texture), const Renderer::Backend::Format UNUSED(format), GLsizei UNUSED(stride), const void* UNUSED(pointer)) +void CShaderProgram::TexCoordPointer(GLenum UNUSED(texture), const Renderer::Backend::Format, + GLsizei UNUSED(stride), const void* UNUSED(pointer)) { debug_warn("CShaderProgram::TexCoordPointer should be overridden"); } diff --git a/source/scriptinterface/ScriptContext.cpp b/source/scriptinterface/ScriptContext.cpp index 7b5a157ce4..6c07d49e60 100644 --- a/source/scriptinterface/ScriptContext.cpp +++ b/source/scriptinterface/ScriptContext.cpp @@ -31,7 +31,7 @@ #include "js/friend/PerformanceHint.h" #include "js/Modules.h" -void GCSliceCallbackHook(JSContext* UNUSED(cx), JS::GCProgress progress, const JS::GCDescription& UNUSED(desc)) +void GCSliceCallbackHook(JSContext*, JS::GCProgress progress, const JS::GCDescription&) { /** * From the GCAPI.h file: diff --git a/source/scriptinterface/ScriptConversions.cpp b/source/scriptinterface/ScriptConversions.cpp index f86d19d5da..a3ccde4fef 100644 --- a/source/scriptinterface/ScriptConversions.cpp +++ b/source/scriptinterface/ScriptConversions.cpp @@ -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 @@ -186,37 +186,37 @@ template<> bool Script::FromJSVal(const ScriptRequest& rq, JS::HandleVa //////////////////////////////////////////////////////////////// // Primitive types: -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, const bool& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, const bool& val) { ret.setBoolean(val); } -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, const float& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, const float& val) { ret.set(JS::NumberValue(val)); } -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, const double& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, const double& val) { ret.set(JS::NumberValue(val)); } -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, const i32& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, const i32& val) { ret.set(JS::NumberValue(val)); } -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, const u16& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, const u16& val) { ret.set(JS::NumberValue(val)); } -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, const u8& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, const u8& val) { ret.set(JS::NumberValue(val)); } -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, const u32& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, const u32& val) { ret.set(JS::NumberValue(val)); } diff --git a/source/scriptinterface/ScriptConversions.h b/source/scriptinterface/ScriptConversions.h index ac1187666d..5fd917268d 100644 --- a/source/scriptinterface/ScriptConversions.h +++ b/source/scriptinterface/ScriptConversions.h @@ -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 @@ -42,25 +42,29 @@ template bool FromJSVal(const ScriptRequest& rq, const JS::HandleVal template void ToJSVal(const ScriptRequest& rq, JS::MutableHandleValue ret, T const& val); template<> -inline void ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue handle, const JS::PersistentRootedValue& a) +inline void ToJSVal(const ScriptRequest&, JS::MutableHandleValue handle, + const JS::PersistentRootedValue& a) { handle.set(a); } template<> -inline void ToJSVal >(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue handle, const JS::Heap& a) +inline void ToJSVal >(const ScriptRequest&, JS::MutableHandleValue handle, + const JS::Heap& a) { handle.set(a); } template<> -inline void ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue handle, const JS::RootedValue& a) +inline void ToJSVal(const ScriptRequest&, JS::MutableHandleValue handle, + const JS::RootedValue& a) { handle.set(a); } template <> -inline void ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue handle, const JS::HandleValue& a) +inline void ToJSVal(const ScriptRequest&, JS::MutableHandleValue handle, + const JS::HandleValue& a) { handle.set(a); } diff --git a/source/simulation2/components/CCmpAIManager.cpp b/source/simulation2/components/CCmpAIManager.cpp index e185a81cc4..2b5b94832b 100644 --- a/source/simulation2/components/CCmpAIManager.cpp +++ b/source/simulation2/components/CCmpAIManager.cpp @@ -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 @@ -870,7 +870,7 @@ private: class CCmpAIManager final : public ICmpAIManager { public: - static void ClassInit(CComponentManager& UNUSED(componentManager)) + static void ClassInit(CComponentManager&) { } @@ -881,7 +881,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_Worker.Init(GetSimContext().GetScriptInterface()); diff --git a/source/simulation2/components/CCmpCinemaManager.cpp b/source/simulation2/components/CCmpCinemaManager.cpp index 015ce8f4b4..e7e6afc346 100644 --- a/source/simulation2/components/CCmpCinemaManager.cpp +++ b/source/simulation2/components/CCmpCinemaManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -44,7 +44,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_Enabled = false; m_MapRevealed = false; @@ -73,7 +73,7 @@ public: serializer.String("PathName", path.GetName(), 1, 128); } - void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserializer) override + void Deserialize(const CParamNode&, IDeserializer& deserializer) override { deserializer.Bool("Enabled", m_Enabled); deserializer.NumberFixed_Unbounded("ElapsedTime", m_ElapsedTime); diff --git a/source/simulation2/components/CCmpCommandQueue.cpp b/source/simulation2/components/CCmpCommandQueue.cpp index c6bbaf0db6..497b50c80d 100644 --- a/source/simulation2/components/CCmpCommandQueue.cpp +++ b/source/simulation2/components/CCmpCommandQueue.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -30,7 +30,7 @@ class CCmpCommandQueue final : public ICmpCommandQueue { public: - static void ClassInit(CComponentManager& UNUSED(componentManager)) + static void ClassInit(CComponentManager&) { } @@ -43,7 +43,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { } @@ -63,7 +63,7 @@ public: } } - void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override + void Deserialize(const CParamNode&, IDeserializer& deserialize) override { ScriptRequest rq(GetSimContext().GetScriptInterface()); diff --git a/source/simulation2/components/CCmpDecay.cpp b/source/simulation2/components/CCmpDecay.cpp index d6e618a362..9f6e212089 100644 --- a/source/simulation2/components/CCmpDecay.cpp +++ b/source/simulation2/components/CCmpDecay.cpp @@ -47,7 +47,7 @@ class CCmpDecay final : public ICmpDecay { public: - static void ClassInit(CComponentManager& UNUSED(componentManager)) + static void ClassInit(CComponentManager&) { } @@ -115,12 +115,12 @@ public: { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { // This component isn't network-synchronised, so don't serialize anything } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpFootprint.cpp b/source/simulation2/components/CCmpFootprint.cpp index 0d82faccc1..8cd0491339 100644 --- a/source/simulation2/components/CCmpFootprint.cpp +++ b/source/simulation2/components/CCmpFootprint.cpp @@ -34,7 +34,7 @@ class CCmpFootprint final : public ICmpFootprint { public: - static void ClassInit(CComponentManager& UNUSED(componentManager)) + static void ClassInit(CComponentManager&) { } @@ -125,12 +125,12 @@ public: { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { // No dynamic state to serialize } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpMotionBall.cpp b/source/simulation2/components/CCmpMotionBall.cpp index 8b5935a786..a4fead2a6a 100644 --- a/source/simulation2/components/CCmpMotionBall.cpp +++ b/source/simulation2/components/CCmpMotionBall.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -43,7 +43,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_SpeedX = 0; m_SpeedZ = 0; diff --git a/source/simulation2/components/CCmpObstructionManager.cpp b/source/simulation2/components/CCmpObstructionManager.cpp index 3d2c1a1fd6..3b697cd742 100644 --- a/source/simulation2/components/CCmpObstructionManager.cpp +++ b/source/simulation2/components/CCmpObstructionManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -160,7 +160,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_DebugOverlayEnabled = false; m_DebugOverlayDirty = true; diff --git a/source/simulation2/components/CCmpOverlayRenderer.cpp b/source/simulation2/components/CCmpOverlayRenderer.cpp index 16dab96291..140bff1327 100644 --- a/source/simulation2/components/CCmpOverlayRenderer.cpp +++ b/source/simulation2/components/CCmpOverlayRenderer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -61,7 +61,7 @@ public: return ""; } - void Init(const CParamNode &UNUSED(paramNode)) override + void Init(const CParamNode&) override { } @@ -69,14 +69,14 @@ public: { } - void Serialize(ISerializer &UNUSED(serialize)) override + void Serialize(ISerializer&) override { // TODO: should we do anything here? // or should we expect other components to reinitialise us // after deserialization? } - void Deserialize(const CParamNode ¶mNode, IDeserializer &UNUSED(deserialize)) override + void Deserialize(const CParamNode ¶mNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpOwnership.cpp b/source/simulation2/components/CCmpOwnership.cpp index b471be11d2..64f8098da0 100644 --- a/source/simulation2/components/CCmpOwnership.cpp +++ b/source/simulation2/components/CCmpOwnership.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -45,7 +45,7 @@ public: ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_Owner = INVALID_PLAYER; } @@ -59,7 +59,7 @@ public: serialize.NumberI32_Unbounded("owner", m_Owner); } - void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override + void Deserialize(const CParamNode&, IDeserializer& deserialize) override { deserialize.NumberI32_Unbounded("owner", m_Owner); } diff --git a/source/simulation2/components/CCmpParticleManager.cpp b/source/simulation2/components/CCmpParticleManager.cpp index 12953e324b..6cd32137cb 100644 --- a/source/simulation2/components/CCmpParticleManager.cpp +++ b/source/simulation2/components/CCmpParticleManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -42,7 +42,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { useSimTime = true; } @@ -51,11 +51,11 @@ public: { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpPathfinder.cpp b/source/simulation2/components/CCmpPathfinder.cpp index 2f6603c4aa..705d5b4241 100644 --- a/source/simulation2/components/CCmpPathfinder.cpp +++ b/source/simulation2/components/CCmpPathfinder.cpp @@ -48,7 +48,7 @@ REGISTER_COMPONENT_TYPE(Pathfinder) -void CCmpPathfinder::Init(const CParamNode& UNUSED(paramNode)) +void CCmpPathfinder::Init(const CParamNode&) { m_GridSize = 0; m_Grid = NULL; diff --git a/source/simulation2/components/CCmpProjectileManager.cpp b/source/simulation2/components/CCmpProjectileManager.cpp index b8ed2cead3..24fea6f927 100644 --- a/source/simulation2/components/CCmpProjectileManager.cpp +++ b/source/simulation2/components/CCmpProjectileManager.cpp @@ -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 @@ -57,7 +57,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_ActorSeed = 0; m_NextId = 1; diff --git a/source/simulation2/components/CCmpRallyPointRenderer.cpp b/source/simulation2/components/CCmpRallyPointRenderer.cpp index 60958fd481..a71b3979cd 100644 --- a/source/simulation2/components/CCmpRallyPointRenderer.cpp +++ b/source/simulation2/components/CCmpRallyPointRenderer.cpp @@ -142,12 +142,12 @@ void CCmpRallyPointRenderer::Deinit() { } -void CCmpRallyPointRenderer::Serialize(ISerializer& UNUSED(serialize)) +void CCmpRallyPointRenderer::Serialize(ISerializer&) { // Do NOT serialize anything; this is a rendering-only component, it does not and should not affect simulation state } -void CCmpRallyPointRenderer::Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) +void CCmpRallyPointRenderer::Deserialize(const CParamNode& paramNode, IDeserializer&) { Init(paramNode); // The dependent components have not been deserialized, so the color is loaded on first SetDisplayed diff --git a/source/simulation2/components/CCmpRallyPointRenderer.h b/source/simulation2/components/CCmpRallyPointRenderer.h index e283b03fed..3b0efd07ff 100644 --- a/source/simulation2/components/CCmpRallyPointRenderer.h +++ b/source/simulation2/components/CCmpRallyPointRenderer.h @@ -75,8 +75,8 @@ public: void Init(const CParamNode& paramNode) override; void Deinit() override; - void Serialize(ISerializer& UNUSED(serialize)) override; - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override; + void Serialize(ISerializer&) override; + void Deserialize(const CParamNode& paramNode, IDeserializer&) override; void HandleMessage(const CMessage& msg, bool UNUSED(global)) override; diff --git a/source/simulation2/components/CCmpRangeManager.cpp b/source/simulation2/components/CCmpRangeManager.cpp index d54318caef..e3a48b514d 100644 --- a/source/simulation2/components/CCmpRangeManager.cpp +++ b/source/simulation2/components/CCmpRangeManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -300,7 +300,7 @@ struct SerializeHelper serialize.Bool("account for size",value.accountForSize); } - void operator()(ISerializer& serialize, const char* name, Query& value, const CSimContext& UNUSED(context)) + void operator()(ISerializer& serialize, const char* name, Query& value, const CSimContext&) { Common(serialize, name, value); @@ -436,7 +436,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_QueryNext = 1; diff --git a/source/simulation2/components/CCmpRangeOverlayRenderer.cpp b/source/simulation2/components/CCmpRangeOverlayRenderer.cpp index 5c3a3b4c51..838c2eb94d 100644 --- a/source/simulation2/components/CCmpRangeOverlayRenderer.cpp +++ b/source/simulation2/components/CCmpRangeOverlayRenderer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -56,7 +56,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_Enabled = m_LastEnabledState = false; UpdateMessageSubscriptions(); @@ -64,11 +64,11 @@ public: void Deinit() override { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpSelectable.cpp b/source/simulation2/components/CCmpSelectable.cpp index ef82042dde..5b3fdc4e89 100644 --- a/source/simulation2/components/CCmpSelectable.cpp +++ b/source/simulation2/components/CCmpSelectable.cpp @@ -217,13 +217,13 @@ public: void Deinit() override { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { // Nothing to do here (the overlay object is not worth saving, it'll get // reconstructed by the GUI soon enough, I think) } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { // Need to call Init to reload the template properties Init(paramNode); diff --git a/source/simulation2/components/CCmpSoundManager.cpp b/source/simulation2/components/CCmpSoundManager.cpp index bd0dd1d53a..e86a1f159c 100644 --- a/source/simulation2/components/CCmpSoundManager.cpp +++ b/source/simulation2/components/CCmpSoundManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -30,7 +30,7 @@ class CCmpSoundManager final : public ICmpSoundManager { public: - static void ClassInit(CComponentManager& UNUSED(componentManager) ) + static void ClassInit(CComponentManager&) { } @@ -41,7 +41,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { } @@ -49,13 +49,13 @@ public: { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { // Do nothing here - sounds are purely local, and don't need to be preserved across saved games etc // (If we add music support in here then we might want to save the music state, though) } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpTemplateManager.cpp b/source/simulation2/components/CCmpTemplateManager.cpp index 6ad5b560ca..b2734cae1c 100644 --- a/source/simulation2/components/CCmpTemplateManager.cpp +++ b/source/simulation2/components/CCmpTemplateManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -43,7 +43,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_DisableValidation = false; diff --git a/source/simulation2/components/CCmpTerrain.cpp b/source/simulation2/components/CCmpTerrain.cpp index 0d7332458c..4fbae66abe 100644 --- a/source/simulation2/components/CCmpTerrain.cpp +++ b/source/simulation2/components/CCmpTerrain.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -32,7 +32,7 @@ class CCmpTerrain final : public ICmpTerrain { public: - static void ClassInit(CComponentManager& UNUSED(componentManager)) + static void ClassInit(CComponentManager&) { } @@ -45,7 +45,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_Terrain = &GetSimContext().GetTerrain(); } @@ -54,11 +54,11 @@ public: { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpTerritoryInfluence.cpp b/source/simulation2/components/CCmpTerritoryInfluence.cpp index d6228d40ba..eb855068f3 100644 --- a/source/simulation2/components/CCmpTerritoryInfluence.cpp +++ b/source/simulation2/components/CCmpTerritoryInfluence.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -27,7 +27,7 @@ class CCmpTerritoryInfluence final : public ICmpTerritoryInfluence { public: - static void ClassInit(CComponentManager& UNUSED(componentManager)) + static void ClassInit(CComponentManager&) { } @@ -64,11 +64,11 @@ public: { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpTerritoryManager.cpp b/source/simulation2/components/CCmpTerritoryManager.cpp index b6e2463899..cda01e9cac 100644 --- a/source/simulation2/components/CCmpTerritoryManager.cpp +++ b/source/simulation2/components/CCmpTerritoryManager.cpp @@ -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 @@ -117,7 +117,7 @@ public: bool m_EnableLineDebugOverlays; ///< Enable node debugging overlays for boundary lines? std::vector m_DebugBoundaryLineNodes; - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_Territories = NULL; m_CostGrid = NULL; diff --git a/source/simulation2/components/CCmpTest.cpp b/source/simulation2/components/CCmpTest.cpp index f3ce4cd53b..1791c20b47 100644 --- a/source/simulation2/components/CCmpTest.cpp +++ b/source/simulation2/components/CCmpTest.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -59,7 +59,7 @@ public: serialize.NumberI32_Unbounded("x", m_x); } - void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override + void Deserialize(const CParamNode&, IDeserializer& deserialize) override { deserialize.NumberI32_Unbounded("x", m_x); } @@ -123,7 +123,7 @@ public: serialize.NumberI32_Unbounded("x", m_x); } - void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override + void Deserialize(const CParamNode&, IDeserializer& deserialize) override { deserialize.NumberI32_Unbounded("x", m_x); } @@ -184,7 +184,7 @@ public: serialize.NumberI32_Unbounded("x", m_x); } - void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& deserialize) override + void Deserialize(const CParamNode&, IDeserializer& deserialize) override { deserialize.NumberI32_Unbounded("x", m_x); } diff --git a/source/simulation2/components/CCmpUnitMotionManager.h b/source/simulation2/components/CCmpUnitMotionManager.h index 6e971e7bef..ee2f5a7fe0 100644 --- a/source/simulation2/components/CCmpUnitMotionManager.h +++ b/source/simulation2/components/CCmpUnitMotionManager.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -125,7 +125,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override; + void Init(const CParamNode&) override; void Deinit() override { diff --git a/source/simulation2/components/CCmpUnitRenderer.cpp b/source/simulation2/components/CCmpUnitRenderer.cpp index 11c0655ffa..45a2a38942 100644 --- a/source/simulation2/components/CCmpUnitRenderer.cpp +++ b/source/simulation2/components/CCmpUnitRenderer.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -138,7 +138,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { m_FrameNumber = 0; m_FrameOffset = 0.0f; @@ -149,11 +149,11 @@ public: { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpVision.cpp b/source/simulation2/components/CCmpVision.cpp index b67da73972..fedba46465 100644 --- a/source/simulation2/components/CCmpVision.cpp +++ b/source/simulation2/components/CCmpVision.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -72,12 +72,12 @@ public: { } - void Serialize(ISerializer& UNUSED(serialize)) override + void Serialize(ISerializer&) override { // No dynamic state to serialize } - void Deserialize(const CParamNode& paramNode, IDeserializer& UNUSED(deserialize)) override + void Deserialize(const CParamNode& paramNode, IDeserializer&) override { Init(paramNode); } diff --git a/source/simulation2/components/CCmpWaterManager.cpp b/source/simulation2/components/CCmpWaterManager.cpp index 184a893d7f..3255e8b96b 100644 --- a/source/simulation2/components/CCmpWaterManager.cpp +++ b/source/simulation2/components/CCmpWaterManager.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -49,7 +49,7 @@ public: return ""; } - void Init(const CParamNode& UNUSED(paramNode)) override + void Init(const CParamNode&) override { } diff --git a/source/simulation2/components/ICmpAIManager.cpp b/source/simulation2/components/ICmpAIManager.cpp index 434d17e5ad..c39314fffe 100644 --- a/source/simulation2/components/ICmpAIManager.cpp +++ b/source/simulation2/components/ICmpAIManager.cpp @@ -54,7 +54,7 @@ public: vfs::ForEachFile(g_VFS, L"simulation/ai/", Callback, (uintptr_t)this, L"*.json", vfs::DIR_RECURSIVE); } - static Status Callback(const VfsPath& pathname, const CFileInfo& UNUSED(fileInfo), const uintptr_t cbData) + static Status Callback(const VfsPath& pathname, const CFileInfo&, const uintptr_t cbData) { GetAIsHelper* self = (GetAIsHelper*)cbData; ScriptRequest rq(self->m_ScriptInterface); diff --git a/source/simulation2/components/ICmpObstructionManager.h b/source/simulation2/components/ICmpObstructionManager.h index 15a74d9db5..a6f5ead43b 100644 --- a/source/simulation2/components/ICmpObstructionManager.h +++ b/source/simulation2/components/ICmpObstructionManager.h @@ -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 @@ -377,7 +377,7 @@ public: class NullObstructionFilter : public IObstructionTestFilter { public: - virtual bool TestShape(tag_t UNUSED(tag), flags_t UNUSED(flags), entity_id_t UNUSED(group), entity_id_t UNUSED(group2)) const + virtual bool TestShape(tag_t, flags_t, entity_id_t UNUSED(group), entity_id_t UNUSED(group2)) const { return true; } @@ -389,7 +389,7 @@ public: class StationaryOnlyObstructionFilter : public IObstructionTestFilter { public: - virtual bool TestShape(tag_t UNUSED(tag), flags_t flags, entity_id_t UNUSED(group), entity_id_t UNUSED(group2)) const + virtual bool TestShape(tag_t, flags_t flags, entity_id_t UNUSED(group), entity_id_t UNUSED(group2)) const { return !(flags & ICmpObstructionManager::FLAG_MOVING); } @@ -409,7 +409,7 @@ public: m_AvoidMoving(avoidMoving), m_Group(group) {} - virtual bool TestShape(tag_t UNUSED(tag), flags_t flags, entity_id_t group, entity_id_t group2) const + virtual bool TestShape(tag_t, flags_t flags, entity_id_t group, entity_id_t group2) const { if (group == m_Group || (group2 != INVALID_ENTITY && group2 == m_Group)) return false; @@ -457,7 +457,7 @@ public: Init(); } - virtual bool TestShape(tag_t UNUSED(tag), flags_t flags, entity_id_t group, entity_id_t group2) const + virtual bool TestShape(tag_t, flags_t flags, entity_id_t group, entity_id_t group2) const { // Don't test shapes that share one or more of our control groups. if (group == m_Group || group == m_Group2 || (group2 != INVALID_ENTITY && @@ -531,7 +531,7 @@ public: { } - virtual bool TestShape(tag_t tag, flags_t UNUSED(flags), entity_id_t UNUSED(group), entity_id_t UNUSED(group2)) const + virtual bool TestShape(tag_t tag, flags_t, entity_id_t UNUSED(group), entity_id_t UNUSED(group2)) const { return tag.n != m_Tag.n; } diff --git a/source/simulation2/components/tests/test_ObstructionManager.h b/source/simulation2/components/tests/test_ObstructionManager.h index 694881e586..d39a339f1c 100644 --- a/source/simulation2/components/tests/test_ObstructionManager.h +++ b/source/simulation2/components/tests/test_ObstructionManager.h @@ -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 @@ -41,7 +41,7 @@ public: 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(); } bool CheckDuplicateFoundation() const override { return true; } - std::vector GetEntitiesByFlags(ICmpObstructionManager::flags_t UNUSED(flags)) const override { return std::vector(); } + std::vector GetEntitiesByFlags(ICmpObstructionManager::flags_t) const override { return std::vector(); } std::vector GetEntitiesBlockingMovement() const override { return std::vector(); } std::vector GetEntitiesBlockingConstruction() const override { return std::vector(); } std::vector GetEntitiesDeletedUponConstruction() const override { return std::vector(); } diff --git a/source/simulation2/docs/SimulationDocs.h b/source/simulation2/docs/SimulationDocs.h index 4157f9a9c1..c3b19a2050 100644 --- a/source/simulation2/docs/SimulationDocs.h +++ b/source/simulation2/docs/SimulationDocs.h @@ -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 @@ -528,12 +528,12 @@ with a set of scalar fields.) If you don't want to support scripts sending/receiving the message, you can implement stub functions instead: @code -JS::Value CMessageExample::ToJSVal(const ScriptInterface& UNUSED(scriptInterface)) const +JS::Value CMessageExample::ToJSVal(const ScriptInterface&) const { return JS::UndefinedValue(); } -CMessage* CMessageExample::FromJSVal(const ScriptInterface& UNUSED(scriptInterface), JS::HandleValue UNUSED(val)) +CMessage* CMessageExample::FromJSVal(const ScriptInterface&, JS::HandleValue) { return NULL; } diff --git a/source/simulation2/helpers/Selection.h b/source/simulation2/helpers/Selection.h index 26158dfb49..21cb508d38 100644 --- a/source/simulation2/helpers/Selection.h +++ b/source/simulation2/helpers/Selection.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2019 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 @@ -75,7 +75,7 @@ std::vector PickNonGaiaEntitiesInRect(CSimulation2& simulation, con */ struct DefaultComponentFilter { - bool operator()(IComponent* UNUSED(cmp)) + bool operator()(IComponent*) { return true; } diff --git a/source/simulation2/helpers/VertexPathfinder.cpp b/source/simulation2/helpers/VertexPathfinder.cpp index 9a5bf4f715..4c922b723f 100644 --- a/source/simulation2/helpers/VertexPathfinder.cpp +++ b/source/simulation2/helpers/VertexPathfinder.cpp @@ -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 @@ -1003,7 +1003,8 @@ void VertexPathfinderDebugOverlay::DebugRenderGraph(const CSimContext& simContex } } -void VertexPathfinderDebugOverlay::DebugRenderEdges(const CSimContext& UNUSED(simContext), bool UNUSED(visible), CFixedVector2D UNUSED(curr), CFixedVector2D UNUSED(npos)) +void VertexPathfinderDebugOverlay::DebugRenderEdges(const CSimContext&, bool UNUSED(visible), + CFixedVector2D UNUSED(curr), CFixedVector2D UNUSED(npos)) { if (!m_DebugOverlay) return; diff --git a/source/simulation2/scripting/EngineScriptConversions.cpp b/source/simulation2/scripting/EngineScriptConversions.cpp index 7f77629cec..47224766b1 100644 --- a/source/simulation2/scripting/EngineScriptConversions.cpp +++ b/source/simulation2/scripting/EngineScriptConversions.cpp @@ -35,7 +35,8 @@ #define FAIL(msg) STMT(LOGERROR(msg); return false) #define FAIL_VOID(msg) STMT(ScriptException::Raise(rq, msg); return) -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, IComponent* const& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, + IComponent* const& val) { if (val == NULL) { @@ -113,7 +114,7 @@ template<> bool Script::FromJSVal(const ScriptRequest& rq, JS::HandleVal return true; } -template<> void Script::ToJSVal(const ScriptRequest& UNUSED(rq), JS::MutableHandleValue ret, const fixed& val) +template<> void Script::ToJSVal(const ScriptRequest&, JS::MutableHandleValue ret, const fixed& val) { ret.set(JS::NumberValue(val.ToDouble())); } diff --git a/source/simulation2/scripting/MessageTypeConversions.cpp b/source/simulation2/scripting/MessageTypeConversions.cpp index 21cd689264..cac5c51882 100644 --- a/source/simulation2/scripting/MessageTypeConversions.cpp +++ b/source/simulation2/scripting/MessageTypeConversions.cpp @@ -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 @@ -64,7 +64,7 @@ JS::Value CMessageTurnStart::ToJSVal(const ScriptRequest& rq) const return JS::ObjectValue(*obj); } -CMessage* CMessageTurnStart::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageTurnStart::FromJSVal(const ScriptRequest&, JS::HandleValue) { return new CMessageTurnStart(); } @@ -112,13 +112,13 @@ CMessage* CMessageInterpolate::FromJSVal(const ScriptRequest& rq, JS::HandleValu //////////////////////////////// -JS::Value CMessageRenderSubmit::ToJSVal(const ScriptRequest& UNUSED(rq)) const +JS::Value CMessageRenderSubmit::ToJSVal(const ScriptRequest&) const { LOGWARNING("CMessageRenderSubmit::ToJSVal not implemented"); return JS::UndefinedValue(); } -CMessage* CMessageRenderSubmit::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageRenderSubmit::FromJSVal(const ScriptRequest&, JS::HandleValue) { LOGWARNING("CMessageRenderSubmit::FromJSVal not implemented"); return NULL; @@ -126,13 +126,13 @@ CMessage* CMessageRenderSubmit::FromJSVal(const ScriptRequest& UNUSED(rq), JS::H //////////////////////////////// -JS::Value CMessageProgressiveLoad::ToJSVal(const ScriptRequest& UNUSED(rq)) const +JS::Value CMessageProgressiveLoad::ToJSVal(const ScriptRequest&) const { LOGWARNING("CMessageProgressiveLoad::ToJSVal not implemented"); return JS::UndefinedValue(); } -CMessage* CMessageProgressiveLoad::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageProgressiveLoad::FromJSVal(const ScriptRequest&, JS::HandleValue) { LOGWARNING("CMessageProgressiveLoad::FromJSVal not implemented"); return NULL; @@ -230,13 +230,13 @@ CMessage* CMessagePositionChanged::FromJSVal(const ScriptRequest& rq, JS::Handle //////////////////////////////// -JS::Value CMessageInterpolatedPositionChanged::ToJSVal(const ScriptRequest& UNUSED(rq)) const +JS::Value CMessageInterpolatedPositionChanged::ToJSVal(const ScriptRequest&) const { LOGWARNING("CMessageInterpolatedPositionChanged::ToJSVal not implemented"); return JS::UndefinedValue(); } -CMessage* CMessageInterpolatedPositionChanged::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageInterpolatedPositionChanged::FromJSVal(const ScriptRequest&, JS::HandleValue) { LOGWARNING("CMessageInterpolatedPositionChanged::FromJSVal not implemented"); return NULL; @@ -329,7 +329,7 @@ JS::Value CMessageWaterChanged::ToJSVal(const ScriptRequest& rq) const return JS::ObjectValue(*obj); } -CMessage* CMessageWaterChanged::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageWaterChanged::FromJSVal(const ScriptRequest&, JS::HandleValue) { return new CMessageWaterChanged(); } @@ -342,7 +342,7 @@ JS::Value CMessageMovementObstructionChanged::ToJSVal(const ScriptRequest& rq) c return JS::ObjectValue(*obj); } -CMessage* CMessageMovementObstructionChanged::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageMovementObstructionChanged::FromJSVal(const ScriptRequest&, JS::HandleValue) { return new CMessageMovementObstructionChanged(); } @@ -355,7 +355,7 @@ JS::Value CMessageObstructionMapShapeChanged::ToJSVal(const ScriptRequest& rq) c return JS::ObjectValue(*obj); } -CMessage* CMessageObstructionMapShapeChanged::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageObstructionMapShapeChanged::FromJSVal(const ScriptRequest&, JS::HandleValue) { return new CMessageObstructionMapShapeChanged(); } @@ -368,7 +368,7 @@ JS::Value CMessageTerritoriesChanged::ToJSVal(const ScriptRequest& rq) const return JS::ObjectValue(*obj); } -CMessage* CMessageTerritoriesChanged::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageTerritoriesChanged::FromJSVal(const ScriptRequest&, JS::HandleValue) { return new CMessageTerritoriesChanged(); } @@ -384,7 +384,7 @@ JS::Value CMessageRangeUpdate::ToJSVal(const ScriptRequest& rq) const return JS::ObjectValue(*obj); } -CMessage* CMessageRangeUpdate::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageRangeUpdate::FromJSVal(const ScriptRequest&, JS::HandleValue) { LOGWARNING("CMessageRangeUpdate::FromJSVal not implemented"); return NULL; @@ -392,13 +392,13 @@ CMessage* CMessageRangeUpdate::FromJSVal(const ScriptRequest& UNUSED(rq), JS::Ha //////////////////////////////// -JS::Value CMessagePathResult::ToJSVal(const ScriptRequest& UNUSED(rq)) const +JS::Value CMessagePathResult::ToJSVal(const ScriptRequest&) const { LOGWARNING("CMessagePathResult::ToJSVal not implemented"); return JS::UndefinedValue(); } -CMessage* CMessagePathResult::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessagePathResult::FromJSVal(const ScriptRequest&, JS::HandleValue) { LOGWARNING("CMessagePathResult::FromJSVal not implemented"); return NULL; @@ -490,7 +490,7 @@ JS::Value CMessageMinimapPing::ToJSVal(const ScriptRequest& rq) const return JS::ObjectValue(*obj); } -CMessage* CMessageMinimapPing::FromJSVal(const ScriptRequest& UNUSED(rq), JS::HandleValue UNUSED(val)) +CMessage* CMessageMinimapPing::FromJSVal(const ScriptRequest&, JS::HandleValue) { return new CMessageMinimapPing(); } diff --git a/source/simulation2/scripting/ScriptComponent.h b/source/simulation2/scripting/ScriptComponent.h index bf47e7e4f7..e05f574f87 100644 --- a/source/simulation2/scripting/ScriptComponent.h +++ b/source/simulation2/scripting/ScriptComponent.h @@ -127,7 +127,7 @@ private: #define DEFAULT_SCRIPT_WRAPPER(cname) \ - static void ClassInit(CComponentManager& UNUSED(componentManager)) { } \ + static void ClassInit(CComponentManager&) { } \ void HandleMessage(const CMessage& msg, bool global) override \ { \ m_Script.HandleMessage(msg, global); \ diff --git a/source/simulation2/system/Component.h b/source/simulation2/system/Component.h index a3d242a97f..33a67b0e49 100644 --- a/source/simulation2/system/Component.h +++ b/source/simulation2/system/Component.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2022 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 @@ -49,16 +49,16 @@ { \ return -1; \ } \ - void Init(const CParamNode& UNUSED(paramNode)) override \ + void Init(const CParamNode&) override \ { \ } \ void Deinit() override \ { \ } \ - void Serialize(ISerializer& UNUSED(serialize)) override \ + void Serialize(ISerializer&) override \ { \ } \ - void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& UNUSED(deserialize)) override \ + void Deserialize(const CParamNode&, IDeserializer&) override \ { \ } \ diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp index 8b8a44c973..62665e591c 100644 --- a/source/simulation2/system/ComponentManager.cpp +++ b/source/simulation2/system/ComponentManager.cpp @@ -45,7 +45,7 @@ public: virtual int GetType() const { return mtid; } virtual const char* GetScriptHandlerName() const { return handlerName.c_str(); } virtual const char* GetScriptGlobalHandlerName() const { return globalHandlerName.c_str(); } - virtual JS::Value ToJSVal(const ScriptRequest& UNUSED(rq)) const { return msg.get(); } + virtual JS::Value ToJSVal(const ScriptRequest&) const { return msg.get(); } CMessageScripted(const ScriptRequest& rq, int mtid, const std::string& name, JS::HandleValue msg) : mtid(mtid), handlerName("On" + name), globalHandlerName("OnGlobal" + name), msg(rq.cx, msg) diff --git a/source/simulation2/system/IComponent.cpp b/source/simulation2/system/IComponent.cpp index 4a526065a8..241a1de044 100644 --- a/source/simulation2/system/IComponent.cpp +++ b/source/simulation2/system/IComponent.cpp @@ -45,6 +45,6 @@ void IComponent::RegisterComponentTypeScriptWrapper(CComponentManager& mgr, EInt mgr.RegisterComponentTypeScriptWrapper(iid, cid, alloc, dealloc, name, schema, classInit); } -void IComponent::HandleMessage(const CMessage& UNUSED(msg), bool UNUSED(global)) +void IComponent::HandleMessage(const CMessage&, bool UNUSED(global)) { } diff --git a/source/simulation2/system/LocalTurnManager.cpp b/source/simulation2/system/LocalTurnManager.cpp index 6aaf305e94..939f9cce07 100644 --- a/source/simulation2/system/LocalTurnManager.cpp +++ b/source/simulation2/system/LocalTurnManager.cpp @@ -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 @@ -51,7 +51,7 @@ void CLocalTurnManager::NotifyFinishedUpdate(u32 UNUSED(turn)) #endif } -void CLocalTurnManager::OnSimulationMessage(CSimulationMessage* UNUSED(msg)) +void CLocalTurnManager::OnSimulationMessage(CSimulationMessage*) { debug_warn(L"This should never be called"); } diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp index 602285b285..838ad8fcb3 100644 --- a/source/soundmanager/SoundManager.cpp +++ b/source/soundmanager/SoundManager.cpp @@ -223,7 +223,7 @@ void CSoundManager::al_check(const char* caller, int line) al_ReportError(err, caller, line); } -Status CSoundManager::ReloadChangedFiles(const VfsPath& UNUSED(path)) +Status CSoundManager::ReloadChangedFiles(const VfsPath&) { // TODO implement sound file hotloading return INFO::OK; diff --git a/source/tools/atlas/GameInterface/View.cpp b/source/tools/atlas/GameInterface/View.cpp index b0b31fca1c..70bce6022d 100644 --- a/source/tools/atlas/GameInterface/View.cpp +++ b/source/tools/atlas/GameInterface/View.cpp @@ -108,7 +108,7 @@ CSimulation2* AtlasViewActor::GetSimulation2() return m_ActorViewer->GetSimulation2(); } -entity_id_t AtlasViewActor::GetEntityId(AtlasMessage::ObjectID UNUSED(obj)) +entity_id_t AtlasViewActor::GetEntityId(AtlasMessage::ObjectID) { return m_ActorViewer->GetEntity(); }