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/StarWorldLuaBindings.cpp | 30 +++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'source/game/scripting/StarWorldLuaBindings.cpp') diff --git a/source/game/scripting/StarWorldLuaBindings.cpp b/source/game/scripting/StarWorldLuaBindings.cpp index 1a21bad..7d74a98 100644 --- a/source/game/scripting/StarWorldLuaBindings.cpp +++ b/source/game/scripting/StarWorldLuaBindings.cpp @@ -449,7 +449,7 @@ namespace LuaBindings { auto distributions = distributionConfigs.transformed([](Json const& config) { return BiomeItemDistribution(config, Random::randu64()); }); - return serverWorld->enqueuePlacement(move(distributions), id); + return serverWorld->enqueuePlacement(std::move(distributions), id); }); } @@ -1069,7 +1069,7 @@ namespace LuaBindings { Vec2F const& end, ActorMovementParameters actorMovementParameters, PlatformerAStar::Parameters searchParameters) { - PlatformerAStar::PathFinder pathFinder(world, start, end, move(actorMovementParameters), move(searchParameters)); + PlatformerAStar::PathFinder pathFinder(world, start, end, std::move(actorMovementParameters), std::move(searchParameters)); pathFinder.explore({}); return pathFinder.result(); } @@ -1079,7 +1079,7 @@ namespace LuaBindings { Vec2F const& end, ActorMovementParameters actorMovementParameters, PlatformerAStar::Parameters searchParameters) { - return PlatformerAStar::PathFinder(world, start, end, move(actorMovementParameters), move(searchParameters)); + return PlatformerAStar::PathFinder(world, start, end, std::move(actorMovementParameters), std::move(searchParameters)); } RectI ClientWorldCallbacks::clientWindow(WorldClient* world) { @@ -1205,15 +1205,15 @@ namespace LuaBindings { } LuaTable WorldEntityCallbacks::entityQuery(World* world, LuaEngine& engine, Vec2F const& pos1, LuaValue const& pos2, Maybe options) { - return LuaBindings::entityQuery(world, engine, pos1, pos2, move(options)); + return LuaBindings::entityQuery(world, engine, pos1, pos2, std::move(options)); } LuaTable WorldEntityCallbacks::monsterQuery(World* world, LuaEngine& engine, Vec2F const& pos1, LuaValue const& pos2, Maybe options) { - return LuaBindings::entityQuery(world, engine, pos1, pos2, move(options)); + return LuaBindings::entityQuery(world, engine, pos1, pos2, std::move(options)); } LuaTable WorldEntityCallbacks::npcQuery(World* world, LuaEngine& engine, Vec2F const& pos1, LuaValue const& pos2, Maybe options) { - return LuaBindings::entityQuery(world, engine, pos1, pos2, move(options)); + return LuaBindings::entityQuery(world, engine, pos1, pos2, std::move(options)); } LuaTable WorldEntityCallbacks::objectQuery(World* world, LuaEngine& engine, Vec2F const& pos1, LuaValue const& pos2, Maybe options) { @@ -1225,18 +1225,18 @@ namespace LuaBindings { engine, pos1, pos2, - move(options), + std::move(options), [&objectName](shared_ptr const& entity) -> bool { return objectName.empty() || entity->name() == objectName; }); } LuaTable WorldEntityCallbacks::itemDropQuery(World* world, LuaEngine& engine, Vec2F const& pos1, LuaValue const& pos2, Maybe options) { - return LuaBindings::entityQuery(world, engine, pos1, pos2, move(options)); + return LuaBindings::entityQuery(world, engine, pos1, pos2, std::move(options)); } LuaTable WorldEntityCallbacks::playerQuery(World* world, LuaEngine& engine, Vec2F const& pos1, LuaValue const& pos2, Maybe options) { - return LuaBindings::entityQuery(world, engine, pos1, pos2, move(options)); + return LuaBindings::entityQuery(world, engine, pos1, pos2, std::move(options)); } LuaTable WorldEntityCallbacks::loungeableQuery(World* world, LuaEngine& engine, Vec2F const& pos1, LuaValue const& pos2, Maybe options) { @@ -1267,19 +1267,19 @@ namespace LuaBindings { return pos && pos->orientation == orientation; }; - return LuaBindings::entityQuery(world, engine, pos1, pos2, move(options), filter); + return LuaBindings::entityQuery(world, engine, pos1, pos2, std::move(options), filter); } LuaTable WorldEntityCallbacks::entityLineQuery(World* world, LuaEngine& engine, Vec2F const& point1, Vec2F const& point2, Maybe options) { - return LuaBindings::entityLineQuery(world, engine, point1, point2, move(options)); + return LuaBindings::entityLineQuery(world, engine, point1, point2, std::move(options)); } LuaTable WorldEntityCallbacks::objectLineQuery(World* world, LuaEngine& engine, Vec2F const& point1, Vec2F const& point2, Maybe options) { - return LuaBindings::entityLineQuery(world, engine, point1, point2, move(options)); + return LuaBindings::entityLineQuery(world, engine, point1, point2, std::move(options)); } LuaTable WorldEntityCallbacks::npcLineQuery(World* world, LuaEngine& engine, Vec2F const& point1, Vec2F const& point2, Maybe options) { - return LuaBindings::entityLineQuery(world, engine, point1, point2, move(options)); + return LuaBindings::entityLineQuery(world, engine, point1, point2, std::move(options)); } bool WorldEntityCallbacks::entityExists(World* world, EntityId entityId) { @@ -1744,9 +1744,9 @@ namespace LuaBindings { RpcPromise WorldEntityCallbacks::sendEntityMessage(World* world, LuaEngine& engine, LuaValue entityId, String const& message, LuaVariadic args) { if (entityId.is()) - return world->sendEntityMessage(engine.luaTo(entityId), message, JsonArray::from(move(args))); + return world->sendEntityMessage(engine.luaTo(entityId), message, JsonArray::from(std::move(args))); else - return world->sendEntityMessage(engine.luaTo(entityId), message, JsonArray::from(move(args))); + return world->sendEntityMessage(engine.luaTo(entityId), message, JsonArray::from(std::move(args))); } Maybe WorldEntityCallbacks::loungeableOccupied(World* world, EntityId entityId) { -- cgit v1.2.3