diff options
author | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
---|---|---|
committer | Kai Blaschke <kai.blaschke@kb-dev.net> | 2024-02-19 16:55:19 +0100 |
commit | 431a9c00a56cf4c603be1cf5f773b193621d8150 (patch) | |
tree | 95843aeea9fb6dc18279ee05ff6961f40b19798f /source/game/scripting/StarLuaComponents.hpp | |
parent | 30e1871d3f44629e00a1f66d8164e3e62c7f889f (diff) |
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.
Diffstat (limited to 'source/game/scripting/StarLuaComponents.hpp')
-rw-r--r-- | source/game/scripting/StarLuaComponents.hpp | 14 |
1 files changed, 7 insertions, 7 deletions
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<Ret> LuaBaseComponent::invoke(String const& name, V&&... args) { auto method = m_context->getPath(name); if (method == LuaNil) return {}; - return m_context->luaTo<LuaFunction>(move(method)).invoke<Ret>(forward<V>(args)...); + return m_context->luaTo<LuaFunction>(std::move(method)).invoke<Ret>(std::forward<V>(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<Base>::getScriptStorage() const { template <typename Base> void LuaStorableComponent<Base>::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 <typename Base> void LuaStorableComponent<Base>::contextSetup() { Base::contextSetup(); - Base::context()->setPath("storage", move(m_storage)); + Base::context()->setPath("storage", std::move(m_storage)); } template <typename Base> @@ -253,7 +253,7 @@ LuaUpdatableComponent<Base>::LuaUpdatableComponent() { }); m_lastDt = GlobalTimestep * GlobalTimescale; - Base::addCallbacks("script", move(scriptCallbacks)); + Base::addCallbacks("script", std::move(scriptCallbacks)); } template <typename Base> @@ -289,7 +289,7 @@ Maybe<Ret> LuaUpdatableComponent<Base>::update(V&&... args) { if (!m_updatePeriodic.tick()) return {}; - return Base::template invoke<Ret>("update", forward<V>(args)...); + return Base::template invoke<Ret>("update", std::forward<V>(args)...); } template <typename Base> @@ -332,7 +332,7 @@ LuaMessageHandlingComponent<Base>::LuaMessageHandlingComponent() { m_messageHandlers.remove(handlerInfo.name); }); - Base::addCallbacks("message", move(scriptCallbacks)); + Base::addCallbacks("message", std::move(scriptCallbacks)); } template <typename Base> |