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/application/StarP2PNetworkingService_pc.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/application/StarP2PNetworkingService_pc.cpp')
-rw-r--r-- | source/application/StarP2PNetworkingService_pc.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/application/StarP2PNetworkingService_pc.cpp b/source/application/StarP2PNetworkingService_pc.cpp index 0170eb0..f13bb62 100644 --- a/source/application/StarP2PNetworkingService_pc.cpp +++ b/source/application/StarP2PNetworkingService_pc.cpp @@ -19,9 +19,9 @@ PcP2PNetworkingService::PcP2PNetworkingService(PcPlatformServicesStatePtr state) : m_callbackConnectionFailure(this, &PcP2PNetworkingService::steamOnConnectionFailure), m_callbackJoinRequested(this, &PcP2PNetworkingService::steamOnJoinRequested), m_callbackSessionRequest(this, &PcP2PNetworkingService::steamOnSessionRequest), - m_state(move(state)) { + m_state(std::move(state)) { #else - : m_state(move(state)) { + : m_state(std::move(state)) { #endif #ifdef STAR_ENABLE_DISCORD_INTEGRATION @@ -224,7 +224,7 @@ Either<String, P2PSocketUPtr> PcP2PNetworkingService::connectToPeer(P2PNetworkin if (type == "discord") { auto remoteUserId = lexicalCast<discord::UserId>(peerId.extract("_")); auto lobbyId = lexicalCast<discord::LobbyId>(peerId.extract("_")); - String lobbySecret = move(peerId); + String lobbySecret = std::move(peerId); return makeRight(discordConnectRemote(remoteUserId, lobbyId, lobbySecret)); } } @@ -242,7 +242,7 @@ void PcP2PNetworkingService::addPendingJoin(String connectionString) { if (connectionString.extract(":") != "connect") throw ApplicationException::format("malformed connection string '{}'", connectionString); - String target = move(connectionString); + String target = std::move(connectionString); String targetType = target.extract("_"); if (targetType == "address") @@ -357,7 +357,7 @@ void PcP2PNetworkingService::steamReceiveAll() { SteamNetworking()->ReadP2PPacket(data.ptr(), messageSize, &messageSize, &messageRemoteUser); if (auto openSocket = m_steamOpenSockets.value(messageRemoteUser.ConvertToUint64())) { MutexLocker socketLocker(openSocket->mutex); - openSocket->incoming.append(move(data)); + openSocket->incoming.append(std::move(data)); } } } @@ -474,7 +474,7 @@ P2PSocketUPtr PcP2PNetworkingService::discordConnectRemote(discord::UserId remot } }); - return unique_ptr<P2PSocket>(move(socket)); + return unique_ptr<P2PSocket>(std::move(socket)); } void PcP2PNetworkingService::discordOnReceiveMessage(discord::LobbyId lobbyId, discord::UserId userId, discord::NetworkChannelId channel, uint8_t* data, uint32_t size) { @@ -507,7 +507,7 @@ void PcP2PNetworkingService::discordOnLobbyMemberConnect(discord::LobbyId lobbyI socket->mode = DiscordSocketMode::Connected; m_discordOpenSockets[userId] = socket.get(); - m_pendingIncomingConnections.append(move(socket)); + m_pendingIncomingConnections.append(std::move(socket)); Logger::info("Accepted new discord connection from remote user {}", userId); } } |