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/application/StarP2PNetworkingService_pc.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/application/StarP2PNetworkingService_pc.cpp') 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 PcP2PNetworkingService::connectToPeer(P2PNetworkin if (type == "discord") { auto remoteUserId = lexicalCast(peerId.extract("_")); auto lobbyId = lexicalCast(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(move(socket)); + return unique_ptr(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); } } -- cgit v1.2.3