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/StarWorldServerThread.cpp | |
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/StarWorldServerThread.cpp')
-rw-r--r-- | source/game/StarWorldServerThread.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
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<PacketPtr> 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<ConnectionId> WorldServerThread::erroredClients() const { void WorldServerThread::pushIncomingPackets(ConnectionId clientId, List<PacketPtr> packets) { RecursiveMutexLocker queueLocker(m_queueMutex); - m_incomingPacketQueue[clientId].appendAll(move(packets)); + m_incomingPacketQueue[clientId].appendAll(std::move(packets)); } List<PacketPtr> WorldServerThread::pullOutgoingPackets(ConnectionId clientId) { @@ -178,7 +178,7 @@ void WorldServerThread::setUpdateAction(WorldServerAction updateAction) { void WorldServerThread::passMessages(List<Message>&& 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<Message> 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(); |