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/test/universe_connection_test.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'source/test/universe_connection_test.cpp') diff --git a/source/test/universe_connection_test.cpp b/source/test/universe_connection_test.cpp index 649b7d2..c5ae0f6 100644 --- a/source/test/universe_connection_test.cpp +++ b/source/test/universe_connection_test.cpp @@ -19,7 +19,7 @@ unsigned const SyncWaitMillis = 10000; class ASyncClientThread : public Thread { public: ASyncClientThread(UniverseConnection conn) - : Thread("UniverseConnectionTestClientThread"), m_connection(move(conn)) { + : Thread("UniverseConnectionTestClientThread"), m_connection(std::move(conn)) { start(); } @@ -66,7 +66,7 @@ private: class SyncClientThread : public Thread { public: SyncClientThread(UniverseConnection conn) - : Thread("UniverseConnectionTestClientThread"), m_connection(move(conn)) { + : Thread("UniverseConnectionTestClientThread"), m_connection(std::move(conn)) { start(); } @@ -104,36 +104,36 @@ TEST(UniverseConnections, All) { TcpServer tcpServer(HostAddressWithPort(HostAddress::localhost(), ServerPort)); tcpServer.setAcceptCallback([&server, &clientId](TcpSocketPtr socket) { socket->setNonBlocking(true); - auto conn = UniverseConnection(TcpPacketSocket::open(move(socket))); - server.addConnection(++clientId, move(conn)); + auto conn = UniverseConnection(TcpPacketSocket::open(std::move(socket))); + server.addConnection(++clientId, std::move(conn)); }); LinkedList localASyncClients; for (unsigned i = 0; i < NumLocalASyncConnections; ++i) { auto pair = LocalPacketSocket::openPair(); - server.addConnection(++clientId, UniverseConnection(move(pair.first))); - localASyncClients.emplaceAppend(UniverseConnection(move(pair.second))); + server.addConnection(++clientId, UniverseConnection(std::move(pair.first))); + localASyncClients.emplaceAppend(UniverseConnection(std::move(pair.second))); } LinkedList localSyncClients; for (unsigned i = 0; i < NumLocalSyncConnections; ++i) { auto pair = LocalPacketSocket::openPair(); - server.addConnection(++clientId, UniverseConnection(move(pair.first))); - localSyncClients.emplaceAppend(UniverseConnection(move(pair.second))); + server.addConnection(++clientId, UniverseConnection(std::move(pair.first))); + localSyncClients.emplaceAppend(UniverseConnection(std::move(pair.second))); } LinkedList remoteASyncClients; for (unsigned i = 0; i < NumRemoteASyncConnections; ++i) { auto socket = TcpSocket::connectTo({HostAddress::localhost(), ServerPort}); socket->setNonBlocking(true); - remoteASyncClients.emplaceAppend(UniverseConnection(TcpPacketSocket::open(move(socket)))); + remoteASyncClients.emplaceAppend(UniverseConnection(TcpPacketSocket::open(std::move(socket)))); } LinkedList remoteSyncClients; for (unsigned i = 0; i < NumRemoteSyncConnections; ++i) { auto socket = TcpSocket::connectTo({HostAddress::localhost(), ServerPort}); socket->setNonBlocking(true); - remoteSyncClients.emplaceAppend(UniverseConnection(TcpPacketSocket::open(move(socket)))); + remoteSyncClients.emplaceAppend(UniverseConnection(TcpPacketSocket::open(std::move(socket)))); } for (auto& c : localASyncClients) -- cgit v1.2.3