From 11561184e6b8b5b9442fb63c31259be31d5b2fbe Mon Sep 17 00:00:00 2001 From: Kelsi Date: Tue, 31 Mar 2026 00:48:03 -0700 Subject: [PATCH] fix: silence all -Wunused-parameter warnings in entity_controller Suppress 9 unused parameter warnings in IObjectTypeHandler interface methods and their overrides by commenting out parameter names: - Base class: onCreate/onValuesUpdate/onMovementUpdate default empty implementations (parameters intentionally unused in base) - ItemTypeHandler::onCreate: entity param forwarded only to onCreateItem which doesn't need it - CorpseTypeHandler::onCreate: entity param not needed for corpse spawn Build now produces zero warnings (excluding third-party stb headers). --- include/game/entity_controller.hpp | 8 ++++---- src/game/entity_controller.cpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/game/entity_controller.hpp b/include/game/entity_controller.hpp index ee63504c..1a8d1f7b 100644 --- a/include/game/entity_controller.hpp +++ b/include/game/entity_controller.hpp @@ -236,10 +236,10 @@ private: // Allows extending object-type handling without modifying handler dispatch. struct IObjectTypeHandler { virtual ~IObjectTypeHandler() = default; - virtual void onCreate(const UpdateBlock& block, std::shared_ptr& entity, - bool& newItemCreated) {} - virtual void onValuesUpdate(const UpdateBlock& block, std::shared_ptr& entity) {} - virtual void onMovementUpdate(const UpdateBlock& block, std::shared_ptr& entity) {} + virtual void onCreate(const UpdateBlock& /*block*/, std::shared_ptr& /*entity*/, + bool& /*newItemCreated*/) {} + virtual void onValuesUpdate(const UpdateBlock& /*block*/, std::shared_ptr& /*entity*/) {} + virtual void onMovementUpdate(const UpdateBlock& /*block*/, std::shared_ptr& /*entity*/) {} }; struct UnitTypeHandler; struct PlayerTypeHandler; diff --git a/src/game/entity_controller.cpp b/src/game/entity_controller.cpp index 6f74f46e..6a9cc826 100644 --- a/src/game/entity_controller.cpp +++ b/src/game/entity_controller.cpp @@ -1266,14 +1266,14 @@ struct EntityController::GameObjectTypeHandler : EntityController::IObjectTypeHa struct EntityController::ItemTypeHandler : EntityController::IObjectTypeHandler { EntityController& ctl_; explicit ItemTypeHandler(EntityController& c) : ctl_(c) {} - void onCreate(const UpdateBlock& block, std::shared_ptr& entity, bool& newItemCreated) override { ctl_.onCreateItem(block, newItemCreated); } + void onCreate(const UpdateBlock& block, std::shared_ptr& /*entity*/, bool& newItemCreated) override { ctl_.onCreateItem(block, newItemCreated); } void onValuesUpdate(const UpdateBlock& block, std::shared_ptr& entity) override { ctl_.onValuesUpdateItem(block, entity); } }; struct EntityController::CorpseTypeHandler : EntityController::IObjectTypeHandler { EntityController& ctl_; explicit CorpseTypeHandler(EntityController& c) : ctl_(c) {} - void onCreate(const UpdateBlock& block, std::shared_ptr& entity, bool&) override { ctl_.onCreateCorpse(block); } + void onCreate(const UpdateBlock& block, std::shared_ptr& /*entity*/, bool&) override { ctl_.onCreateCorpse(block); } }; // ============================================================