From b64a07ccae38d32aae69afe74e2018ee9eaff61a Mon Sep 17 00:00:00 2001 From: TheLastRar Date: Sun, 21 Apr 2024 16:43:29 +0100 Subject: [PATCH] DEV9: Add const to variables in TCP session --- pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_In.cpp | 2 +- pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_Out.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_In.cpp b/pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_In.cpp index b6b857b184b9d..ff0b712a6b912 100644 --- a/pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_In.cpp +++ b/pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_In.cpp @@ -141,7 +141,7 @@ namespace Sessions // Server closed the Socket if (recived == 0) { - int result = shutdown(client, SD_RECEIVE); + const int result = shutdown(client, SD_RECEIVE); if (result == SOCKET_ERROR) Console.Error("DEV9: TCP: Shutdown SD_RECEIVE error: %d", #ifdef _WIN32 diff --git a/pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_Out.cpp b/pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_Out.cpp index 7316eddd7fb91..e0fcf6222fd09 100644 --- a/pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_Out.cpp +++ b/pcsx2/DEV9/Sessions/TCP_Session/TCP_Session_Out.cpp @@ -335,7 +335,7 @@ namespace Sessions PayloadPtr* payload = static_cast(tcp->GetPayload()); while (sent != payload->GetLength()) { - int ret = send(client, reinterpret_cast(&payload->data[sent]), payload->GetLength() - sent, 0); + const int ret = send(client, reinterpret_cast(&payload->data[sent]), payload->GetLength() - sent, 0); if (ret == SOCKET_ERROR) { @@ -475,7 +475,7 @@ namespace Sessions } bool TCP_Session::ValidateEmptyPacket(TCP_Packet* tcp, bool ignoreOld) { - NumCheckResult ResultFIN = CheckNumbers(tcp, !ignoreOld); + const NumCheckResult ResultFIN = CheckNumbers(tcp, !ignoreOld); if (ResultFIN == NumCheckResult::Bad) { CloseByRemoteRST(); @@ -578,7 +578,7 @@ namespace Sessions receivedPS2SeqNumbers.push_back(expectedSeqNumber); expectedSeqNumber += 1; - int result = shutdown(client, SD_SEND); + const int result = shutdown(client, SD_SEND); if (result == SOCKET_ERROR) Console.Error("DEV9: TCP: Shutdown SD_SEND error: %d", #ifdef _WIN32