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/StarWorldServerThread.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source/game/StarWorldServerThread.cpp') diff --git a/source/game/StarWorldServerThread.cpp b/source/game/StarWorldServerThread.cpp index 35d6225..c03c938 100644 --- a/source/game/StarWorldServerThread.cpp +++ b/source/game/StarWorldServerThread.cpp @@ -10,8 +10,8 @@ namespace Star { WorldServerThread::WorldServerThread(WorldServerPtr server, WorldId worldId) : Thread("WorldServerThread: " + printWorldId(worldId)), - m_worldServer(move(server)), - m_worldId(move(worldId)), + m_worldServer(std::move(server)), + m_worldId(std::move(worldId)), m_stop(false), m_errorOccurred(false), m_shouldExpire(true) { @@ -93,7 +93,7 @@ List WorldServerThread::removeClient(ConnectionId clientId) { try { auto incomingPackets = take(m_incomingPacketQueue[clientId]); if (m_worldServer->hasClient(clientId)) - m_worldServer->handleIncomingPackets(clientId, move(incomingPackets)); + m_worldServer->handleIncomingPackets(clientId, std::move(incomingPackets)); outgoingPackets = take(m_outgoingPacketQueue[clientId]); if (m_worldServer->hasClient(clientId)) @@ -134,7 +134,7 @@ List WorldServerThread::erroredClients() const { void WorldServerThread::pushIncomingPackets(ConnectionId clientId, List packets) { RecursiveMutexLocker queueLocker(m_queueMutex); - m_incomingPacketQueue[clientId].appendAll(move(packets)); + m_incomingPacketQueue[clientId].appendAll(std::move(packets)); } List WorldServerThread::pullOutgoingPackets(ConnectionId clientId) { @@ -178,7 +178,7 @@ void WorldServerThread::setUpdateAction(WorldServerAction updateAction) { void WorldServerThread::passMessages(List&& messages) { RecursiveMutexLocker locker(m_messageMutex); - m_messages.appendAll(move(messages)); + m_messages.appendAll(std::move(messages)); } WorldChunks WorldServerThread::readChunks() { @@ -257,7 +257,7 @@ void WorldServerThread::update(WorldServerFidelity fidelity) { auto incomingPackets = take(m_incomingPacketQueue[clientId]); queueLocker.unlock(); try { - m_worldServer->handleIncomingPackets(clientId, move(incomingPackets)); + m_worldServer->handleIncomingPackets(clientId, std::move(incomingPackets)); } catch (std::exception const& e) { Logger::error("WorldServerThread exception caught handling incoming packets for client {}: {}", clientId, outputException(e, true)); @@ -275,7 +275,7 @@ void WorldServerThread::update(WorldServerFidelity fidelity) { List messages; { RecursiveMutexLocker locker(m_messageMutex); - messages = move(m_messages); + messages = std::move(m_messages); } for (auto& message : messages) { if (auto resp = m_worldServer->receiveMessage(ServerConnectionId, message.message, message.args)) @@ -287,7 +287,7 @@ void WorldServerThread::update(WorldServerFidelity fidelity) { for (auto& clientId : unerroredClientIds) { auto outgoingPackets = m_worldServer->getOutgoingPackets(clientId); RecursiveMutexLocker queueLocker(m_queueMutex); - m_outgoingPacketQueue[clientId].appendAll(move(outgoingPackets)); + m_outgoingPacketQueue[clientId].appendAll(std::move(outgoingPackets)); } m_shouldExpire = m_worldServer->shouldExpire(); -- cgit v1.2.3