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/StarNetPacketSocket.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/StarNetPacketSocket.cpp')
-rw-r--r-- | source/game/StarNetPacketSocket.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/game/StarNetPacketSocket.cpp b/source/game/StarNetPacketSocket.cpp index e2bd629..48b2082 100644 --- a/source/game/StarNetPacketSocket.cpp +++ b/source/game/StarNetPacketSocket.cpp @@ -96,7 +96,7 @@ void LocalPacketSocket::sendPackets(List<PacketPtr> packets) { } #endif - outgoingPipe->queue.appendAll(move(packets)); + outgoingPipe->queue.appendAll(std::move(packets)); } } @@ -120,12 +120,12 @@ bool LocalPacketSocket::readData() { } LocalPacketSocket::LocalPacketSocket(shared_ptr<Pipe> incomingPipe, weak_ptr<Pipe> outgoingPipe) - : m_incomingPipe(move(incomingPipe)), m_outgoingPipe(move(outgoingPipe)) {} + : m_incomingPipe(std::move(incomingPipe)), m_outgoingPipe(std::move(outgoingPipe)) {} TcpPacketSocketUPtr TcpPacketSocket::open(TcpSocketPtr socket) { socket->setNoDelay(true); socket->setNonBlocking(true); - return TcpPacketSocketUPtr(new TcpPacketSocket(move(socket))); + return TcpPacketSocketUPtr(new TcpPacketSocket(std::move(socket))); } bool TcpPacketSocket::isOpen() const { @@ -217,7 +217,7 @@ List<PacketPtr> TcpPacketSocket::receivePackets() { m_incomingStats.mix(packetType, packetSize); - DataStreamBuffer packetStream(move(packetBytes)); + DataStreamBuffer packetStream(std::move(packetBytes)); do { PacketPtr packet = createPacket(packetType); packet->setCompressionMode(packetCompressed ? PacketCompressionMode::Enabled : PacketCompressionMode::Disabled); @@ -225,7 +225,7 @@ List<PacketPtr> TcpPacketSocket::receivePackets() { packet->readLegacy(packetStream); else packet->read(packetStream); - packets.append(move(packet)); + packets.append(std::move(packet)); } while (!packetStream.atEnd()); m_inputBuffer = ds.readBytes(ds.size() - ds.pos()); @@ -296,10 +296,10 @@ Maybe<PacketStats> TcpPacketSocket::outgoingStats() const { } TcpPacketSocket::TcpPacketSocket(TcpSocketPtr socket) - : m_socket(move(socket)) {} + : m_socket(std::move(socket)) {} P2PPacketSocketUPtr P2PPacketSocket::open(P2PSocketUPtr socket) { - return P2PPacketSocketUPtr(new P2PPacketSocket(move(socket))); + return P2PPacketSocketUPtr(new P2PPacketSocket(std::move(socket))); } bool P2PPacketSocket::isOpen() const { @@ -357,7 +357,7 @@ List<PacketPtr> P2PPacketSocket::receivePackets() { List<PacketPtr> packets; try { for (auto& inputMessage : take(m_inputMessages)) { - DataStreamBuffer ds(move(inputMessage)); + DataStreamBuffer ds(std::move(inputMessage)); PacketType packetType = ds.read<PacketType>(); bool packetCompressed = ds.read<bool>(); @@ -369,7 +369,7 @@ List<PacketPtr> P2PPacketSocket::receivePackets() { m_incomingStats.mix(packetType, packetSize); - DataStreamBuffer packetStream(move(packetBytes)); + DataStreamBuffer packetStream(std::move(packetBytes)); do { PacketPtr packet = createPacket(packetType); packet->setCompressionMode(packetCompressed ? PacketCompressionMode::Enabled : PacketCompressionMode::Disabled); @@ -377,7 +377,7 @@ List<PacketPtr> P2PPacketSocket::receivePackets() { packet->readLegacy(packetStream); else packet->read(packetStream); - packets.append(move(packet)); + packets.append(std::move(packet)); } while (!packetStream.atEnd()); } } catch (IOException const& e) { @@ -430,6 +430,6 @@ Maybe<PacketStats> P2PPacketSocket::outgoingStats() const { } P2PPacketSocket::P2PPacketSocket(P2PSocketPtr socket) - : m_socket(move(socket)) {} + : m_socket(std::move(socket)) {} } |