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/StarCelestialDatabase.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/game/StarCelestialDatabase.cpp') diff --git a/source/game/StarCelestialDatabase.cpp b/source/game/StarCelestialDatabase.cpp index dd0bc51..c1b9a7f 100644 --- a/source/game/StarCelestialDatabase.cpp +++ b/source/game/StarCelestialDatabase.cpp @@ -160,11 +160,11 @@ CelestialResponse CelestialMasterDatabase::respondToRequest(CelestialRequest con auto chunk = getChunk(*chunkLocation); // System objects are sent by separate system requests. chunk.systemObjects.clear(); - return makeLeft(move(chunk)); + return makeLeft(std::move(chunk)); } else if (auto systemLocation = request.maybeRight()) { auto const& chunk = getChunk(chunkIndexFor(*systemLocation)); CelestialSystemObjects systemObjects = {*systemLocation, chunk.systemObjects.get(*systemLocation)}; - return makeRight(move(systemObjects)); + return makeRight(std::move(systemObjects)); } else { return CelestialResponse(); } @@ -435,7 +435,7 @@ CelestialChunk CelestialMasterDatabase::produceChunk(Vec2I const& chunkIndex) co for (auto const& systemLocation : systemLocations) { if (auto systemInformation = produceSystem(random, systemLocation)) { chunkData.systemParameters[systemLocation] = systemInformation.get().first; - chunkData.systemObjects[systemLocation] = move(systemInformation.get().second); + chunkData.systemObjects[systemLocation] = std::move(systemInformation.get().second); if (systemInformation.get().first.getParameter("magnitude").toFloat() >= m_generationInformation.minimumConstellationMagnitude) @@ -527,11 +527,11 @@ Maybe>> CelestialMasterD } } - systemObjects[planetPair.first] = move(planet); + systemObjects[planetPair.first] = std::move(planet); } } - return pair>{move(systemParameters), move(systemObjects)}; + return pair>{std::move(systemParameters), std::move(systemObjects)}; } List CelestialMasterDatabase::produceConstellations( @@ -619,7 +619,7 @@ List CelestialMasterDatabase::produceConstellations( CelestialSlaveDatabase::CelestialSlaveDatabase(CelestialBaseInformation baseInformation) { auto config = Root::singleton().assets()->json("/celestial.config"); - m_baseInformation = move(baseInformation); + m_baseInformation = std::move(baseInformation); m_requestTimeout = config.getFloat("requestTimeout"); } @@ -679,12 +679,12 @@ void CelestialSlaveDatabase::pushResponses(List responses) { for (auto& response : responses) { if (auto celestialChunk = response.leftPtr()) { m_pendingChunkRequests.remove(celestialChunk->chunkIndex); - m_chunkCache.set(celestialChunk->chunkIndex, move(*celestialChunk)); + m_chunkCache.set(celestialChunk->chunkIndex, std::move(*celestialChunk)); } else if (auto celestialSystemObjects = response.rightPtr()) { m_pendingSystemRequests.remove(celestialSystemObjects->systemLocation); auto chunkLocation = chunkIndexFor(celestialSystemObjects->systemLocation); if (auto chunk = m_chunkCache.ptr(chunkLocation)) - chunk->systemObjects[celestialSystemObjects->systemLocation] = move(celestialSystemObjects->planets); + chunk->systemObjects[celestialSystemObjects->systemLocation] = std::move(celestialSystemObjects->planets); } } } -- cgit v1.2.3