From 431a9c00a56cf4c603be1cf5f773b193621d8150 Mon Sep 17 00:00:00 2001 From: Kai Blaschke Date: Mon, 19 Feb 2024 16:55:19 +0100 Subject: Fixed a huge amount of Clang warnings On Linux and macOS, using Clang to compile OpenStarbound produces about 400 MB worth of warnings during the build, making the compiler output unreadable and slowing the build down considerably. 99% of the warnings were unqualified uses of std::move and std::forward, which are now all properly qualified. Fixed a few other minor warnings about non-virtual destructors and some uses of std::move preventing copy elision on temporary objects. Most remaining warnings are now unused parameters. --- source/game/scripting/StarLuaComponents.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/game/scripting/StarLuaComponents.hpp') diff --git a/source/game/scripting/StarLuaComponents.hpp b/source/game/scripting/StarLuaComponents.hpp index e739912..98e3638 100644 --- a/source/game/scripting/StarLuaComponents.hpp +++ b/source/game/scripting/StarLuaComponents.hpp @@ -191,7 +191,7 @@ Maybe LuaBaseComponent::invoke(String const& name, V&&... args) { auto method = m_context->getPath(name); if (method == LuaNil) return {}; - return m_context->luaTo(move(method)).invoke(forward(args)...); + return m_context->luaTo(std::move(method)).invoke(std::forward(args)...); } catch (LuaException const& e) { Logger::error("Exception while invoking lua function '{}'. {}", name, outputException(e, true)); setError(printException(e, false)); @@ -223,15 +223,15 @@ JsonObject LuaStorableComponent::getScriptStorage() const { template void LuaStorableComponent::setScriptStorage(JsonObject storage) { if (Base::initialized()) - Base::context()->setPath("storage", move(storage)); + Base::context()->setPath("storage", std::move(storage)); else - m_storage = move(storage); + m_storage = std::move(storage); } template void LuaStorableComponent::contextSetup() { Base::contextSetup(); - Base::context()->setPath("storage", move(m_storage)); + Base::context()->setPath("storage", std::move(m_storage)); } template @@ -253,7 +253,7 @@ LuaUpdatableComponent::LuaUpdatableComponent() { }); m_lastDt = GlobalTimestep * GlobalTimescale; - Base::addCallbacks("script", move(scriptCallbacks)); + Base::addCallbacks("script", std::move(scriptCallbacks)); } template @@ -289,7 +289,7 @@ Maybe LuaUpdatableComponent::update(V&&... args) { if (!m_updatePeriodic.tick()) return {}; - return Base::template invoke("update", forward(args)...); + return Base::template invoke("update", std::forward(args)...); } template @@ -332,7 +332,7 @@ LuaMessageHandlingComponent::LuaMessageHandlingComponent() { m_messageHandlers.remove(handlerInfo.name); }); - Base::addCallbacks("message", move(scriptCallbacks)); + Base::addCallbacks("message", std::move(scriptCallbacks)); } template -- cgit v1.2.3