diff --git a/source/collada/CommonConvert.cpp b/source/collada/CommonConvert.cpp index ea0d7b5630..53239c35a5 100644 --- a/source/collada/CommonConvert.cpp +++ b/source/collada/CommonConvert.cpp @@ -73,7 +73,7 @@ FColladaErrorHandler::~FColladaErrorHandler() FUError::RemoveErrorCallback(FUError::ERROR_LEVEL, this, &FColladaErrorHandler::OnError); } -void FColladaErrorHandler::OnError(FUError::Level errorLevel, uint32 errorCode, uint32 UNUSED(lineNumber)) +void FColladaErrorHandler::OnError(FUError::Level errorLevel, uint32 errorCode, uint32 /*lineNumber*/) { // Ignore warnings about missing materials, since we ignore materials entirely anyway if (errorCode == FUError::WARNING_INVALID_POLYGON_MAT_SYMBOL) @@ -111,7 +111,7 @@ void FColladaDocument::LoadFromText(const char *text) REQUIRE_SUCCESS(status); } -void FColladaDocument::ReadExtras(xmlNode* UNUSED(colladaNode)) +void FColladaDocument::ReadExtras(xmlNode* /*colladaNode*/) { // TODO: This was needed to recognise and load XSI models. // XSI support should be reintroduced some time, but this function diff --git a/source/graphics/MapReader.cpp b/source/graphics/MapReader.cpp index ce47a6d11d..9d312c56f3 100644 --- a/source/graphics/MapReader.cpp +++ b/source/graphics/MapReader.cpp @@ -991,7 +991,7 @@ void CXMLReader::ReadPaths(XMBElement parent) } } -void CXMLReader::ReadTriggers(XMBElement UNUSED(parent)) +void CXMLReader::ReadTriggers(XMBElement /*parent*/) { } diff --git a/source/graphics/MiniMapTexture.cpp b/source/graphics/MiniMapTexture.cpp index 0f97a1c6be..a18e059dc8 100644 --- a/source/graphics/MiniMapTexture.cpp +++ b/source/graphics/MiniMapTexture.cpp @@ -338,7 +338,7 @@ CMiniMapTexture::~CMiniMapTexture() DestroyTextures(); } -void CMiniMapTexture::Update(const float UNUSED(deltaRealTime)) +void CMiniMapTexture::Update(const float /*deltaRealTime*/) { if (m_WaterHeight != g_Renderer.GetSceneRenderer().GetWaterManager().m_WaterHeight) { diff --git a/source/graphics/ModelAbstract.h b/source/graphics/ModelAbstract.h index 0c03bd6596..b38e879113 100644 --- a/source/graphics/ModelAbstract.h +++ b/source/graphics/ModelAbstract.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 @@ -151,7 +151,7 @@ public: * Called when the entity tries to set some variable to affect the display of this model * and/or its child objects. */ - virtual void SetEntityVariable(const std::string& UNUSED(name), float UNUSED(value)) { } + virtual void SetEntityVariable(const std::string& /*name*/, float /*value*/) { } /** * Ensure that both the transformation and the bone matrices are correct for this model and all its props. diff --git a/source/graphics/ParticleEmitter.h b/source/graphics/ParticleEmitter.h index 5fd3d5c10d..332b71045a 100644 --- a/source/graphics/ParticleEmitter.h +++ b/source/graphics/ParticleEmitter.h @@ -199,7 +199,7 @@ public: std::unique_ptr Clone() const override; - void SetTerrainDirty(ssize_t UNUSED(i0), ssize_t UNUSED(j0), ssize_t UNUSED(i1), ssize_t UNUSED(j1)) override + void SetTerrainDirty(ssize_t /*i0*/, ssize_t /*j0*/, ssize_t /*i1*/, ssize_t /*j1*/) override { } diff --git a/source/graphics/TextureConverter.cpp b/source/graphics/TextureConverter.cpp index 458c0dde92..c19e562810 100644 --- a/source/graphics/TextureConverter.cpp +++ b/source/graphics/TextureConverter.cpp @@ -63,7 +63,8 @@ struct BufferOutputHandler : public nvtt::OutputHandler { std::vector buffer; - virtual void beginImage(int UNUSED(size), int UNUSED(width), int UNUSED(height), int UNUSED(depth), int UNUSED(face), int UNUSED(miplevel)) + virtual void beginImage(int /*size*/, int /*width*/, int /*height*/, int /*depth*/, int /*face*/, + int /*miplevel*/) { } diff --git a/source/gui/GUIStringConversions.cpp b/source/gui/GUIStringConversions.cpp index d833fa2009..e6a8ead229 100644 --- a/source/gui/GUIStringConversions.cpp +++ b/source/gui/GUIStringConversions.cpp @@ -235,13 +235,13 @@ bool CGUI::ParseString(const CGUI*, const CStrW& Value, CGUI } template <> -bool CGUI::ParseString(const CGUI*, const CStrW& UNUSED(Value), CGUISeries& UNUSED(Output)) +bool CGUI::ParseString(const CGUI*, const CStrW& /*Value*/, CGUISeries& /*Output*/) { return false; } template <> -bool CGUI::ParseString(const CGUI*, const CStrW& UNUSED(Value), CGUIList& UNUSED(Output)) +bool CGUI::ParseString(const CGUI*, const CStrW& /*Value*/, CGUIList& /*Output*/) { return false; } diff --git a/source/gui/IGUIScrollBar.h b/source/gui/IGUIScrollBar.h index e8ecf134aa..419bb1a373 100644 --- a/source/gui/IGUIScrollBar.h +++ b/source/gui/IGUIScrollBar.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 @@ -191,7 +191,7 @@ public: * @param mouse current mouse position * @return True if mouse positions are hovering the button */ - virtual bool HoveringButtonMinus(const CVector2D& UNUSED(mouse)) { return false; } + virtual bool HoveringButtonMinus(const CVector2D& /*mouse*/) { return false; } /** * Hovering the scroll plus button @@ -199,7 +199,7 @@ public: * @param mouse current mouse position * @return True if mouse positions are hovering the button */ - virtual bool HoveringButtonPlus(const CVector2D& UNUSED(mouse)) { return false; } + virtual bool HoveringButtonPlus(const CVector2D& /*mouse*/) { return false; } /** * Get scroll-position diff --git a/source/gui/ObjectBases/IGUIObject.h b/source/gui/ObjectBases/IGUIObject.h index f8aa757fd6..4751a5768a 100644 --- a/source/gui/ObjectBases/IGUIObject.h +++ b/source/gui/ObjectBases/IGUIObject.h @@ -373,7 +373,7 @@ protected: * Notice 'false' is default, because an object not using this function, should not * have any additional children (and this function should never be called). */ - virtual bool HandleAdditionalChildren(const XMBData& UNUSED(file), const XMBElement& UNUSED(child)) + virtual bool HandleAdditionalChildren(const XMBData& /*file*/, const XMBElement& /*child*/) { return false; } diff --git a/source/gui/ObjectTypes/CMiniMap.cpp b/source/gui/ObjectTypes/CMiniMap.cpp index 1ef49a9868..a32f294241 100644 --- a/source/gui/ObjectTypes/CMiniMap.cpp +++ b/source/gui/ObjectTypes/CMiniMap.cpp @@ -244,7 +244,7 @@ CVector2D CMiniMap::WorldSpaceToMiniMapSpace(const CVector3D& worldPosition) con m_CachedActualSize.bottom - (0.5f + rotatedY) * m_CachedActualSize.GetHeight()); } -bool CMiniMap::FireWorldClickEvent(int button, int UNUSED(clicks)) +bool CMiniMap::FireWorldClickEvent(int button, int /*clicks*/) { ScriptRequest rq(g_GUI->GetActiveGUI()->GetScriptInterface()); diff --git a/source/gui/Scripting/JSInterface_GUIProxy.h b/source/gui/Scripting/JSInterface_GUIProxy.h index 6b28bb42e8..ba490931c7 100644 --- a/source/gui/Scripting/JSInterface_GUIProxy.h +++ b/source/gui/Scripting/JSInterface_GUIProxy.h @@ -169,48 +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*, JS::HandleObject UNUSED(proxy), JS::HandleId, + virtual bool getOwnPropertyDescriptor(JSContext*, JS::HandleObject /*proxy*/, JS::HandleId, JS::MutableHandle>) const override { return true; } // Throw an exception is JS code attempts defining a property. - virtual bool defineProperty(JSContext*, JS::HandleObject UNUSED(proxy), JS::HandleId, - JS::Handle, JS::ObjectOpResult& UNUSED(result)) const override + virtual bool defineProperty(JSContext*, JS::HandleObject /*proxy*/, JS::HandleId, + JS::Handle, JS::ObjectOpResult& /*result*/) const override { return false; } // No accessible properties. - virtual bool ownPropertyKeys(JSContext*, JS::HandleObject UNUSED(proxy), - JS::MutableHandleIdVector UNUSED(props)) const override + virtual bool ownPropertyKeys(JSContext*, JS::HandleObject /*proxy*/, + JS::MutableHandleIdVector) const override { return true; } // Nothing to enumerate. - virtual bool enumerate(JSContext*, JS::HandleObject UNUSED(proxy), - JS::MutableHandleIdVector UNUSED(props)) const override + virtual bool enumerate(JSContext*, JS::HandleObject /*proxy*/, + JS::MutableHandleIdVector /*props*/) const override { return true; } // Throw an exception is JS attempts to query the prototype. - virtual bool getPrototypeIfOrdinary(JSContext*, JS::HandleObject UNUSED(proxy), - bool* UNUSED(isOrdinary), JS::MutableHandleObject UNUSED(protop)) const override + virtual bool getPrototypeIfOrdinary(JSContext*, JS::HandleObject /*proxy*/, bool* /*isOrdinary*/, + JS::MutableHandleObject /*protop*/) const override { return false; } // Throw an exception - no prototype to set. - virtual bool setImmutablePrototype(JSContext*, JS::HandleObject UNUSED(proxy), - bool* UNUSED(succeeded)) const override + virtual bool setImmutablePrototype(JSContext*, JS::HandleObject /*proxy*/, + bool* /*succeeded*/) const override { return false; } // We are not extensible. - virtual bool preventExtensions(JSContext*, JS::HandleObject UNUSED(proxy), - JS::ObjectOpResult&) const override + virtual bool preventExtensions(JSContext*, JS::HandleObject /*proxy*/, + JS::ObjectOpResult& /*result*/) const override { return true; } - virtual bool isExtensible(JSContext*, JS::HandleObject UNUSED(proxy), bool* extensible) const override + virtual bool isExtensible(JSContext*, JS::HandleObject /*proxy*/, bool* extensible) const override { *extensible = false; return true; diff --git a/source/gui/Scripting/JSInterface_GUIProxy_impl.h b/source/gui/Scripting/JSInterface_GUIProxy_impl.h index 169bc2b450..807efede58 100644 --- a/source/gui/Scripting/JSInterface_GUIProxy_impl.h +++ b/source/gui/Scripting/JSInterface_GUIProxy_impl.h @@ -167,7 +167,8 @@ std::unique_ptr JSI_GUIProxy::CreateJSObject(const ScriptReq } template -bool JSI_GUIProxy::get(JSContext* cx, JS::HandleObject proxy, JS::HandleValue UNUSED(receiver), JS::HandleId id, JS::MutableHandleValue vp) const +bool JSI_GUIProxy::get(JSContext* cx, JS::HandleObject proxy, JS::HandleValue /*receiver*/, + JS::HandleId id, JS::MutableHandleValue vp) const { ScriptRequest rq(cx); @@ -237,7 +238,7 @@ bool JSI_GUIProxy::get(JSContext* cx, JS::HandleObject proxy, JS::HandleValue template bool JSI_GUIProxy::set(JSContext* cx, JS::HandleObject proxy, JS::HandleId id, JS::HandleValue vp, - JS::HandleValue UNUSED(receiver), JS::ObjectOpResult& result) const + JS::HandleValue /*receiver*/, JS::ObjectOpResult& result) const { T* e = IGUIProxyObject::FromPrivateSlot(proxy.get()); if (!e) diff --git a/source/lib/adts/cache_adt.h b/source/lib/adts/cache_adt.h index 59eb951a41..c28090487a 100644 --- a/source/lib/adts/cache_adt.h +++ b/source/lib/adts/cache_adt.h @@ -509,7 +509,7 @@ class Divider_Naive { public: Divider_Naive() {} // needed for default CacheEntry ctor - Divider_Naive(float UNUSED(x)) {} + Divider_Naive(float /*x*/) {} float operator()(float val, float divisor) const { return val / divisor; @@ -524,7 +524,7 @@ class Divider_Recip public: Divider_Recip() {} // needed for default CacheEntry ctor Divider_Recip(float x) { recip = 1.0f / x; } - float operator()(float val, float UNUSED(divisor)) const + float operator()(float val, float /*divisor*/) const { return val * recip; } diff --git a/source/lib/allocators/allocator_policies.h b/source/lib/allocators/allocator_policies.h index 92b9bd2c76..dc2fdbea62 100644 --- a/source/lib/allocators/allocator_policies.h +++ b/source/lib/allocators/allocator_policies.h @@ -136,7 +136,7 @@ public: return maxCapacity; } - bool Expand(size_t UNUSED(requiredCapacity)) + bool Expand(size_t /*requiredCapacity*/) { return false; } @@ -297,7 +297,7 @@ public: return maxCapacity; } - bool Expand(size_t UNUSED(requiredCapacity)) + bool Expand(size_t /*requiredCapacity*/) { return false; } diff --git a/source/lib/app_hooks.cpp b/source/lib/app_hooks.cpp index 529f4a5203..dfbc94b7db 100644 --- a/source/lib/app_hooks.cpp +++ b/source/lib/app_hooks.cpp @@ -46,7 +46,7 @@ static void def_bundle_logs(FILE*) } -static ErrorReactionInternal def_display_error(const wchar_t* UNUSED(text), size_t UNUSED(flags)) +static ErrorReactionInternal def_display_error(const wchar_t* /*text*/, size_t /*flags*/) { return ERI_NOT_IMPLEMENTED; } diff --git a/source/lib/code_annotation.h b/source/lib/code_annotation.h index a64a3882e2..24b312fa31 100644 --- a/source/lib/code_annotation.h +++ b/source/lib/code_annotation.h @@ -32,13 +32,6 @@ #include -/** - * mark a function parameter as unused and avoid - * the corresponding compiler warning. - * wrap around the parameter name, e.g. void f(int UNUSED(x)) - **/ -#define UNUSED(param) - /** * mark a function local variable or parameter as unused and avoid * the corresponding compiler warning. diff --git a/source/lib/debug_stl.cpp b/source/lib/debug_stl.cpp index 25c93b486e..7c40c3e17d 100644 --- a/source/lib/debug_stl.cpp +++ b/source/lib/debug_stl.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 @@ -213,17 +213,17 @@ wchar_t* debug_stl_simplify_name(wchar_t* name) template struct ContainerBase : public Container { - bool IsValid(size_t UNUSED(el_size)) const + bool IsValid(size_t /*el_size*/) const { return true; } - size_t NumElements(size_t UNUSED(el_size)) const + size_t NumElements(size_t /*el_size*/) const { return this->size(); } - static const u8* DereferenceAndAdvance(typename Container::iterator& it, size_t UNUSED(el_size)) + static const u8* DereferenceAndAdvance(typename Container::iterator& it, size_t /*el_size*/) { const u8* p = (const u8*)&*it; ++it; @@ -309,12 +309,12 @@ struct Any_tree : public std::_Tree<_Traits> { } - bool IsValid(size_t UNUSED(el_size)) const + bool IsValid(size_t /*el_size*/) const { return true; } - size_t NumElements(size_t UNUSED(el_size)) const + size_t NumElements(size_t /*el_size*/) const { return size(); } @@ -397,7 +397,7 @@ struct Any_multiset: public Any_set struct Any_vector: public ContainerBase > { - bool IsValid(size_t UNUSED(el_size)) const + bool IsValid(size_t /*el_size*/) const { // more elements reported than reserved if(size() > capacity()) diff --git a/source/lib/file/archive/archive_zip.cpp b/source/lib/file/archive/archive_zip.cpp index 711897931a..e84742cffa 100644 --- a/source/lib/file/archive/archive_zip.cpp +++ b/source/lib/file/archive/archive_zip.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 @@ -319,7 +319,7 @@ public: return m_file->Pathname(); } - virtual Status Load(const OsPath& UNUSED(name), const std::shared_ptr& buf, size_t size) const + virtual Status Load(const OsPath& /*name*/, const std::shared_ptr& buf, size_t size) const { AdjustOffset(); diff --git a/source/lib/file/archive/tests/test_archive_zip.h b/source/lib/file/archive/tests/test_archive_zip.h index 1901220495..3983a4ed71 100644 --- a/source/lib/file/archive/tests/test_archive_zip.h +++ b/source/lib/file/archive/tests/test_archive_zip.h @@ -105,7 +105,7 @@ public: private: static void ArchiveEntryCallback(const VfsPath& path, const CFileInfo&, PIArchiveFile, - uintptr_t UNUSED(cbData)) + uintptr_t /*cbData*/) { g_ResultBuffer = path.string8(); } diff --git a/source/lib/file/common/file_stats.h b/source/lib/file/common/file_stats.h index d35405fd78..9c271b269a 100644 --- a/source/lib/file/common/file_stats.h +++ b/source/lib/file/common/file_stats.h @@ -105,7 +105,7 @@ class ScopedIoMonitor public: ScopedIoMonitor() {} ~ScopedIoMonitor() {} - void NotifyOfSuccess(FileIOImplentation, int UNUSED(opcode), off_t UNUSED(size)) {} + void NotifyOfSuccess(FileIOImplentation, int /*opcode*/, off_t /*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 71366082a9..a600844861 100644 --- a/source/lib/file/common/trace.cpp +++ b/source/lib/file/common/trace.cpp @@ -104,16 +104,16 @@ std::wstring TraceEntry::EncodeAsText() const class Trace_Dummy : public ITrace { public: - Trace_Dummy(size_t UNUSED(maxSize)) + Trace_Dummy(size_t /*maxSize*/) { } - virtual void NotifyLoad(const Path&, size_t UNUSED(size)) + virtual void NotifyLoad(const Path&, size_t /*size*/) { } - virtual void NotifyStore(const Path&, size_t UNUSED(size)) + virtual void NotifyStore(const Path&, size_t /*size*/) { } diff --git a/source/lib/file/io/io.h b/source/lib/file/io/io.h index 2340cac834..ed9c9b32af 100644 --- a/source/lib/file/io/io.h +++ b/source/lib/file/io/io.h @@ -174,7 +174,7 @@ struct DefaultCompletedHook * allows progress notification and processing data while waiting for * previous I/Os to complete. **/ - Status operator()(const u8* UNUSED(block), size_t UNUSED(blockSize)) const + Status operator()(const u8* /*block*/, size_t /*blockSize*/) const { return INFO::OK; } diff --git a/source/lib/file/vfs/tests/test_vfs_tree.h b/source/lib/file/vfs/tests/test_vfs_tree.h index b3d71e4b9f..90cc50ff6c 100644 --- a/source/lib/file/vfs/tests/test_vfs_tree.h +++ b/source/lib/file/vfs/tests/test_vfs_tree.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 @@ -40,7 +40,10 @@ public: size_t Precedence() const { return m_Precedence; } wchar_t LocationCode() const { return L'\0'; } OsPath Path() const { return L"";} - Status Load(const OsPath& UNUSED(name), const std::shared_ptr& UNUSED(buf), size_t UNUSED(size)) const {return INFO::OK; } + Status Load(const OsPath& /*name*/, const std::shared_ptr& /*buf*/, size_t /*size*/) const + { + return INFO::OK; + } }; class TestVfsTree : public CxxTest::TestSuite diff --git a/source/lib/ogl.cpp b/source/lib/ogl.cpp index a6e9e74a62..f00e666ebe 100644 --- a/source/lib/ogl.cpp +++ b/source/lib/ogl.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 @@ -294,20 +294,20 @@ static void GLAD_API_PTR dummy_glDrawRangeElementsEXT(GLenum mode, GLuint, GLuin glDrawElements(mode, count, type, indices); } -static void GLAD_API_PTR dummy_glActiveTextureARB(GLenum UNUSED(texture)) +static void GLAD_API_PTR dummy_glActiveTextureARB(GLenum /*texture*/) { } -static void GLAD_API_PTR dummy_glClientActiveTextureARB(GLenum UNUSED(texture)) +static void GLAD_API_PTR dummy_glClientActiveTextureARB(GLenum /*texture*/) { } -static void GLAD_API_PTR dummy_glMultiTexCoord2fARB(GLenum UNUSED(target), GLfloat s, GLfloat t) +static void GLAD_API_PTR dummy_glMultiTexCoord2fARB(GLenum /*target*/, GLfloat s, GLfloat t) { glTexCoord2f(s, t); } -static void GLAD_API_PTR dummy_glMultiTexCoord3fARB(GLenum UNUSED(target), GLfloat s, GLfloat t, GLfloat r) +static void GLAD_API_PTR dummy_glMultiTexCoord3fARB(GLenum /*target*/, GLfloat s, GLfloat t, GLfloat r) { glTexCoord3f(s, t, r); } diff --git a/source/lib/sysdep/arch/x86_x64/apic.cpp b/source/lib/sysdep/arch/x86_x64/apic.cpp index bd9ddbda96..2fa12c6f44 100644 --- a/source/lib/sysdep/arch/x86_x64/apic.cpp +++ b/source/lib/sysdep/arch/x86_x64/apic.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 @@ -53,7 +53,7 @@ static Status GetAndValidateApicIds() numIds = os_cpu_NumProcessors(); struct StoreEachProcessorsApicId { - static void Callback(size_t processor, uintptr_t UNUSED(data)) + static void Callback(size_t processor, uintptr_t /*data*/) { processorApicIds[processor] = GetApicId(); } diff --git a/source/lib/sysdep/os/bsd/bcpu.cpp b/source/lib/sysdep/os/bsd/bcpu.cpp index 866dbfe479..6e061667ec 100644 --- a/source/lib/sysdep/os/bsd/bcpu.cpp +++ b/source/lib/sysdep/os/bsd/bcpu.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 @@ -111,7 +111,7 @@ size_t os_cpu_MemoryAvailable() return memoryAvailable; } -uintptr_t os_cpu_SetThreadAffinityMask(uintptr_t UNUSED(processorMask)) +uintptr_t os_cpu_SetThreadAffinityMask(uintptr_t /*processorMask*/) { // not yet implemented return os_cpu_ProcessorMask(); diff --git a/source/lib/sysdep/os/bsd/bdbg.cpp b/source/lib/sysdep/os/bsd/bdbg.cpp index 04746434e5..f308de6463 100644 --- a/source/lib/sysdep/os/bsd/bdbg.cpp +++ b/source/lib/sysdep/os/bsd/bdbg.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 @@ -35,7 +35,7 @@ #include -void* debug_GetCaller(void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +void* debug_GetCaller(void* /*context*/, const wchar_t* /*lastFuncToSkip*/) { // bt[0] == this function // bt[1] == our caller @@ -49,7 +49,7 @@ void* debug_GetCaller(void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSki return bt[2]; } -Status debug_DumpStack(wchar_t* buf, size_t max_chars, void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +Status debug_DumpStack(wchar_t* buf, size_t max_chars, void* /*context*/, const wchar_t* /*lastFuncToSkip*/) { static const size_t N_FRAMES = 16; void *bt[N_FRAMES]; @@ -123,7 +123,7 @@ Status debug_ResolveSymbol(void* ptr_of_interest, wchar_t* sym_name, wchar_t* fi } } -void debug_SetThreadName(char const* UNUSED(name)) +void debug_SetThreadName(char const* /*name*/) { // Currently unimplemented } diff --git a/source/lib/sysdep/os/linux/lcpu.cpp b/source/lib/sysdep/os/linux/lcpu.cpp index 4afe4cae79..572b56d6b5 100644 --- a/source/lib/sysdep/os/linux/lcpu.cpp +++ b/source/lib/sysdep/os/linux/lcpu.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 @@ -105,7 +105,7 @@ size_t os_cpu_MemoryAvailable() // the current Android NDK (r7-crystax-4) doesn't support sched_setaffinity, // so provide a stub implementation instead -uintptr_t os_cpu_SetThreadAffinityMask(uintptr_t UNUSED(processorMask)) +uintptr_t os_cpu_SetThreadAffinityMask(uintptr_t /*processorMask*/) { // not yet implemented return os_cpu_ProcessorMask(); diff --git a/source/lib/sysdep/os/linux/ldbg.cpp b/source/lib/sysdep/os/linux/ldbg.cpp index c924fdd1ac..8fb6e4fd38 100644 --- a/source/lib/sysdep/os/linux/ldbg.cpp +++ b/source/lib/sysdep/os/linux/ldbg.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 @@ -42,17 +42,19 @@ // Android NDK doesn't support backtrace() // TODO: use unwind.h or similar? -void* debug_GetCaller(void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +void* debug_GetCaller(void* /*context*/, const wchar_t* /*lastFuncToSkip*/) { return NULL; } -Status debug_DumpStack(wchar_t* UNUSED(buf), size_t UNUSED(max_chars), void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +Status debug_DumpStack(wchar_t* /*buf*/, size_t /*max_chars*/, void* /*context*/, + const wchar_t* /*lastFuncToSkip*/) { return ERR::NOT_SUPPORTED; } -Status debug_ResolveSymbol(void* UNUSED(ptr_of_interest), wchar_t* UNUSED(sym_name), wchar_t* UNUSED(file), int* UNUSED(line)) +Status debug_ResolveSymbol(void* /*ptr_of_interest*/, wchar_t* /*sym_name*/, wchar_t* /*file*/, + int* /*line*/) { return ERR::NOT_SUPPORTED; } @@ -61,7 +63,7 @@ Status debug_ResolveSymbol(void* UNUSED(ptr_of_interest), wchar_t* UNUSED(sym_na #include -void* debug_GetCaller(void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +void* debug_GetCaller(void* /*context*/, const wchar_t* /*lastFuncToSkip*/) { // bt[0] == this function // bt[1] == our caller @@ -75,7 +77,7 @@ void* debug_GetCaller(void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSki return bt[2]; } -Status debug_DumpStack(wchar_t* buf, size_t max_chars, void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +Status debug_DumpStack(wchar_t* buf, size_t max_chars, void* /*context*/, const wchar_t* /*lastFuncToSkip*/) { static const size_t N_FRAMES = 16; void *bt[N_FRAMES]; diff --git a/source/lib/sysdep/os/osx/dir_watch.cpp b/source/lib/sysdep/os/osx/dir_watch.cpp index 24615ea08a..47232e533b 100644 --- a/source/lib/sysdep/os/osx/dir_watch.cpp +++ b/source/lib/sysdep/os/osx/dir_watch.cpp @@ -76,7 +76,7 @@ static bool CanRunNotifications() #define kFSEventStreamEventFlagItemModified 0x00001000 #endif -static void fsevent_callback(ConstFSEventStreamRef, void * UNUSED(clientCallBackInfo), size_t numEvents, +static void fsevent_callback(ConstFSEventStreamRef, void* /*clientCallBackInfo*/, size_t numEvents, void *eventPaths, const FSEventStreamEventFlags eventFlags[], const FSEventStreamEventId[]) { unsigned long i; diff --git a/source/lib/sysdep/os/osx/ocpu.cpp b/source/lib/sysdep/os/osx/ocpu.cpp index f7eeee2871..dabcf707f8 100644 --- a/source/lib/sysdep/os/osx/ocpu.cpp +++ b/source/lib/sysdep/os/osx/ocpu.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 @@ -100,7 +100,7 @@ size_t os_cpu_MemoryAvailable() } -uintptr_t os_cpu_SetThreadAffinityMask(uintptr_t UNUSED(processorMask)) +uintptr_t os_cpu_SetThreadAffinityMask(uintptr_t /*processorMask*/) { // not yet implemented. when doing so, see http://developer.apple.com/releasenotes/Performance/RN-AffinityAPI/ diff --git a/source/lib/sysdep/os/osx/odbg.cpp b/source/lib/sysdep/os/osx/odbg.cpp index 381b9584db..583f8bb3c9 100644 --- a/source/lib/sysdep/os/osx/odbg.cpp +++ b/source/lib/sysdep/os/osx/odbg.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 @@ -30,17 +30,19 @@ #include -void* debug_GetCaller(void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +void* debug_GetCaller(void* /*context*/, const wchar_t* /*lastFuncToSkip*/) { return NULL; } -Status debug_DumpStack(wchar_t* UNUSED(buf), size_t UNUSED(max_chars), void* UNUSED(context), const wchar_t* UNUSED(lastFuncToSkip)) +Status debug_DumpStack(wchar_t* /*buf*/, size_t /*max_chars*/, void* /*context*/, + const wchar_t* /*lastFuncToSkip*/) { return ERR::NOT_SUPPORTED; } -Status debug_ResolveSymbol(void* UNUSED(ptr_of_interest), wchar_t* UNUSED(sym_name), wchar_t* UNUSED(file), int* UNUSED(line)) +Status debug_ResolveSymbol(void* /*ptr_of_interest*/, wchar_t* /*sym_name*/, wchar_t* /*file*/, + int* /*line*/) { return ERR::NOT_SUPPORTED; } diff --git a/source/lib/sysdep/os/unix/udbg.cpp b/source/lib/sysdep/os/unix/udbg.cpp index afe50c27ff..94b32ce084 100644 --- a/source/lib/sysdep/os/unix/udbg.cpp +++ b/source/lib/sysdep/os/unix/udbg.cpp @@ -39,7 +39,7 @@ symbol lookups and backtraces) #include "lib/utf8.h" -Status debug_CaptureContext(void* UNUSED(context)) +Status debug_CaptureContext(void* /*context*/) { // (not needed unless/until we support stack traces) return INFO::SKIPPED; diff --git a/source/lib/sysdep/os/unix/unix.cpp b/source/lib/sysdep/os/unix/unix.cpp index eab120a90c..af03fc4d26 100644 --- a/source/lib/sysdep/os/unix/unix.cpp +++ b/source/lib/sysdep/os/unix/unix.cpp @@ -64,7 +64,8 @@ void sys_display_msg(const wchar_t* caption, const wchar_t* msg) } #if OS_MACOSX || OS_ANDROID -static ErrorReactionInternal try_gui_display_error(const wchar_t* UNUSED(text), bool UNUSED(manual_break), bool UNUSED(allow_suppress), bool UNUSED(no_continue)) +static ErrorReactionInternal try_gui_display_error(const wchar_t* /*text*/, bool /*manual_break*/, + bool /*allow_suppress*/, bool /*no_continue*/) { // TODO: implement this, in a way that doesn't rely on X11 // and doesn't occasionally cause crazy errors like @@ -343,7 +344,7 @@ Status sys_generate_random_bytes(u8* buf, size_t count) return INFO::OK; } -Status sys_get_proxy_config(const std::wstring& UNUSED(url), std::wstring& UNUSED(proxy)) +Status sys_get_proxy_config(const std::wstring& /*url*/, std::wstring& /*proxy*/) { return INFO::SKIPPED; } diff --git a/source/lib/sysdep/os/unix/unuma.cpp b/source/lib/sysdep/os/unix/unuma.cpp index 8f6a837dcd..2755e40a42 100644 --- a/source/lib/sysdep/os/unix/unuma.cpp +++ b/source/lib/sysdep/os/unix/unuma.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2010 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 @@ -31,7 +31,7 @@ size_t numa_NumNodes() return 1; } -size_t numa_NodeFromProcessor(size_t UNUSED(processor)) +size_t numa_NodeFromProcessor(size_t /*processor*/) { return 0; } diff --git a/source/lib/sysdep/os/unix/uvm.cpp b/source/lib/sysdep/os/unix/uvm.cpp index fc3f05fa63..5704afe1ba 100644 --- a/source/lib/sysdep/os/unix/uvm.cpp +++ b/source/lib/sysdep/os/unix/uvm.cpp @@ -37,7 +37,7 @@ static const int mmap_flags = MAP_PRIVATE|MAP_ANONYMOUS; namespace vm { -void* ReserveAddressSpace(size_t size, size_t UNUSED(commitSize), PageType UNUSED(pageType), int UNUSED(prot)) +void* ReserveAddressSpace(size_t size, size_t /*commitSize*/, PageType /*pageType*/, int /*prot*/) { errno = 0; void* p = mmap(0, size, PROT_NONE, mmap_flags|MAP_NORESERVE, -1, 0); diff --git a/source/lib/sysdep/os/win/tests/test_wdbg_sym.h b/source/lib/sysdep/os/win/tests/test_wdbg_sym.h index 7a88b29201..901f385acd 100644 --- a/source/lib/sysdep/os/win/tests/test_wdbg_sym.h +++ b/source/lib/sysdep/os/win/tests/test_wdbg_sym.h @@ -44,7 +44,7 @@ static void* callers[100]; static size_t numCallers; -static Status OnFrame(const _tagSTACKFRAME64* frame, uintptr_t UNUSED(cbData)) +static Status OnFrame(const _tagSTACKFRAME64* frame, uintptr_t /*cbData*/) { callers[numCallers++] = (void*)frame->AddrPC.Offset; return INFO::OK; diff --git a/source/lib/sysdep/os/win/wdbg_sym.cpp b/source/lib/sysdep/os/win/wdbg_sym.cpp index 0e25e7053f..a80a2e66d4 100644 --- a/source/lib/sysdep/os/win/wdbg_sym.cpp +++ b/source/lib/sysdep/os/win/wdbg_sym.cpp @@ -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&) +static Status dump_sym_function(DWORD /*type_id*/, const u8* /*p*/, DumpState&) { return INFO::SYM_SUPPRESS_OUTPUT; } @@ -1100,7 +1100,7 @@ static Status dump_sym_function(DWORD UNUSED(type_id), const u8* UNUSED(p), Dump //----------------------------------------------------------------------------- -static Status dump_sym_function_type(DWORD UNUSED(type_id), const u8* p, DumpState& state) +static Status dump_sym_function_type(DWORD /*type_id*/, const u8* p, DumpState& state) { // this symbol gives class parent, return type, and parameter count. // unfortunately the one thing we care about, its name, @@ -1376,7 +1376,8 @@ not_handle: } -static Status udt_dump_suppressed(const wchar_t* type_name, const u8* UNUSED(p), size_t UNUSED(size), DumpState state, ULONG UNUSED(numChildren), const DWORD* UNUSED(children)) +static Status udt_dump_suppressed(const wchar_t* type_name, const u8* /*p*/, size_t /*size*/, + DumpState state, ULONG /*numChildren*/, const DWORD* /*children*/) { if(!udt_should_suppress(type_name)) return INFO::CANNOT_HANDLE; @@ -1552,7 +1553,7 @@ done: //----------------------------------------------------------------------------- -static Status dump_sym_vtable(DWORD UNUSED(type_id), const u8* UNUSED(p), DumpState&) +static Status dump_sym_vtable(DWORD /*type_id*/, const u8* /*p*/, DumpState&) { // unsupported (vtable internals are undocumented; too much work). return INFO::SYM_SUPPRESS_OUTPUT; @@ -1562,7 +1563,7 @@ static Status dump_sym_vtable(DWORD UNUSED(type_id), const u8* UNUSED(p), DumpSt //----------------------------------------------------------------------------- -static Status dump_sym_unknown(DWORD type_id, const u8* UNUSED(p), DumpState& state) +static Status dump_sym_unknown(DWORD type_id, const u8* /*p*/, DumpState& state) { // redundant (already done in dump_sym), but this is rare. DWORD type_tag; @@ -1640,7 +1641,7 @@ static bool ShouldSkipSymbol(const wchar_t* name) // output the symbol's name and value via dump_sym*. // called from dump_frame_cb for each local symbol; lock is held. -static BOOL CALLBACK dump_sym_cb(SYMBOL_INFOW* sym, ULONG UNUSED(size), PVOID userContext) +static BOOL CALLBACK dump_sym_cb(SYMBOL_INFOW* sym, ULONG /*size*/, PVOID userContext) { if(ShouldSkipSymbol(sym->Name)) return TRUE; // continue @@ -1661,7 +1662,7 @@ static BOOL CALLBACK dump_sym_cb(SYMBOL_INFOW* sym, ULONG UNUSED(size), PVOID us } // called by wdbg_sym_WalkStack for each stack frame -static Status dump_frame_cb(const STACKFRAME64* sf, uintptr_t UNUSED(userContext)) +static Status dump_frame_cb(const STACKFRAME64* sf, uintptr_t /*userContext*/) { void* func = (void*)(uintptr_t)sf->AddrPC.Offset; diff --git a/source/lib/sysdep/os/win/wposix/wpthread.cpp b/source/lib/sysdep/os/win/wposix/wpthread.cpp index f152f68b2b..bff673f543 100644 --- a/source/lib/sysdep/os/win/wposix/wpthread.cpp +++ b/source/lib/sysdep/os/win/wposix/wpthread.cpp @@ -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*, const struct timespec* UNUSED(abs_timeout)) +int pthread_mutex_timedlock(pthread_mutex_t*, const struct timespec* /*abs_timeout*/) { return -ENOSYS; } @@ -437,7 +437,7 @@ int sem_close(sem_t* sem) return 0; // success } -int sem_unlink(const char* UNUSED(name)) +int sem_unlink(const char* /*name*/) { // see sem_close return 0; // success @@ -567,7 +567,7 @@ static unsigned __stdcall thread_start(void* param) } -int pthread_create(pthread_t* thread_id, const void* UNUSED(attr), void* (*func)(void*), void* arg) +int pthread_create(pthread_t* thread_id, const void* /*attr*/, void* (*func)(void*), void* arg) { // notes: // - use wutil_Allocate instead of the normal heap because we /might/ diff --git a/source/lib/sysdep/os/win/wsysdep.cpp b/source/lib/sysdep/os/win/wsysdep.cpp index ad6a84d486..e6427a6759 100644 --- a/source/lib/sysdep/os/win/wsysdep.cpp +++ b/source/lib/sysdep/os/win/wsysdep.cpp @@ -89,7 +89,7 @@ void sys_display_msg(const wchar_t* caption, const wchar_t* msg) static POINTS dlg_clientOrigin; static POINTS dlg_prevClientSize; -static void dlg_OnMove(HWND UNUSED(hDlg), int x, int y) +static void dlg_OnMove(HWND /*hDlg*/, int x, int y) { dlg_clientOrigin.x = (short)x; dlg_clientOrigin.y = (short)y; @@ -165,7 +165,7 @@ static void dlg_OnSize(HWND hDlg, UINT state, int clientSizeX, int clientSizeY) } -static void dlg_OnGetMinMaxInfo(HWND UNUSED(hDlg), LPMINMAXINFO mmi) +static void dlg_OnGetMinMaxInfo(HWND /*hDlg*/, LPMINMAXINFO mmi) { // we must make sure resize_control will never set negative coords - // Windows would clip them, and its real position would be lost. @@ -181,7 +181,7 @@ struct DialogParams size_t flags; }; -static BOOL dlg_OnInitDialog(HWND hDlg, HWND UNUSED(hWndFocus), LPARAM lParam) +static BOOL dlg_OnInitDialog(HWND hDlg, HWND /*hWndFocus*/, LPARAM lParam) { const DialogParams* params = reinterpret_cast(lParam); SetWindowLongPtr(hDlg, DWLP_USER, lParam); @@ -214,7 +214,7 @@ static BOOL dlg_OnInitDialog(HWND hDlg, HWND UNUSED(hWndFocus), LPARAM lParam) } -static void dlg_OnCommand(HWND hDlg, int id, HWND UNUSED(hWndCtl), UINT UNUSED(codeNotify)) +static void dlg_OnCommand(HWND hDlg, int id, HWND /*hWndCtl*/, UINT /*codeNotify*/) { switch(id) { @@ -259,7 +259,7 @@ static void dlg_OnClose(HWND hDlg) } -static void dlg_OnSysCommand(HWND hDlg, UINT cmd, int UNUSED(x), int UNUSED(y)) +static void dlg_OnSysCommand(HWND hDlg, UINT cmd, int /*x*/, int /*y*/) { switch(cmd & 0xFFF0) // NB: lower 4 bits are reserved { @@ -444,7 +444,7 @@ std::wstring sys_get_user_name() // callback for shell directory picker: used to set starting directory // (for user convenience). -static int CALLBACK BrowseCallback(HWND hWnd, unsigned int msg, LPARAM UNUSED(lParam), LPARAM lpData) +static int CALLBACK BrowseCallback(HWND hWnd, unsigned int msg, LPARAM /*lParam*/, LPARAM lpData) { if(msg == BFFM_INITIALIZED) { diff --git a/source/lib/sysdep/smbios.cpp b/source/lib/sysdep/smbios.cpp index 9afb23b73e..147ca2b4a9 100644 --- a/source/lib/sysdep/smbios.cpp +++ b/source/lib/sysdep/smbios.cpp @@ -164,7 +164,7 @@ public: } template - void operator()(size_t flags, Field& field, const char* UNUSED(name), const char* UNUSED(units)) + void operator()(size_t flags, Field& field, const char* /*name*/, const char* /*units*/) { if((flags & F_DERIVED) || data >= end) { @@ -210,7 +210,8 @@ private: // (this specialization avoids a "forcing value to bool true or false" warning) template<> -void FieldInitializer::operator()(size_t flags, bool& UNUSED(t), const char* UNUSED(name), const char* UNUSED(units)) +void FieldInitializer::operator()(size_t flags, bool& /*t*/, const char* /*name*/, + const char* /*units*/) { // SMBIOS doesn't specify any individual booleans, so we're only called for // derived fields and don't need to do anything. @@ -218,7 +219,8 @@ void FieldInitializer::operator()(size_t flags, bool& UNUSED(t), const cha } template<> -void FieldInitializer::operator()(size_t flags, const char*& t, const char* UNUSED(name), const char* UNUSED(units)) +void FieldInitializer::operator()(size_t flags, const char*& t, const char* /*name*/, + const char* /*units*/) { t = 0; // (allow immediate `return' when the string is found to be invalid) @@ -472,7 +474,7 @@ static Status InitStructures() // StringFromEnum template -std::string StringFromEnum(Enum UNUSED(field)) +std::string StringFromEnum(Enum /*field*/) { return "(unknown enumeration)"; } @@ -592,7 +594,7 @@ private: // enumerations and bit flags template - void Write(size_t UNUSED(flags), Field& field, const char* name, const char* units, typename Field::Enum*) + void Write(size_t /*flags*/, Field& field, const char* name, const char* units, typename Field::Enum*) { // 0 usually means "not included in structure", but some packed // enumerations actually use that value. therefore, only skip this diff --git a/source/lib/sysdep/tests/test_sysdep.h b/source/lib/sysdep/tests/test_sysdep.h index 5ce70fed16..3fcdf21189 100644 --- a/source/lib/sysdep/tests/test_sysdep.h +++ b/source/lib/sysdep/tests/test_sysdep.h @@ -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 @@ -157,7 +157,7 @@ public: { public: Mock_dladdr(const std::string& fname) : fname_(fname) { } - int dladdr(void *UNUSED(addr), Dl_info *info) { + int dladdr(void* /*addr*/, Dl_info *info) { info->dli_fname = fname_.c_str(); return 1; } diff --git a/source/lib/tests/test_secure_crt.h b/source/lib/tests/test_secure_crt.h index 530e998a47..e36706013f 100644 --- a/source/lib/tests/test_secure_crt.h +++ b/source/lib/tests/test_secure_crt.h @@ -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 @@ -55,8 +55,8 @@ private: int old_mode; _invalid_parameter_handler old_handler; - static void invalid_parameter_handler(const wchar_t* UNUSED(expression), const wchar_t* UNUSED(function), - const wchar_t* UNUSED(file), unsigned int UNUSED(line), uintptr_t UNUSED(pReserved)) + static void invalid_parameter_handler(const wchar_t* /*expression*/, const wchar_t* /*function*/, + const wchar_t* /*file*/, unsigned int /*line*/, uintptr_t /*pReserved*/) { return; } diff --git a/source/lib/tex/tex.cpp b/source/lib/tex/tex.cpp index b33d7e3aec..cdd8b27bda 100644 --- a/source/lib/tex/tex.cpp +++ b/source/lib/tex/tex.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 @@ -669,7 +669,8 @@ u32 Tex::get_average_color() const } -static void add_level_size(size_t UNUSED(level), size_t UNUSED(level_w), size_t UNUSED(level_h), const u8* RESTRICT UNUSED(level_data), size_t level_dataSize, void* RESTRICT cbData) +static void add_level_size(size_t /*level*/, size_t /*level_w*/, size_t /*level_h*/, + const u8* RESTRICT /*level_data*/, size_t level_dataSize, void* RESTRICT cbData) { size_t* ptotal_size = (size_t*)cbData; *ptotal_size += level_dataSize; diff --git a/source/lib/tex/tex_bmp.cpp b/source/lib/tex/tex_bmp.cpp index 7bc2b226e5..00ff6cacee 100644 --- a/source/lib/tex/tex_bmp.cpp +++ b/source/lib/tex/tex_bmp.cpp @@ -60,7 +60,7 @@ struct BmpHeader #define BI_RGB 0 // biCompression -Status TexCodecBmp::transform(Tex*, size_t UNUSED(transforms)) const +Status TexCodecBmp::transform(Tex*, size_t /*transforms*/) const { return INFO::TEX_CODEC_CANNOT_HANDLE; } @@ -95,7 +95,7 @@ size_t TexCodecBmp::hdr_size(const u8* file) const // requirements: uncompressed, direct color, bottom up -Status TexCodecBmp::decode(u8* RESTRICT data, size_t UNUSED(size), Tex* RESTRICT t) const +Status TexCodecBmp::decode(u8* RESTRICT data, size_t /*size*/, Tex* RESTRICT t) const { const BmpHeader* hdr = (const BmpHeader*)data; const long w = (long)read_le32(&hdr->biWidth); diff --git a/source/lib/tex/tex_dds.cpp b/source/lib/tex/tex_dds.cpp index 08048e20d2..12331ebb0c 100644 --- a/source/lib/tex/tex_dds.cpp +++ b/source/lib/tex/tex_dds.cpp @@ -226,7 +226,7 @@ struct S3tcDecompressInfo u8* out; }; -static void s3tc_decompress_level(size_t UNUSED(level), size_t level_w, size_t level_h, +static void s3tc_decompress_level(size_t /*level*/, size_t level_w, size_t level_h, const u8* RESTRICT level_data, size_t level_data_size, void* RESTRICT cbData) { S3tcDecompressInfo* di = (S3tcDecompressInfo*)cbData; @@ -603,13 +603,13 @@ bool TexCodecDds::is_ext(const OsPath& extension) const } -size_t TexCodecDds::hdr_size(const u8* UNUSED(file)) const +size_t TexCodecDds::hdr_size(const u8* /*file*/) const { return 4+sizeof(DDS_HEADER); } -Status TexCodecDds::decode(u8* RESTRICT data, size_t UNUSED(size), Tex* RESTRICT t) const +Status TexCodecDds::decode(u8* RESTRICT data, size_t /*size*/, Tex* RESTRICT t) const { const DDS_HEADER* sd = (const DDS_HEADER*)(data+4); RETURN_STATUS_IF_ERR(decode_sd(sd, t->m_Width, t->m_Height, t->m_Bpp, t->m_Flags)); diff --git a/source/lib/tex/tex_png.cpp b/source/lib/tex/tex_png.cpp index 4d54d5cce5..c84617f214 100644 --- a/source/lib/tex/tex_png.cpp +++ b/source/lib/tex/tex_png.cpp @@ -107,7 +107,7 @@ static void io_flush(png_structp) //----------------------------------------------------------------------------- -Status TexCodecPng::transform(Tex*, size_t UNUSED(transforms)) const +Status TexCodecPng::transform(Tex*, size_t /*transforms*/) const { return INFO::TEX_CODEC_CANNOT_HANDLE; } @@ -252,7 +252,7 @@ bool TexCodecPng::is_ext(const OsPath& extension) const } -size_t TexCodecPng::hdr_size(const u8* UNUSED(file)) const +size_t TexCodecPng::hdr_size(const u8* /*file*/) const { return 0; // libpng returns decoded image data; no header } diff --git a/source/lib/tex/tex_tga.cpp b/source/lib/tex/tex_tga.cpp index 2cf9e1edf3..30d50751d2 100644 --- a/source/lib/tex/tex_tga.cpp +++ b/source/lib/tex/tex_tga.cpp @@ -67,7 +67,7 @@ TgaHeader; #pragma pack(pop) -Status TexCodecTga::transform(Tex*, size_t UNUSED(transforms)) const +Status TexCodecTga::transform(Tex*, size_t /*transforms*/) const { return INFO::TEX_CODEC_CANNOT_HANDLE; } @@ -112,7 +112,7 @@ size_t TexCodecTga::hdr_size(const u8* file) const // requirements: uncompressed, direct color, bottom up -Status TexCodecTga::decode(u8* RESTRICT data, size_t UNUSED(size), Tex* RESTRICT t) const +Status TexCodecTga::decode(u8* RESTRICT data, size_t /*size*/, Tex* RESTRICT t) const { const TgaHeader* hdr = (const TgaHeader*)data; const u8 type = hdr->img_type; diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp index 0e6e7c8333..7071b0d5aa 100644 --- a/source/lobby/XmppClient.cpp +++ b/source/lobby/XmppClient.cpp @@ -673,7 +673,7 @@ JS::Value XmppClient::GUIGetProfile(const ScriptRequest& rq) * Message interfaces * *****************************************************/ -void SetGUIMessageProperty(const ScriptRequest&, JS::HandleObject UNUSED(messageObj)) +void SetGUIMessageProperty(const ScriptRequest&, JS::HandleObject /*messageObj*/) { } diff --git a/source/maths/NUSpline.cpp b/source/maths/NUSpline.cpp index 0ff68d77ec..a30f8ed222 100644 --- a/source/maths/NUSpline.cpp +++ b/source/maths/NUSpline.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 @@ -219,7 +219,8 @@ void TNSpline::AddNode(const CFixedVector3D& pos, const CFixedVector3D& rotation } //Inserts node before position -void TNSpline::InsertNode(const int index, const CFixedVector3D& pos, const CFixedVector3D& UNUSED(rotation), fixed timePeriod) +void TNSpline::InsertNode(const int index, const CFixedVector3D& pos, const CFixedVector3D& /*rotation*/, + fixed timePeriod) { if (NodeCount >= MAX_SPLINE_NODES || index < 0 || index > NodeCount) return; diff --git a/source/network/NetMessageSim.cpp b/source/network/NetMessageSim.cpp index da21354627..2abd55ba5b 100644 --- a/source/network/NetMessageSim.cpp +++ b/source/network/NetMessageSim.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 @@ -79,7 +79,7 @@ public: { } - void Put(const char* name, const u8* UNUSED(data), size_t len) + void Put(const char* name, const u8* /*data*/, size_t len) { #if DEBUG_SERIALIZER_ANNOTATE m_Length += 2; // '<' and '>' diff --git a/source/network/NetStats.cpp b/source/network/NetStats.cpp index 883b97641f..fa1c10634a 100644 --- a/source/network/NetStats.cpp +++ b/source/network/NetStats.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 @@ -119,7 +119,7 @@ CStr CNetStatsTable::GetCellText(size_t row, size_t col) #undef ROW } -AbstractProfileTable* CNetStatsTable::GetChild(size_t UNUSED(row)) +AbstractProfileTable* CNetStatsTable::GetChild(size_t /*row*/) { return 0; } diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index 6c3c9ce459..047ffa3416 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -112,7 +112,7 @@ thread_local std::shared_ptr g_ScriptContext; bool g_InDevelopmentCopy; bool g_CheckedIfInDevelopmentCopy = false; -ErrorReactionInternal psDisplayError(const wchar_t* UNUSED(text), size_t UNUSED(flags)) +ErrorReactionInternal psDisplayError(const wchar_t* /*text*/, size_t /*flags*/) { // If we're fullscreen, then sometimes (at least on some particular drivers on Linux) // displaying the error dialog hangs the desktop since the dialog box is behind the diff --git a/source/ps/ModIo.cpp b/source/ps/ModIo.cpp index 7ee96bdd59..c1ef443caf 100644 --- a/source/ps/ModIo.cpp +++ b/source/ps/ModIo.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 @@ -186,7 +186,8 @@ size_t ModIo::DownloadCallback(void* buffer, size_t size, size_t nmemb, void* us return written; } -int ModIo::DownloadProgressCallback(void* clientp, curl_off_t dltotal, curl_off_t dlnow, curl_off_t UNUSED(ultotal), curl_off_t UNUSED(ulnow)) +int ModIo::DownloadProgressCallback(void* clientp, curl_off_t dltotal, curl_off_t dlnow, + curl_off_t /*ultotal*/, curl_off_t /*ulnow*/) { DownloadProgressData* data = static_cast(clientp); diff --git a/source/ps/Profiler2.cpp b/source/ps/Profiler2.cpp index b35e779446..08ea417ca4 100644 --- a/source/ps/Profiler2.cpp +++ b/source/ps/Profiler2.cpp @@ -776,7 +776,7 @@ public: { } - void OnSync(double UNUSED(time)) + void OnSync(double /*time*/) { // Split the array of items into an array of array (arbitrarily splitting // around the sync points) to avoid array-too-large errors in JSON decoders diff --git a/source/ps/Replay.h b/source/ps/Replay.h index e7035064d8..54cfbd5610 100644 --- a/source/ps/Replay.h +++ b/source/ps/Replay.h @@ -70,9 +70,9 @@ public: class CDummyReplayLogger : public IReplayLogger { public: - virtual void StartGame(JS::MutableHandleValue UNUSED(attribs)) { } - virtual void Turn(u32 UNUSED(n), u32 UNUSED(turnLength), std::vector&) { } - virtual void Hash(const std::string& UNUSED(hash), bool UNUSED(quick)) { } + virtual void StartGame(JS::MutableHandleValue /*attribs*/) { } + virtual void Turn(u32 /*n*/, u32 /*turnLength*/, std::vector&) { } + virtual void Hash(const std::string& /*hash*/, bool /*quick*/) { } virtual void SaveMetadata(const CSimulation2&) { }; virtual OsPath GetDirectory() const { return OsPath(); } }; diff --git a/source/ps/XML/RelaxNG.cpp b/source/ps/XML/RelaxNG.cpp index 296ed14403..d8eb5f75a5 100644 --- a/source/ps/XML/RelaxNG.cpp +++ b/source/ps/XML/RelaxNG.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 @@ -48,7 +48,7 @@ void ClearSchemaCache() g_SchemaCache.clear(); } -static void relaxNGErrorHandler(void* UNUSED(userData), +static void relaxNGErrorHandler(void* /*userData*/, std::conditional_t= 21200, const xmlError, xmlError>* error) { // Strip a trailing newline diff --git a/source/ps/XML/Xeromyces.cpp b/source/ps/XML/Xeromyces.cpp index 41d89d8b03..e2e313c2d5 100644 --- a/source/ps/XML/Xeromyces.cpp +++ b/source/ps/XML/Xeromyces.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 @@ -38,7 +38,7 @@ static std::mutex g_ValidatorCacheLock; static std::map g_ValidatorCache; -static void errorHandler(void* UNUSED(userData), +static void errorHandler(void* /*userData*/, std::conditional_t= 21200, const xmlError, xmlError>* error) { // Strip a trailing newline diff --git a/source/renderer/MikktspaceWrap.cpp b/source/renderer/MikktspaceWrap.cpp index 22483e1390..f3c55d0775 100644 --- a/source/renderer/MikktspaceWrap.cpp +++ b/source/renderer/MikktspaceWrap.cpp @@ -49,7 +49,7 @@ int MikkTSpace::GetNumFaces(const SMikkTSpaceContext* pContext) return GetUserDataFromContext(pContext)->m_Model->GetNumFaces(); } -int MikkTSpace::GetNumVerticesOfFace(const SMikkTSpaceContext*, const int UNUSED(iFace)) +int MikkTSpace::GetNumVerticesOfFace(const SMikkTSpaceContext*, const int /*iFace*/) { return 3; } @@ -91,7 +91,7 @@ void MikkTSpace::GetTexCoord(const SMikkTSpaceContext* pContext, void MikkTSpace::SetTSpace(const SMikkTSpaceContext* pContext, const float* fvTangent, - const float* UNUSED(fvBiTangent), const float UNUSED(fMagS), const float UNUSED(fMagT), + const float* /*fvBiTangent*/, const float /*fMagS*/, const float /*fMagT*/, const tbool bIsOrientationPreserving, const int iFace, const int iVert) { const MikkTSpace* userData = GetUserDataFromContext(pContext); diff --git a/source/renderer/MikktspaceWrap.h b/source/renderer/MikktspaceWrap.h index 4503b679fc..253ded00df 100644 --- a/source/renderer/MikktspaceWrap.h +++ b/source/renderer/MikktspaceWrap.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 @@ -113,8 +113,8 @@ private: * @param[in] iVert - Array containing the position vector of the face. */ static void SetTSpace(const SMikkTSpaceContext* pContext, const float* fvTangent, - const float* UNUSED(fvBiTangent), const float UNUSED(fMagS), const float UNUSED(fMagT), - const tbool bIsOrientationPreserving, const int iFace, const int iVert); + const float* /*fvBiTangent*/, const float /*fMagS*/, const float /*fMagT*/, + const tbool bIsOrientationPreserving, const int iFace, const int iVert); }; diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 08744e8785..a5224b0f2f 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -225,7 +225,7 @@ CStr CRendererStatsTable::GetCellText(size_t row, size_t col) } } -AbstractProfileTable* CRendererStatsTable::GetChild(size_t UNUSED(row)) +AbstractProfileTable* CRendererStatsTable::GetChild(size_t /*row*/) { return 0; } diff --git a/source/renderer/SceneRenderer.cpp b/source/renderer/SceneRenderer.cpp index d03605a634..fa986c8984 100644 --- a/source/renderer/SceneRenderer.cpp +++ b/source/renderer/SceneRenderer.cpp @@ -271,7 +271,7 @@ void CSceneRenderer::Initialize() } // resize renderer view -void CSceneRenderer::Resize(int UNUSED(width), int UNUSED(height)) +void CSceneRenderer::Resize(int /*width*/, int /*height*/) { // need to recreate the shadow map object to resize the shadow texture m->shadow.RecreateTexture(); diff --git a/source/renderer/TerrainOverlay.h b/source/renderer/TerrainOverlay.h index 385d260534..47994f3bab 100644 --- a/source/renderer/TerrainOverlay.h +++ b/source/renderer/TerrainOverlay.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 @@ -49,8 +49,7 @@ public: virtual void RenderBeforeWater(Renderer::Backend::IDeviceCommandContext*) { } - virtual void RenderAfterWater(Renderer::Backend::IDeviceCommandContext*, int UNUSED(cullGroup)) { } - + virtual void RenderAfterWater(Renderer::Backend::IDeviceCommandContext*, int /*cullGroup*/) { } /** * Draw all ITerrainOverlay objects that exist * and that should be drawn before water. diff --git a/source/renderer/backend/dummy/Device.cpp b/source/renderer/backend/dummy/Device.cpp index 083733903e..55350a8d81 100644 --- a/source/renderer/backend/dummy/Device.cpp +++ b/source/renderer/backend/dummy/Device.cpp @@ -92,9 +92,10 @@ std::unique_ptr CDevice::CreateVertexInputLayout( } std::unique_ptr CDevice::CreateTexture( - const char* UNUSED(name), const CTexture::Type type, const uint32_t usage, + const char* /*name*/, const CTexture::Type type, const uint32_t usage, const Format format, const uint32_t width, const uint32_t height, - const Sampler::Desc& UNUSED(defaultSamplerDesc), const uint32_t MIPLevelCount, const uint32_t UNUSED(sampleCount)) + const Sampler::Desc& /*defaultSamplerDesc*/, const uint32_t MIPLevelCount, + const uint32_t /*sampleCount*/) { return CTexture::Create(this, type, usage, format, width, height, MIPLevelCount); } @@ -144,7 +145,7 @@ void CDevice::Present() // We have nothing to present. } -void CDevice::OnWindowResize(const uint32_t UNUSED(width), const uint32_t UNUSED(height)) +void CDevice::OnWindowResize(const uint32_t /*width*/, const uint32_t /*height*/) { } @@ -169,16 +170,16 @@ uint32_t CDevice::AllocateQuery() return 0; } -void CDevice::FreeQuery(const uint32_t UNUSED(handle)) +void CDevice::FreeQuery(const uint32_t /*handle*/) { } -bool CDevice::IsQueryResultAvailable(const uint32_t UNUSED(handle)) const +bool CDevice::IsQueryResultAvailable(const uint32_t /*handle*/) const { return false; } -uint64_t CDevice::GetQueryResult(const uint32_t UNUSED(handle)) +uint64_t CDevice::GetQueryResult(const uint32_t /*handle*/) { return 0; } diff --git a/source/renderer/backend/dummy/ShaderProgram.cpp b/source/renderer/backend/dummy/ShaderProgram.cpp index 2a26543b60..d7cd88c61f 100644 --- a/source/renderer/backend/dummy/ShaderProgram.cpp +++ b/source/renderer/backend/dummy/ShaderProgram.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 @@ -47,7 +47,7 @@ IDevice* CShaderProgram::GetDevice() return m_Device; } -int32_t CShaderProgram::GetBindingSlot(const CStrIntern UNUSED(name)) const +int32_t CShaderProgram::GetBindingSlot(const CStrIntern /*name*/) const { return -1; } diff --git a/source/renderer/backend/gl/Device.cpp b/source/renderer/backend/gl/Device.cpp index 7344bf474b..a6e4d36021 100644 --- a/source/renderer/backend/gl/Device.cpp +++ b/source/renderer/backend/gl/Device.cpp @@ -117,7 +117,7 @@ std::vector GetExtensionsImpl() void GLAD_API_PTR OnDebugMessage( GLenum source, GLenum type, GLuint id, GLenum severity, - GLsizei UNUSED(length), const GLchar* message, const void* UNUSED(user_param)) + GLsizei /*length*/, const GLchar* message, const void* /*user_param*/) { std::string debugSource = "unknown"; std::string debugType = "unknown"; @@ -1081,7 +1081,7 @@ bool CDevice::IsFramebufferFormatSupported(const Format format) const } Format CDevice::GetPreferredDepthStencilFormat( - const uint32_t UNUSED(usage), const bool depth, const bool stencil) const + const uint32_t /*usage*/, const bool depth, const bool stencil) const { ENSURE(depth || stencil); if (stencil) diff --git a/source/renderer/backend/gl/DeviceCommandContext.cpp b/source/renderer/backend/gl/DeviceCommandContext.cpp index b3ba8a9129..14af72c993 100644 --- a/source/renderer/backend/gl/DeviceCommandContext.cpp +++ b/source/renderer/backend/gl/DeviceCommandContext.cpp @@ -488,7 +488,7 @@ void CDeviceCommandContext::UploadBufferRegion( UploadDynamicBufferRegionImpl(target, buffer->GetSize(), dataOffset, dataSize, uploadFunction); } -void CDeviceCommandContext::InsertTimestampQuery(const uint32_t handle, const bool UNUSED(isScopeBegin)) +void CDeviceCommandContext::InsertTimestampQuery(const uint32_t handle, const bool /*isScopeBegin*/) { // GL can have the only one command context so we can call commands on // the deivce side. @@ -1293,7 +1293,7 @@ void CDeviceCommandContext::Dispatch( } void CDeviceCommandContext::InsertMemoryBarrier( - const uint32_t UNUSED(srcStageMask), const uint32_t dstStageMask, + const uint32_t /*srcStageMask*/, const uint32_t dstStageMask, const uint32_t srcAccessMask, const uint32_t dstAccessMask) { #if !CONFIG2_GLES diff --git a/source/renderer/backend/gl/ShaderProgram.cpp b/source/renderer/backend/gl/ShaderProgram.cpp index ff2e81333d..13486721f2 100644 --- a/source/renderer/backend/gl/ShaderProgram.cpp +++ b/source/renderer/backend/gl/ShaderProgram.cpp @@ -457,7 +457,7 @@ public: return textureUnit; } - GLuint GetStorageBuffer(const int32_t UNUSED(bindingSlot)) override + GLuint GetStorageBuffer(const int32_t /*bindingSlot*/) override { debug_warn("ARB shaders don't support storage buffers."); return 0; @@ -1517,23 +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, GLsizei UNUSED(stride), - const void* UNUSED(pointer)) +void CShaderProgram::VertexPointer(const Renderer::Backend::Format, GLsizei /*stride*/, + const void* /*pointer*/) { debug_warn("CShaderProgram::VertexPointer should be overridden"); } -void CShaderProgram::NormalPointer(const Renderer::Backend::Format, GLsizei UNUSED(stride), - const void* UNUSED(pointer)) +void CShaderProgram::NormalPointer(const Renderer::Backend::Format, GLsizei /*stride*/, + const void* /*pointer*/) { debug_warn("CShaderProgram::NormalPointer should be overridden"); } -void CShaderProgram::ColorPointer(const Renderer::Backend::Format, GLsizei UNUSED(stride), - const void* UNUSED(pointer)) +void CShaderProgram::ColorPointer(const Renderer::Backend::Format, GLsizei /*stride*/, + const void* /*pointer*/) { debug_warn("CShaderProgram::ColorPointer should be overridden"); } -void CShaderProgram::TexCoordPointer(GLenum UNUSED(texture), const Renderer::Backend::Format, - GLsizei UNUSED(stride), const void* UNUSED(pointer)) +void CShaderProgram::TexCoordPointer(GLenum /*texture*/, const Renderer::Backend::Format, + GLsizei /*stride*/, const void* /*pointer*/) { debug_warn("CShaderProgram::TexCoordPointer should be overridden"); } diff --git a/source/renderer/backend/vulkan/Device.cpp b/source/renderer/backend/vulkan/Device.cpp index ae8b321cca..6036f65e99 100644 --- a/source/renderer/backend/vulkan/Device.cpp +++ b/source/renderer/backend/vulkan/Device.cpp @@ -131,7 +131,7 @@ VKAPI_ATTR VkBool32 VKAPI_CALL DebugCallback( VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* callbackData, - void* UNUSED(userData)) + void* /*userData*/) { if ((messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT) || (messageSeverity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT)) LOGMESSAGE("Vulkan: %s", callbackData->pMessage); diff --git a/source/renderer/backend/vulkan/DeviceCommandContext.cpp b/source/renderer/backend/vulkan/DeviceCommandContext.cpp index 62ef057e24..f0ae491827 100644 --- a/source/renderer/backend/vulkan/DeviceCommandContext.cpp +++ b/source/renderer/backend/vulkan/DeviceCommandContext.cpp @@ -876,7 +876,7 @@ void CDeviceCommandContext::DrawIndexedInstanced( void CDeviceCommandContext::DrawIndexedInRange( const uint32_t firstIndex, const uint32_t indexCount, - const uint32_t UNUSED(start), const uint32_t UNUSED(end)) + const uint32_t /*start*/, const uint32_t /*end*/) { DrawIndexed(firstIndex, indexCount, 0); } diff --git a/source/renderer/backend/vulkan/RingCommandContext.cpp b/source/renderer/backend/vulkan/RingCommandContext.cpp index eea12e7f0a..f55adff9b6 100644 --- a/source/renderer/backend/vulkan/RingCommandContext.cpp +++ b/source/renderer/backend/vulkan/RingCommandContext.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 @@ -157,7 +157,7 @@ void CRingCommandContext::ScheduleUpload( } void CRingCommandContext::ScheduleUpload( - CTexture* texture, const Format UNUSED(dataFormat), + CTexture* texture, const Format /*dataFormat*/, const void* data, const size_t dataSize, const uint32_t xOffset, const uint32_t yOffset, const uint32_t width, const uint32_t height, diff --git a/source/scriptinterface/ScriptStats.cpp b/source/scriptinterface/ScriptStats.cpp index 0206141b30..38c8e8e2b2 100644 --- a/source/scriptinterface/ScriptStats.cpp +++ b/source/scriptinterface/ScriptStats.cpp @@ -105,7 +105,7 @@ CStr CScriptStatsTable::GetCellText(size_t row, size_t col) } } -AbstractProfileTable* CScriptStatsTable::GetChild(size_t UNUSED(row)) +AbstractProfileTable* CScriptStatsTable::GetChild(size_t /*row*/) { return 0; } diff --git a/source/simulation2/components/CCmpCinemaManager.cpp b/source/simulation2/components/CCmpCinemaManager.cpp index e7e6afc346..cd1896e2d9 100644 --- a/source/simulation2/components/CCmpCinemaManager.cpp +++ b/source/simulation2/components/CCmpCinemaManager.cpp @@ -107,7 +107,7 @@ public: SetEnabled(m_Enabled); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpDecay.cpp b/source/simulation2/components/CCmpDecay.cpp index 9f6e212089..1f731b87a6 100644 --- a/source/simulation2/components/CCmpDecay.cpp +++ b/source/simulation2/components/CCmpDecay.cpp @@ -125,7 +125,7 @@ public: Init(paramNode); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpMinimap.cpp b/source/simulation2/components/CCmpMinimap.cpp index 77addbcd27..c097296ee3 100644 --- a/source/simulation2/components/CCmpMinimap.cpp +++ b/source/simulation2/components/CCmpMinimap.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 @@ -164,7 +164,7 @@ public: SerializeCommon(deserialize); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpMotionBall.cpp b/source/simulation2/components/CCmpMotionBall.cpp index a4fead2a6a..0c648cd38f 100644 --- a/source/simulation2/components/CCmpMotionBall.cpp +++ b/source/simulation2/components/CCmpMotionBall.cpp @@ -66,7 +66,7 @@ public: deserialize.NumberFloat_Unbounded("speed z", m_SpeedZ); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpObstruction.cpp b/source/simulation2/components/CCmpObstruction.cpp index d665d9957f..f3609d405d 100644 --- a/source/simulation2/components/CCmpObstruction.cpp +++ b/source/simulation2/components/CCmpObstruction.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 @@ -33,7 +33,8 @@ template<> struct SerializeHelper { template - void operator()(S& serialize, const char* UNUSED(name), Serialize::qualify value) + void operator()(S& serialize, const char* /*name*/, + Serialize::qualify value) { serialize.NumberU32_Unbounded("tag", value.n); } @@ -304,7 +305,7 @@ public: SerializeCommon(deserialize); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpObstructionManager.cpp b/source/simulation2/components/CCmpObstructionManager.cpp index 3b697cd742..518ef9ea61 100644 --- a/source/simulation2/components/CCmpObstructionManager.cpp +++ b/source/simulation2/components/CCmpObstructionManager.cpp @@ -88,7 +88,7 @@ template<> struct SerializeHelper { template - void operator()(S& serialize, const char* UNUSED(name), Serialize::qualify value) const + void operator()(S& serialize, const char* /*name*/, Serialize::qualify value) const { serialize.NumberU32_Unbounded("entity", value.entity); serialize.NumberFixed_Unbounded("x", value.x); @@ -106,7 +106,7 @@ template<> struct SerializeHelper { template - void operator()(S& serialize, const char* UNUSED(name), Serialize::qualify value) const + void operator()(S& serialize, const char* /*name*/, Serialize::qualify value) const { serialize.NumberU32_Unbounded("entity", value.entity); serialize.NumberFixed_Unbounded("x", value.x); @@ -223,7 +223,7 @@ public: m_UpdateInformations.dirtinessGrid = Grid(size, size); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpOverlayRenderer.cpp b/source/simulation2/components/CCmpOverlayRenderer.cpp index 140bff1327..0a942c3da5 100644 --- a/source/simulation2/components/CCmpOverlayRenderer.cpp +++ b/source/simulation2/components/CCmpOverlayRenderer.cpp @@ -81,7 +81,7 @@ public: Init(paramNode); } - void HandleMessage(const CMessage &msg, bool UNUSED(global)) override + void HandleMessage(const CMessage &msg, bool /*global*/) override { switch (msg.GetType()) { @@ -151,7 +151,7 @@ public: UpdateMessageSubscriptions(); } - void Interpolate(float UNUSED(frameTime), float frameOffset) + void Interpolate(float /*frameTime*/, float frameOffset) { // Recompute our visibility if needed. if (m_LastStoredPlayerVisibility != GetSimContext().GetCurrentDisplayedPlayer()) diff --git a/source/simulation2/components/CCmpOwnership.cpp b/source/simulation2/components/CCmpOwnership.cpp index 64f8098da0..949b0a765d 100644 --- a/source/simulation2/components/CCmpOwnership.cpp +++ b/source/simulation2/components/CCmpOwnership.cpp @@ -64,7 +64,7 @@ public: deserialize.NumberI32_Unbounded("owner", m_Owner); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpParticleManager.cpp b/source/simulation2/components/CCmpParticleManager.cpp index 6cd32137cb..bc0ecaec2a 100644 --- a/source/simulation2/components/CCmpParticleManager.cpp +++ b/source/simulation2/components/CCmpParticleManager.cpp @@ -60,7 +60,7 @@ public: Init(paramNode); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpPathfinder.cpp b/source/simulation2/components/CCmpPathfinder.cpp index 705d5b4241..a61e55afb0 100644 --- a/source/simulation2/components/CCmpPathfinder.cpp +++ b/source/simulation2/components/CCmpPathfinder.cpp @@ -118,7 +118,7 @@ template<> struct SerializeHelper { template - void operator()(S& serialize, const char* UNUSED(name), Serialize::qualify value) + void operator()(S& serialize, const char* /*name*/, Serialize::qualify value) { serialize.NumberU32_Unbounded("ticket", value.ticket); serialize.NumberFixed_Unbounded("x0", value.x0); @@ -133,7 +133,7 @@ template<> struct SerializeHelper { template - void operator()(S& serialize, const char* UNUSED(name), Serialize::qualify value) + void operator()(S& serialize, const char* /*name*/, Serialize::qualify value) { serialize.NumberU32_Unbounded("ticket", value.ticket); serialize.NumberFixed_Unbounded("x0", value.x0); @@ -169,7 +169,7 @@ void CCmpPathfinder::Deserialize(const CParamNode& paramNode, IDeserializer& des SerializeCommon(deserialize); } -void CCmpPathfinder::HandleMessage(const CMessage& msg, bool UNUSED(global)) +void CCmpPathfinder::HandleMessage(const CMessage& msg, bool /*global*/) { switch (msg.GetType()) { @@ -957,7 +957,8 @@ bool CCmpPathfinder::CheckMovement(const IObstructionTestFilter& filter, } ICmpObstruction::EFoundationCheck CCmpPathfinder::CheckUnitPlacement(const IObstructionTestFilter& filter, - entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, bool UNUSED(onlyCenterPoint)) const + entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, + bool /*onlyCenterPoint*/) const { // Check unit obstruction CmpPtr cmpObstructionManager(GetSystemEntity()); @@ -991,7 +992,7 @@ ICmpObstruction::EFoundationCheck CCmpPathfinder::CheckBuildingPlacement(const I ICmpObstruction::EFoundationCheck CCmpPathfinder::CheckBuildingPlacement(const IObstructionTestFilter& filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, - entity_pos_t h, entity_id_t id, pass_class_t passClass, bool UNUSED(onlyCenterPoint)) const + entity_pos_t h, entity_id_t id, pass_class_t passClass, bool /*onlyCenterPoint*/) const { // Check unit obstruction CmpPtr cmpObstructionManager(GetSystemEntity()); diff --git a/source/simulation2/components/CCmpPosition.cpp b/source/simulation2/components/CCmpPosition.cpp index baeb14b869..6c776f9791 100644 --- a/source/simulation2/components/CCmpPosition.cpp +++ b/source/simulation2/components/CCmpPosition.cpp @@ -781,7 +781,7 @@ public: pos1.Y += GetConstructionProgressOffset(pos1); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpProjectileManager.cpp b/source/simulation2/components/CCmpProjectileManager.cpp index 24fea6f927..b7fcf5acc0 100644 --- a/source/simulation2/components/CCmpProjectileManager.cpp +++ b/source/simulation2/components/CCmpProjectileManager.cpp @@ -88,7 +88,7 @@ public: deserialize.NumberU32_Unbounded("next id", m_NextId); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpRallyPointRenderer.cpp b/source/simulation2/components/CCmpRallyPointRenderer.cpp index a71b3979cd..157b368805 100644 --- a/source/simulation2/components/CCmpRallyPointRenderer.cpp +++ b/source/simulation2/components/CCmpRallyPointRenderer.cpp @@ -153,7 +153,7 @@ void CCmpRallyPointRenderer::Deserialize(const CParamNode& paramNode, IDeseriali // The dependent components have not been deserialized, so the color is loaded on first SetDisplayed } -void CCmpRallyPointRenderer::HandleMessage(const CMessage& msg, bool UNUSED(global)) +void CCmpRallyPointRenderer::HandleMessage(const CMessage& msg, bool /*global*/) { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpRallyPointRenderer.h b/source/simulation2/components/CCmpRallyPointRenderer.h index 3b0efd07ff..8daaa0718e 100644 --- a/source/simulation2/components/CCmpRallyPointRenderer.h +++ b/source/simulation2/components/CCmpRallyPointRenderer.h @@ -78,7 +78,7 @@ public: void Serialize(ISerializer&) override; void Deserialize(const CParamNode& paramNode, IDeserializer&) override; - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override; + void HandleMessage(const CMessage& msg, bool /*global*/) override; /* * Must be called whenever m_Displayed or the size of m_RallyPoints change, diff --git a/source/simulation2/components/CCmpRangeManager.cpp b/source/simulation2/components/CCmpRangeManager.cpp index e3a48b514d..2852a6ac7b 100644 --- a/source/simulation2/components/CCmpRangeManager.cpp +++ b/source/simulation2/components/CCmpRangeManager.cpp @@ -286,7 +286,7 @@ template<> struct SerializeHelper { template - void Common(S& serialize, const char* UNUSED(name), Serialize::qualify value) + void Common(S& serialize, const char* /*name*/, Serialize::qualify value) { serialize.NumberFixed_Unbounded("min range", value.minRange); serialize.NumberFixed_Unbounded("max range", value.maxRange); @@ -327,7 +327,7 @@ template<> struct SerializeHelper { template - void operator()(S& serialize, const char* UNUSED(name), Serialize::qualify value) + void operator()(S& serialize, const char* /*name*/, Serialize::qualify value) { serialize.NumberFixed_Unbounded("x", value.x); serialize.NumberFixed_Unbounded("z", value.z); @@ -508,7 +508,7 @@ public: SerializeCommon(deserialize); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpRangeOverlayRenderer.cpp b/source/simulation2/components/CCmpRangeOverlayRenderer.cpp index 838c2eb94d..f5f6e3dadc 100644 --- a/source/simulation2/components/CCmpRangeOverlayRenderer.cpp +++ b/source/simulation2/components/CCmpRangeOverlayRenderer.cpp @@ -98,7 +98,7 @@ public: UpdateMessageSubscriptions(); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpSelectable.cpp b/source/simulation2/components/CCmpSelectable.cpp index 5b3fdc4e89..4a902cc613 100644 --- a/source/simulation2/components/CCmpSelectable.cpp +++ b/source/simulation2/components/CCmpSelectable.cpp @@ -229,7 +229,7 @@ public: Init(paramNode); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override; + void HandleMessage(const CMessage& msg, bool /*global*/) override; void SetSelectionHighlight(const CColor& color, bool selected) override { @@ -354,7 +354,7 @@ private: const float CCmpSelectable::FADE_DURATION = 0.3f; const char* CCmpSelectable::TEXTUREBASEPATH = "art/textures/selection/"; -void CCmpSelectable::HandleMessage(const CMessage& msg, bool UNUSED(global)) +void CCmpSelectable::HandleMessage(const CMessage& msg, bool /*global*/) { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpTemplateManager.cpp b/source/simulation2/components/CCmpTemplateManager.cpp index b2734cae1c..21971296cd 100644 --- a/source/simulation2/components/CCmpTemplateManager.cpp +++ b/source/simulation2/components/CCmpTemplateManager.cpp @@ -78,7 +78,7 @@ public: m_LatestTemplates[id] = mapEl.first; } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpTerritoryManager.cpp b/source/simulation2/components/CCmpTerritoryManager.cpp index cda01e9cac..0754a35316 100644 --- a/source/simulation2/components/CCmpTerritoryManager.cpp +++ b/source/simulation2/components/CCmpTerritoryManager.cpp @@ -171,7 +171,7 @@ public: deserialize.Bool("trigger event", m_TriggerEvent); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { @@ -705,7 +705,7 @@ void CCmpTerritoryManager::UpdateBoundaryLines() } } -void CCmpTerritoryManager::Interpolate(float frameTime, float UNUSED(frameOffset)) +void CCmpTerritoryManager::Interpolate(float frameTime, float /*frameOffset*/) { m_AnimTime += frameTime; diff --git a/source/simulation2/components/CCmpTest.cpp b/source/simulation2/components/CCmpTest.cpp index 1791c20b47..61cd8df278 100644 --- a/source/simulation2/components/CCmpTest.cpp +++ b/source/simulation2/components/CCmpTest.cpp @@ -69,7 +69,7 @@ public: return m_x; } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { @@ -133,7 +133,7 @@ public: return m_x; } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { @@ -194,7 +194,7 @@ public: return m_x; } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpUnitMotion.h b/source/simulation2/components/CCmpUnitMotion.h index 9796bd03bb..a31616ed04 100644 --- a/source/simulation2/components/CCmpUnitMotion.h +++ b/source/simulation2/components/CCmpUnitMotion.h @@ -370,7 +370,7 @@ public: m_BlockMovement = cmpObstruction->GetBlockMovementFlag(false); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpUnitMotion_System.cpp b/source/simulation2/components/CCmpUnitMotion_System.cpp index 7e696b753b..a5fae99a3a 100644 --- a/source/simulation2/components/CCmpUnitMotion_System.cpp +++ b/source/simulation2/components/CCmpUnitMotion_System.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 @@ -130,7 +130,7 @@ void CCmpUnitMotionManager::ClassInit(CComponentManager& componentManager) #endif } -void CCmpUnitMotionManager::HandleMessage(const CMessage& msg, bool UNUSED(global)) +void CCmpUnitMotionManager::HandleMessage(const CMessage& msg, bool /*global*/) { switch (msg.GetType()) { @@ -276,7 +276,8 @@ template<> struct SerializeHelper { template - void operator()(S& serialize, const char* UNUSED(name), Serialize::qualify value) + void operator()(S& serialize, const char* /*name*/, + Serialize::qualify value) { Serializer(serialize, "pushing pressure", value.pushingPressure); } @@ -285,7 +286,8 @@ struct SerializeHelper template<> struct SerializeHelper> { - void operator()(ISerializer& serialize, const char* UNUSED(name), EntityMap& value) + void operator()(ISerializer& serialize, const char* /*name*/, + EntityMap& value) { // Serialize manually, we don't have a default-constructor for deserialization. Serializer(serialize, "size", static_cast(value.size())); @@ -296,7 +298,8 @@ struct SerializeHelper> } } - void operator()(IDeserializer& deserialize, const char* UNUSED(name), EntityMap& value) + void operator()(IDeserializer& deserialize, const char* /*name*/, + EntityMap& value) { u32 units = 0; Serializer(deserialize, "size", units); @@ -778,7 +781,7 @@ void CCmpUnitMotionManager::Push(EntityMap::value_type& a, EntityMa } #if DEBUG_RENDER -void RenderDebugOverlay(SceneCollector& collector, const CFrustum& frustum, bool UNUSED(culling)) +void RenderDebugOverlay(SceneCollector& collector, const CFrustum& frustum, bool /*culling*/) { for (SOverlaySphere& sph: debugDataMotionMgr.m_Spheres) if (frustum.IsSphereVisible(sph.m_Center, sph.m_Radius)) diff --git a/source/simulation2/components/CCmpUnitRenderer.cpp b/source/simulation2/components/CCmpUnitRenderer.cpp index 45a2a38942..7665e6bd05 100644 --- a/source/simulation2/components/CCmpUnitRenderer.cpp +++ b/source/simulation2/components/CCmpUnitRenderer.cpp @@ -158,7 +158,7 @@ public: Init(paramNode); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpVision.cpp b/source/simulation2/components/CCmpVision.cpp index fedba46465..6a52a31109 100644 --- a/source/simulation2/components/CCmpVision.cpp +++ b/source/simulation2/components/CCmpVision.cpp @@ -82,7 +82,7 @@ public: Init(paramNode); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpVisualActor.cpp b/source/simulation2/components/CCmpVisualActor.cpp index 9113919e25..6c2d0d0308 100644 --- a/source/simulation2/components/CCmpVisualActor.cpp +++ b/source/simulation2/components/CCmpVisualActor.cpp @@ -305,7 +305,7 @@ public: } } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { diff --git a/source/simulation2/components/CCmpWaterManager.cpp b/source/simulation2/components/CCmpWaterManager.cpp index 3255e8b96b..1e93d6959e 100644 --- a/source/simulation2/components/CCmpWaterManager.cpp +++ b/source/simulation2/components/CCmpWaterManager.cpp @@ -77,7 +77,7 @@ public: RecomputeWaterData(); } - void HandleMessage(const CMessage& msg, bool UNUSED(global)) override + void HandleMessage(const CMessage& msg, bool /*global*/) override { switch (msg.GetType()) { @@ -126,12 +126,12 @@ public: GetSimContext().GetComponentManager().BroadcastMessage(msg); } - entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override + entity_pos_t GetWaterLevel(entity_pos_t /*x*/, entity_pos_t /*z*/) const override { return m_WaterHeight; } - float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const override + float GetExactWaterLevel(float /*x*/, float /*z*/) const override { return m_WaterHeight.ToFloat(); } diff --git a/source/simulation2/components/ICmpObstructionManager.h b/source/simulation2/components/ICmpObstructionManager.h index a6f5ead43b..902c3f9d9b 100644 --- a/source/simulation2/components/ICmpObstructionManager.h +++ b/source/simulation2/components/ICmpObstructionManager.h @@ -377,7 +377,7 @@ public: class NullObstructionFilter : public IObstructionTestFilter { public: - virtual bool TestShape(tag_t, flags_t, entity_id_t UNUSED(group), entity_id_t UNUSED(group2)) const + virtual bool TestShape(tag_t, flags_t /*flags*/, entity_id_t /*group*/, entity_id_t /*group2*/) const { return true; } @@ -389,7 +389,7 @@ public: class StationaryOnlyObstructionFilter : public IObstructionTestFilter { public: - virtual bool TestShape(tag_t, 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 /*group*/, entity_id_t /*group2*/) const { return !(flags & ICmpObstructionManager::FLAG_MOVING); } @@ -531,7 +531,7 @@ public: { } - virtual bool TestShape(tag_t tag, flags_t, entity_id_t UNUSED(group), entity_id_t UNUSED(group2)) const + virtual bool TestShape(tag_t tag, flags_t, entity_id_t /*group*/, entity_id_t /*group2*/) const { return tag.n != m_Tag.n; } @@ -584,7 +584,7 @@ public: { } - virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t UNUSED(group), entity_id_t UNUSED(group2)) const + virtual bool TestShape(tag_t tag, flags_t flags, entity_id_t /*group*/, entity_id_t /*group2*/) const { return (tag.n != m_Tag.n && (flags & m_Mask) != 0); } diff --git a/source/simulation2/components/tests/test_ObstructionManager.h b/source/simulation2/components/tests/test_ObstructionManager.h index d39a339f1c..54251975ee 100644 --- a/source/simulation2/components/tests/test_ObstructionManager.h +++ b/source/simulation2/components/tests/test_ObstructionManager.h @@ -30,29 +30,29 @@ public: ICmpObstructionManager::tag_t GetObstruction() const override { return ICmpObstructionManager::tag_t(); } bool GetObstructionSquare(ICmpObstructionManager::ObstructionSquare& out) const override { out = obstruction; return true; } - bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& UNUSED(out)) const override { return true; } + bool GetPreviousObstructionSquare(ICmpObstructionManager::ObstructionSquare& /*out*/) const override { return true; } entity_pos_t GetSize() const override { return entity_pos_t::Zero(); } CFixedVector2D GetStaticSize() const override { return CFixedVector2D(); } EObstructionType GetObstructionType() const override { return ICmpObstruction::STATIC; } - void SetUnitClearance(const entity_pos_t& UNUSED(clearance)) override { } + void SetUnitClearance(const entity_pos_t& /*clearance*/) override { } bool IsControlPersistent() const override { return true; } bool CheckShorePlacement() const override { return true; } - EFoundationCheck CheckFoundation(const std::string& UNUSED(className)) const override { return EFoundationCheck(); } - EFoundationCheck CheckFoundation(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const override { return EFoundationCheck(); } - std::string CheckFoundation_wrapper(const std::string& UNUSED(className), bool UNUSED(onlyCenterPoint)) const override { return std::string(); } + EFoundationCheck CheckFoundation(const std::string& /*className*/) const override { return EFoundationCheck(); } + EFoundationCheck CheckFoundation(const std::string& /*className*/, bool /*onlyCenterPoint*/) const override { return EFoundationCheck(); } + std::string CheckFoundation_wrapper(const std::string& /*className*/, bool /*onlyCenterPoint*/) const override { return std::string(); } bool CheckDuplicateFoundation() const override { return true; } std::vector 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(); } void ResolveFoundationCollisions() const override { } - void SetActive(bool UNUSED(active)) override { } - void SetMovingFlag(bool UNUSED(enabled)) override { } - void SetDisableBlockMovementPathfinding(bool UNUSED(movementDisabled), bool UNUSED(pathfindingDisabled), int32_t UNUSED(shape)) override { } + void SetActive(bool /*active*/) override { } + void SetMovingFlag(bool /*enabled*/) override { } + void SetDisableBlockMovementPathfinding(bool /*movementDisabled*/, bool /*pathfindingDisabled*/, int32_t /*shape*/) override { } bool GetBlockMovementFlag(bool) const override { return true; } - void SetControlGroup(entity_id_t UNUSED(group)) override { } + void SetControlGroup(entity_id_t /*group*/) override { } entity_id_t GetControlGroup() const override { return INVALID_ENTITY; } - void SetControlGroup2(entity_id_t UNUSED(group2)) override { } + void SetControlGroup2(entity_id_t /*group2*/) override { } entity_id_t GetControlGroup2() const override { return INVALID_ENTITY; } }; diff --git a/source/simulation2/components/tests/test_Position.h b/source/simulation2/components/tests/test_Position.h index 1e46745233..7d5ae93101 100644 --- a/source/simulation2/components/tests/test_Position.h +++ b/source/simulation2/components/tests/test_Position.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 @@ -26,12 +26,12 @@ class MockWater : public ICmpWaterManager public: DEFAULT_MOCK_COMPONENT() - entity_pos_t GetWaterLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override + entity_pos_t GetWaterLevel(entity_pos_t /*x*/, entity_pos_t /*z*/) const override { return entity_pos_t::FromInt(100); } - float GetExactWaterLevel(float UNUSED(x), float UNUSED(z)) const override + float GetExactWaterLevel(float /*x*/, float /*z*/) const override { return 100.f; } @@ -40,7 +40,7 @@ public: { } - void SetWaterLevel(entity_pos_t UNUSED(h)) override + void SetWaterLevel(entity_pos_t /*h*/) override { } }; diff --git a/source/simulation2/components/tests/test_RangeManager.h b/source/simulation2/components/tests/test_RangeManager.h index 7001102673..4b1b123da9 100644 --- a/source/simulation2/components/tests/test_RangeManager.h +++ b/source/simulation2/components/tests/test_RangeManager.h @@ -41,39 +41,39 @@ class MockPositionRgm : public ICmpPosition public: DEFAULT_MOCK_COMPONENT() - void SetTurretParent(entity_id_t UNUSED(id), const CFixedVector3D& UNUSED(pos)) override {} + void SetTurretParent(entity_id_t /*id*/, const CFixedVector3D& /*pos*/) override {} entity_id_t GetTurretParent() const override {return INVALID_ENTITY;} void UpdateTurretPosition() override {} std::set* GetTurrets() override { return nullptr; } bool IsInWorld() const override { return true; } void MoveOutOfWorld() override { } - void MoveTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) override { } - void MoveAndTurnTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z), entity_angle_t UNUSED(a)) override { } - void JumpTo(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) override { } - void SetHeightOffset(entity_pos_t UNUSED(dy)) override { } + void MoveTo(entity_pos_t /*x*/, entity_pos_t /*z*/) override { } + void MoveAndTurnTo(entity_pos_t /*x*/, entity_pos_t /*z*/, entity_angle_t /*a*/) override { } + void JumpTo(entity_pos_t /*x*/, entity_pos_t /*z*/) override { } + void SetHeightOffset(entity_pos_t /*dy*/) override { } entity_pos_t GetHeightOffset() const override { return entity_pos_t::Zero(); } - void SetHeightFixed(entity_pos_t UNUSED(y)) override { } + void SetHeightFixed(entity_pos_t /*y*/) override { } entity_pos_t GetHeightFixed() const override { return entity_pos_t::Zero(); } entity_pos_t GetHeightAtFixed(entity_pos_t, entity_pos_t) const override { return entity_pos_t::Zero(); } bool IsHeightRelative() const override { return true; } - void SetHeightRelative(bool UNUSED(relative)) override { } + void SetHeightRelative(bool /*relative*/) override { } bool CanFloat() const override { return false; } - void SetFloating(bool UNUSED(flag)) override { } - void SetActorFloating(bool UNUSED(flag)) override { } - void SetActorAnchor(const CStr& UNUSED(anchor)) override { } - void SetConstructionProgress(fixed UNUSED(progress)) override { } + void SetFloating(bool /*flag*/) override { } + void SetActorFloating(bool /*flag*/) override { } + void SetActorAnchor(const CStr& /*anchor*/) override { } + void SetConstructionProgress(fixed /*progress*/) override { } CFixedVector3D GetPosition() const override { return m_Pos; } CFixedVector2D GetPosition2D() const override { return CFixedVector2D(m_Pos.X, m_Pos.Z); } CFixedVector3D GetPreviousPosition() const override { return CFixedVector3D(); } CFixedVector2D GetPreviousPosition2D() const override { return CFixedVector2D(); } fixed GetTurnRate() const override { return fixed::Zero(); } - void TurnTo(entity_angle_t UNUSED(y)) override { } - void SetYRotation(entity_angle_t UNUSED(y)) override { } - void SetXZRotation(entity_angle_t UNUSED(x), entity_angle_t UNUSED(z)) override { } + void TurnTo(entity_angle_t /*y*/) override { } + void SetYRotation(entity_angle_t /*y*/) override { } + void SetXZRotation(entity_angle_t /*x*/, entity_angle_t /*z*/) override { } CFixedVector3D GetRotation() const override { return CFixedVector3D(); } fixed GetDistanceTravelled() const override { return fixed::Zero(); } - void GetInterpolatedPosition2D(float UNUSED(frameOffset), float& x, float& z, float& rotY) const override { x = z = rotY = 0; } - CMatrix3D GetInterpolatedTransform(float UNUSED(frameOffset)) const override { return CMatrix3D(); } + void GetInterpolatedPosition2D(float /*frameOffset*/, float& x, float& z, float& rotY) const override { x = z = rotY = 0; } + CMatrix3D GetInterpolatedTransform(float /*frameOffset*/) const override { return CMatrix3D(); } CFixedVector3D m_Pos; }; diff --git a/source/simulation2/docs/CCmpExample.cpp b/source/simulation2/docs/CCmpExample.cpp index 6bf03cf1ac..a465eef0c1 100644 --- a/source/simulation2/docs/CCmpExample.cpp +++ b/source/simulation2/docs/CCmpExample.cpp @@ -1,4 +1,4 @@ -/* Copyright (C) 2017 Wildfire Games. +/* Copyright (C) 2025 Wildfire Games. * ...the usual copyright header... */ @@ -46,7 +46,7 @@ public: // ... } - virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) + virtual void HandleMessage(const CMessage& msg, bool /*global*/) { // ... } diff --git a/source/simulation2/docs/SimulationDocs.h b/source/simulation2/docs/SimulationDocs.h index c3b19a2050..49c061d06e 100644 --- a/source/simulation2/docs/SimulationDocs.h +++ b/source/simulation2/docs/SimulationDocs.h @@ -207,7 +207,7 @@ to hear about all MT_Destroy messages.) Then you need to respond to the messages in @c HandleMessage: @code -virtual void HandleMessage(const CMessage& msg, bool UNUSED(global)) +virtual void HandleMessage(const CMessage& msg, bool global) { switch (msg.GetType()) { diff --git a/source/simulation2/helpers/LongPathfinder.cpp b/source/simulation2/helpers/LongPathfinder.cpp index 287fadfde6..3c96a761e0 100644 --- a/source/simulation2/helpers/LongPathfinder.cpp +++ b/source/simulation2/helpers/LongPathfinder.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 @@ -136,7 +136,7 @@ class JumpPointCache return data.capacity() * sizeof(Interval); } - RowTree(int UNUSED(length)) + RowTree(int /*length*/) { } diff --git a/source/simulation2/helpers/PriorityQueue.h b/source/simulation2/helpers/PriorityQueue.h index 475f073478..a764fe0e02 100644 --- a/source/simulation2/helpers/PriorityQueue.h +++ b/source/simulation2/helpers/PriorityQueue.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2015 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 @@ -77,7 +77,7 @@ public: push_heap(m_Heap.begin(), m_Heap.end(), QueueItemPriority()); } - void promote(ID id, R UNUSED(oldrank), R newrank, H newh) + void promote(ID id, R /*oldrank*/, R newrank, H newh) { // Loop backwards since it seems a little faster in practice for (ssize_t n = m_Heap.size() - 1; n >= 0; --n) @@ -157,7 +157,7 @@ public: return NULL; } - void promote(ID id, R UNUSED(oldrank), R newrank, H newh) + void promote(ID id, R /*oldrank*/, R newrank, H newh) { find(id)->rank = newrank; find(id)->h = newh; diff --git a/source/simulation2/helpers/Spatial.h b/source/simulation2/helpers/Spatial.h index d1626fcfc1..bcffee87c0 100644 --- a/source/simulation2/helpers/Spatial.h +++ b/source/simulation2/helpers/Spatial.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2016 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 @@ -319,7 +319,7 @@ private: template<> struct SerializeHelper { - void operator()(ISerializer& serialize, const char* UNUSED(name), SpatialSubdivision& value) + void operator()(ISerializer& serialize, const char* /*name*/, SpatialSubdivision& value) { serialize.NumberFixed_Unbounded("div size", value.m_DivisionSize); serialize.NumberU32_Unbounded("divs w", value.m_DivisionsW); @@ -330,7 +330,7 @@ struct SerializeHelper Serializer(serialize, "subdiv items", value.m_Divisions[i].items); } - void operator()(IDeserializer& serialize, const char* UNUSED(name), SpatialSubdivision& value) + void operator()(IDeserializer& serialize, const char* /*name*/, SpatialSubdivision& value) { serialize.NumberFixed_Unbounded("div size", value.m_DivisionSize); serialize.NumberU32_Unbounded("divs w", value.m_DivisionsW); diff --git a/source/simulation2/helpers/VertexPathfinder.cpp b/source/simulation2/helpers/VertexPathfinder.cpp index 4c922b723f..932d025f0e 100644 --- a/source/simulation2/helpers/VertexPathfinder.cpp +++ b/source/simulation2/helpers/VertexPathfinder.cpp @@ -1003,8 +1003,8 @@ void VertexPathfinderDebugOverlay::DebugRenderGraph(const CSimContext& simContex } } -void VertexPathfinderDebugOverlay::DebugRenderEdges(const CSimContext&, bool UNUSED(visible), - CFixedVector2D UNUSED(curr), CFixedVector2D UNUSED(npos)) +void VertexPathfinderDebugOverlay::DebugRenderEdges(const CSimContext&, bool /*visible*/, + CFixedVector2D /*curr*/, CFixedVector2D /*npos*/) { if (!m_DebugOverlay) return; diff --git a/source/simulation2/serialization/BinarySerializer.h b/source/simulation2/serialization/BinarySerializer.h index 9915f573a4..ee31a6f72c 100644 --- a/source/simulation2/serialization/BinarySerializer.h +++ b/source/simulation2/serialization/BinarySerializer.h @@ -205,7 +205,7 @@ protected: m_Impl.Put(name, (u8*)value.data(), value.length()); } - virtual void PutScriptVal(const char* UNUSED(name), JS::MutableHandleValue value) + virtual void PutScriptVal(const char* /*name*/, JS::MutableHandleValue value) { m_ScriptImpl->PutScriptVal(value); } diff --git a/source/simulation2/serialization/HashSerializer.h b/source/simulation2/serialization/HashSerializer.h index 5a5b898dea..2aa422b7f6 100644 --- a/source/simulation2/serialization/HashSerializer.h +++ b/source/simulation2/serialization/HashSerializer.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 @@ -32,7 +32,7 @@ public: size_t GetHashLength(); const u8* ComputeHash(); - void Put(const char* UNUSED(name), const u8* data, size_t len) + void Put(const char* /*name*/, const u8* data, size_t len) { m_Hash.Update(data, len); } diff --git a/source/simulation2/serialization/SerializedPathfinder.h b/source/simulation2/serialization/SerializedPathfinder.h index 84e58922bd..e412af7058 100644 --- a/source/simulation2/serialization/SerializedPathfinder.h +++ b/source/simulation2/serialization/SerializedPathfinder.h @@ -1,4 +1,4 @@ -/* Copyright (C) 2020 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 @@ -23,13 +23,13 @@ template<> struct SerializeHelper { - void operator()(ISerializer& serialize, const char* UNUSED(name), const Waypoint& value) + void operator()(ISerializer& serialize, const char* /*name*/, const Waypoint& value) { serialize.NumberFixed_Unbounded("waypoint x", value.x); serialize.NumberFixed_Unbounded("waypoint z", value.z); } - void operator()(IDeserializer& deserialize, const char* UNUSED(name), Waypoint& value) + void operator()(IDeserializer& deserialize, const char* /*name*/, Waypoint& value) { deserialize.NumberFixed_Unbounded("waypoint x", value.x); deserialize.NumberFixed_Unbounded("waypoint z", value.z); @@ -40,7 +40,7 @@ template<> struct SerializeHelper { template - void operator()(S& serialize, const char* UNUSED(name), Serialize::qualify value) + void operator()(S& serialize, const char* /*name*/, Serialize::qualify value) { Serializer(serialize, "type", value.type, PathGoal::INVERTED_SQUARE); serialize.NumberFixed_Unbounded("goal x", value.x); diff --git a/source/simulation2/serialization/SerializedTypes.h b/source/simulation2/serialization/SerializedTypes.h index a615f2d0ef..e107d790dc 100644 --- a/source/simulation2/serialization/SerializedTypes.h +++ b/source/simulation2/serialization/SerializedTypes.h @@ -104,7 +104,7 @@ template struct SerializeHelper> { template - void operator()(ISerializer& serialize, const char* UNUSED(name), std::map& value, Args&&... args) + void operator()(ISerializer& serialize, const char* /*name*/, std::map& value, Args&&... args) { size_t len = value.size(); serialize.NumberU32_Unbounded("length", (u32)len); @@ -116,7 +116,8 @@ struct SerializeHelper> } template - void operator()(IDeserializer& deserialize, const char* UNUSED(name), std::map& value, Args&&... args) + void operator()(IDeserializer& deserialize, const char* /*name*/, std::map& value, + Args&&... args) { value.clear(); u32 len; diff --git a/source/simulation2/serialization/StdDeserializer.cpp b/source/simulation2/serialization/StdDeserializer.cpp index 59cd3d61df..8e5ecca59a 100644 --- a/source/simulation2/serialization/StdDeserializer.cpp +++ b/source/simulation2/serialization/StdDeserializer.cpp @@ -121,7 +121,7 @@ void CStdDeserializer::GetScriptBackref(size_t tag, JS::MutableHandleObject ret) //////////////////////////////////////////////////////////////// -JS::Value CStdDeserializer::ReadScriptVal(const char* UNUSED(name), JS::HandleObject preexistingObject) +JS::Value CStdDeserializer::ReadScriptVal(const char* /*name*/, JS::HandleObject preexistingObject) { ScriptRequest rq(m_ScriptInterface); diff --git a/source/simulation2/system/ComponentTest.h b/source/simulation2/system/ComponentTest.h index c02a256da4..b13140cdb9 100644 --- a/source/simulation2/system/ComponentTest.h +++ b/source/simulation2/system/ComponentTest.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 @@ -198,22 +198,22 @@ public: return true; } - CFixedVector3D CalcNormal(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override + CFixedVector3D CalcNormal(entity_pos_t /*x*/, entity_pos_t /*z*/) const override { return CFixedVector3D(fixed::FromInt(0), fixed::FromInt(1), fixed::FromInt(0)); } - CVector3D CalcExactNormal(float UNUSED(x), float UNUSED(z)) const override + CVector3D CalcExactNormal(float /*x*/, float /*z*/) const override { return CVector3D(0.f, 1.f, 0.f); } - entity_pos_t GetGroundLevel(entity_pos_t UNUSED(x), entity_pos_t UNUSED(z)) const override + entity_pos_t GetGroundLevel(entity_pos_t /*x*/, entity_pos_t /*z*/) const override { return entity_pos_t::FromInt(50); } - float GetExactGroundLevel(float UNUSED(x), float UNUSED(z)) const override + float GetExactGroundLevel(float /*x*/, float /*z*/) const override { return 50.f; } @@ -238,11 +238,11 @@ public: return nullptr; } - void MakeDirty(i32 UNUSED(i0), i32 UNUSED(j0), i32 UNUSED(i1), i32 UNUSED(j1)) override + void MakeDirty(i32 /*i0*/, i32 /*j0*/, i32 /*i1*/, i32 /*j1*/) override { } - void ReloadTerrain(bool UNUSED(ReloadWater)) override + void ReloadTerrain(bool /*ReloadWater*/) override { } }; diff --git a/source/simulation2/system/EntityMap.h b/source/simulation2/system/EntityMap.h index f951127ba8..0486606b7d 100644 --- a/source/simulation2/system/EntityMap.h +++ b/source/simulation2/system/EntityMap.h @@ -252,7 +252,7 @@ fill_gaps: template struct SerializeHelper> { - void operator()(ISerializer& serialize, const char* UNUSED(name), EntityMap& value) + void operator()(ISerializer& serialize, const char* /*name*/, EntityMap& value) { size_t len = value.size(); serialize.NumberU32_Unbounded("length", (u32)len); @@ -268,7 +268,7 @@ struct SerializeHelper> ENSURE(count == len); } - void operator()(IDeserializer& deserialize, const char* UNUSED(name), EntityMap& value) + void operator()(IDeserializer& deserialize, const char* /*name*/, EntityMap& value) { value.clear(); uint32_t len; diff --git a/source/simulation2/system/IComponent.cpp b/source/simulation2/system/IComponent.cpp index 241a1de044..b3057f16a3 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&, bool UNUSED(global)) +void IComponent::HandleMessage(const CMessage&, bool /*global*/) { } diff --git a/source/simulation2/system/LocalTurnManager.cpp b/source/simulation2/system/LocalTurnManager.cpp index 939f9cce07..d5ffb204af 100644 --- a/source/simulation2/system/LocalTurnManager.cpp +++ b/source/simulation2/system/LocalTurnManager.cpp @@ -39,7 +39,7 @@ void CLocalTurnManager::NotifyFinishedOwnCommands(u32 turn) FinishedAllCommands(turn, m_TurnLength); } -void CLocalTurnManager::NotifyFinishedUpdate(u32 UNUSED(turn)) +void CLocalTurnManager::NotifyFinishedUpdate(u32 /*turn*/) { #if 0 // this hurts performance and is only useful for verifying log replays std::string hash; diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp index 838ad8fcb3..4d4a29455e 100644 --- a/source/soundmanager/SoundManager.cpp +++ b/source/soundmanager/SoundManager.cpp @@ -179,7 +179,7 @@ private: bool m_Shutdown; - CSoundManagerWorker(ISoundManager* UNUSED(other)){}; + CSoundManagerWorker(ISoundManager* /*other*/){}; }; void ISoundManager::CreateSoundManager() @@ -601,7 +601,7 @@ void CSoundManager::IdleTask() } } -ISoundItem* CSoundManager::ItemForEntity(entity_id_t UNUSED(source), CSoundData* sndData) +ISoundItem* CSoundManager::ItemForEntity(entity_id_t /*source*/, CSoundData* sndData) { ISoundItem* currentItem = NULL; @@ -873,7 +873,7 @@ CStr8 CSoundManager::GetSoundCardNames() const #else // CONFIG2_AUDIO void ISoundManager::CreateSoundManager(){} -void ISoundManager::SetEnabled(bool UNUSED(doEnable)){} +void ISoundManager::SetEnabled(bool /*doEnable*/){} void ISoundManager::CloseGame(){} void ISoundManager::RunHardwareDetection() {} CStr8 ISoundManager::GetSoundCardNames() const { return CStr8(); }; diff --git a/source/soundmanager/SoundManager.h b/source/soundmanager/SoundManager.h index d7af873a31..9dc5513350 100644 --- a/source/soundmanager/SoundManager.h +++ b/source/soundmanager/SoundManager.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 @@ -171,7 +171,7 @@ protected: void SetMusicItem(ISoundItem* anItem); private: - CSoundManager(CSoundManager* UNUSED(other)){}; + CSoundManager(CSoundManager* /*other*/){}; }; #else // !CONFIG2_AUDIO diff --git a/source/soundmanager/scripting/JSInterface_Sound.cpp b/source/soundmanager/scripting/JSInterface_Sound.cpp index b4cd190bd4..1120dd4edd 100644 --- a/source/soundmanager/scripting/JSInterface_Sound.cpp +++ b/source/soundmanager/scripting/JSInterface_Sound.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 @@ -118,19 +118,19 @@ namespace JSI_Sound #else bool MusicPlaying( ){ return false; } - void PlayAmbientSound(const std::wstring& UNUSED(filename), bool UNUSED(looping) ){} - void PlayUISound(const std::wstring& UNUSED(filename), bool UNUSED(looping) ) {} - void PlayMusic(const std::wstring& UNUSED(filename), bool UNUSED(looping) ) {} - void StartPlaylist(bool UNUSED(looping) ){} - void AddPlaylistItem(const std::wstring& UNUSED(filename) ){} + void PlayAmbientSound(const std::wstring& /*filename*/, bool /*looping*/ ){} + void PlayUISound(const std::wstring& /*filename*/, bool /*looping*/ ) {} + void PlayMusic(const std::wstring& /*filename*/, bool /*looping*/ ) {} + void StartPlaylist(bool /*looping*/ ){} + void AddPlaylistItem(const std::wstring& /*filename*/ ){} void ClearPlaylist( ){} void StopMusic( ){} void StartMusic( ){} - void SetMasterGain(float UNUSED(gain)){} - void SetMusicGain(float UNUSED(gain)){} - void SetAmbientGain(float UNUSED(gain)){} - void SetActionGain(float UNUSED(gain)){} - void SetUIGain(float UNUSED(gain)){} + void SetMasterGain(float /*gain*/){} + void SetMusicGain(float /*gain*/){} + void SetAmbientGain(float /*gain*/){} + void SetActionGain(float /*gain*/){} + void SetUIGain(float /*gain*/){} #endif diff --git a/source/soundmanager/scripting/SoundGroup.cpp b/source/soundmanager/scripting/SoundGroup.cpp index c9277f3635..9f1753d4f1 100644 --- a/source/soundmanager/scripting/SoundGroup.cpp +++ b/source/soundmanager/scripting/SoundGroup.cpp @@ -292,7 +292,7 @@ void CSoundGroup::ReleaseGroup() #endif } -void CSoundGroup::Update(float UNUSED(TimeSinceLastFrame)) +void CSoundGroup::Update(float /*TimeSinceLastFrame*/) { } diff --git a/source/third_party/ogre3d_preprocessor/tests/test_Preprocessor.h b/source/third_party/ogre3d_preprocessor/tests/test_Preprocessor.h index 878f500a57..a059f949db 100644 --- a/source/third_party/ogre3d_preprocessor/tests/test_Preprocessor.h +++ b/source/third_party/ogre3d_preprocessor/tests/test_Preprocessor.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 @@ -202,7 +202,7 @@ public: { int includeRetrievedCounter = 0; CPreprocessorWrapper::IncludeRetrieverCallback includeCallback = [&includeRetrievedCounter]( - const CStr& UNUSED(includePath), CStr& out) { + const CStr& /*includePath*/, CStr& out) { out = "42"; ++includeRetrievedCounter; return true; @@ -219,7 +219,7 @@ public: void test_include_invalid_file() { CPreprocessorWrapper::IncludeRetrieverCallback includeCallback = []( - const CStr& UNUSED(includePath), CStr& UNUSED(out)) { + const CStr& /*includePath*/, CStr& /*out*/) { return false; }; @@ -233,7 +233,7 @@ public: void test_include_with_defines() { CPreprocessorWrapper::IncludeRetrieverCallback includeCallback = []( - const CStr& UNUSED(includePath), CStr& out) { + const CStr& /*includePath*/, CStr& out) { out = R"( #if defined(A) #define X 41 diff --git a/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp index 0960d75c16..7731654df3 100644 --- a/source/tools/atlas/GameInterface/Handlers/MapHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/MapHandlers.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 @@ -653,7 +653,7 @@ QUERYHANDLER(VFSFileRealPath) msg->realPath = realPathname.string(); } -static Status AddToFilenames(const VfsPath& pathname, const CFileInfo& UNUSED(fileInfo), const uintptr_t cbData) +static Status AddToFilenames(const VfsPath& pathname, const CFileInfo& /*fileInfo*/, const uintptr_t cbData) { std::vector& filenames = *(std::vector*)cbData; filenames.push_back(pathname.string().c_str()); diff --git a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp index cf5ab36459..0441eea938 100644 --- a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.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 @@ -356,7 +356,7 @@ BEGIN_COMMAND(SetObjectSettings) } private: - void Set(player_id_t player, const std::set& UNUSED(selections)) + void Set(player_id_t player, const std::set& /*selections*/) { AtlasView* view = AtlasView::GetView(msg->view); CSimulation2* simulation = view->GetSimulation2(); diff --git a/source/tools/atlas/GameInterface/MessagePasserImpl.cpp b/source/tools/atlas/GameInterface/MessagePasserImpl.cpp index ff075a9d7d..3daeb2b263 100644 --- a/source/tools/atlas/GameInterface/MessagePasserImpl.cpp +++ b/source/tools/atlas/GameInterface/MessagePasserImpl.cpp @@ -54,7 +54,7 @@ void MessagePasserImpl::Add(IMessage* msg) AtlasMessage::ShareableDelete(msg); } -void MessagePasserImpl::Query(QueryMessage* msg, void(* UNUSED(timeoutCallback) )()) +void MessagePasserImpl::Query(QueryMessage* msg, void(* /*timeoutCallback*/ )()) { ENSURE(msg); ENSURE(msg->GetType() == IMessage::Query); diff --git a/source/tools/atlas/GameInterface/View.cpp b/source/tools/atlas/GameInterface/View.cpp index 70bce6022d..2c73f0a797 100644 --- a/source/tools/atlas/GameInterface/View.cpp +++ b/source/tools/atlas/GameInterface/View.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 @@ -53,19 +53,19 @@ extern int g_xres, g_yres; ////////////////////////////////////////////////////////////////////////// -void AtlasView::SetParam(const std::wstring& UNUSED(name), bool UNUSED(value)) +void AtlasView::SetParam(const std::wstring& /*name*/, bool /*value*/) { } -void AtlasView::SetParam(const std::wstring& UNUSED(name), const AtlasMessage::Color& UNUSED(value)) +void AtlasView::SetParam(const std::wstring& /*name*/, const AtlasMessage::Color& /*value*/) { } -void AtlasView::SetParam(const std::wstring& UNUSED(name), const std::wstring& UNUSED(value)) +void AtlasView::SetParam(const std::wstring& /*name*/, const std::wstring& /*value*/) { } -void AtlasView::SetParam(const std::wstring& UNUSED(name), int UNUSED(value)) +void AtlasView::SetParam(const std::wstring& /*name*/, int /*value*/) { } @@ -165,7 +165,7 @@ void AtlasViewActor::SetParam(const std::wstring& name, int value) m_ActorViewer->SetPropPointsMode(value); } -void AtlasViewActor::SetParam(const std::wstring& UNUSED(name), const AtlasMessage::Color& UNUSED(value)) +void AtlasViewActor::SetParam(const std::wstring& /*name*/, const AtlasMessage::Color& /*value*/) { } diff --git a/source/tools/atlas/GameInterface/View.h b/source/tools/atlas/GameInterface/View.h index 455da88fb3..27fa603960 100644 --- a/source/tools/atlas/GameInterface/View.h +++ b/source/tools/atlas/GameInterface/View.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 @@ -40,19 +40,19 @@ class AtlasView { public: virtual ~AtlasView(); - virtual void Update(float UNUSED(realFrameLength)) { }; + virtual void Update(float /*realFrameLength*/) { }; virtual void Render() { }; virtual void DrawCinemaPathTool() { }; - virtual void DrawOverlays(CCanvas2D& UNUSED(canvas)) { }; + virtual void DrawOverlays(CCanvas2D& /*canvas*/) { }; virtual CCamera& GetCamera() = 0; virtual CSimulation2* GetSimulation2() { return NULL; } virtual entity_id_t GetEntityId(AtlasMessage::ObjectID obj) { return (entity_id_t)obj; } virtual bool WantsHighFramerate() { return false; } - virtual void SetEnabled(bool UNUSED(enabled)) {} + virtual void SetEnabled(bool /*enabled*/) {} virtual void SetParam(const std::wstring& name, bool value); virtual void SetParam(const std::wstring& name, int value); - virtual void SetParam(const std::wstring& UNUSED(name), float UNUSED(value)) {} + virtual void SetParam(const std::wstring& /*name*/, float /*value*/) {} virtual void SetParam(const std::wstring& name, const AtlasMessage::Color& value); virtual void SetParam(const std::wstring& name, const std::wstring& value);