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/core/StarLua.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'source/core/StarLua.cpp') diff --git a/source/core/StarLua.cpp b/source/core/StarLua.cpp index 49d54f3..84e6c82 100644 --- a/source/core/StarLua.cpp +++ b/source/core/StarLua.cpp @@ -76,7 +76,7 @@ StringMap const& LuaCallbacks::callbacks() const } bool LuaContext::containsPath(String path) const { - return engine().contextGetPath(handleIndex(), move(path)) != LuaNil; + return engine().contextGetPath(handleIndex(), std::move(path)) != LuaNil; } void LuaContext::load(char const* contents, size_t size, char const* name) { @@ -92,7 +92,7 @@ void LuaContext::load(ByteArray const& contents, String const& name) { } void LuaContext::setRequireFunction(RequireFunction requireFunction) { - engine().setContextRequire(handleIndex(), move(requireFunction)); + engine().setContextRequire(handleIndex(), std::move(requireFunction)); } void LuaContext::setCallbacks(String const& tableName, LuaCallbacks const& callbacks) const { @@ -162,11 +162,11 @@ Maybe LuaConverter::to(LuaEngine&, LuaValue const& v) { } LuaValue LuaConverter::from(LuaEngine& engine, JsonObject v) { - return engine.luaFrom(Json(move(v))); + return engine.luaFrom(Json(std::move(v))); } Maybe LuaConverter::to(LuaEngine& engine, LuaValue v) { - auto j = engine.luaTo(move(v)); + auto j = engine.luaTo(std::move(v)); if (j.type() == Json::Type::Object) { return j.toObject(); } else if (j.type() == Json::Type::Array) { @@ -179,11 +179,11 @@ Maybe LuaConverter::to(LuaEngine& engine, LuaValue v) { } LuaValue LuaConverter::from(LuaEngine& engine, JsonArray v) { - return engine.luaFrom(Json(move(v))); + return engine.luaFrom(Json(std::move(v))); } Maybe LuaConverter::to(LuaEngine& engine, LuaValue v) { - auto j = engine.luaTo(move(v)); + auto j = engine.luaTo(std::move(v)); if (j.type() == Json::Type::Array) { return j.toArray(); } else if (j.type() == Json::Type::Object) { @@ -839,7 +839,7 @@ void LuaEngine::tableIterate(int handleIndex, function LuaDetail::tableToJsonContainer(LuaTable const& table) { if (auto i = asInteger(key)) { intEntries[*i] = jsonValue.take(); } else { - auto stringKey = table.engine().luaMaybeTo(move(key)); + auto stringKey = table.engine().luaMaybeTo(std::move(key)); if (!stringKey) { failedConversion = true; return false; @@ -1420,12 +1420,12 @@ Maybe LuaDetail::tableToJsonContainer(LuaTable const& table) { if (interpretAsList) { JsonArray list; for (auto& p : intEntries) - list.set(p.first - 1, move(p.second)); - return Json(move(list)); + list.set(p.first - 1, std::move(p.second)); + return Json(std::move(list)); } else { for (auto& p : intEntries) - stringEntries[toString(p.first)] = move(p.second); - return Json(move(stringEntries)); + stringEntries[toString(p.first)] = std::move(p.second); + return Json(std::move(stringEntries)); } } -- cgit v1.2.3