From 12a7e17a41cdd9c943e39c669251c763648826bc Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sun, 28 Jan 2024 20:59:39 -0800 Subject: [PATCH] fix warnings in windows build --- Source/Core/Core/HW/EXI/BBA/TAPServerBBA.cpp | 2 +- Source/Core/Core/HW/EXI/BBA/TAPServerConnection.cpp | 6 +++--- Source/Core/Core/HW/EXI/EXI_DeviceModem.cpp | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/HW/EXI/BBA/TAPServerBBA.cpp b/Source/Core/Core/HW/EXI/BBA/TAPServerBBA.cpp index f0c0a4ce0b..89d8816910 100644 --- a/Source/Core/Core/HW/EXI/BBA/TAPServerBBA.cpp +++ b/Source/Core/Core/HW/EXI/BBA/TAPServerBBA.cpp @@ -80,7 +80,7 @@ void CEXIETHERNET::TAPServerNetworkInterface::HandleReceivedFrame(std::string&& else { memcpy(m_eth_ref->mRecvBuffer.get(), data.data(), data.size()); - m_eth_ref->mRecvBufferLength = data.size(); + m_eth_ref->mRecvBufferLength = static_cast(data.size()); m_eth_ref->RecvHandlePacket(); } } diff --git a/Source/Core/Core/HW/EXI/BBA/TAPServerConnection.cpp b/Source/Core/Core/HW/EXI/BBA/TAPServerConnection.cpp index 13b03a9349..864ef55dae 100644 --- a/Source/Core/Core/HW/EXI/BBA/TAPServerConnection.cpp +++ b/Source/Core/Core/HW/EXI/BBA/TAPServerConnection.cpp @@ -320,9 +320,9 @@ void TAPServerConnection::ReadThreadHandler() case ReadState::DATA: case ReadState::SKIP: { - ws_ssize_t bytes_to_read = frame_data.size() - frame_bytes_received; - ws_ssize_t bytes_read = - recv(m_fd, frame_data.data() + frame_bytes_received, bytes_to_read, 0); + const std::size_t bytes_to_read = frame_data.size() - frame_bytes_received; + ws_ssize_t bytes_read = recv(m_fd, frame_data.data() + frame_bytes_received, + static_cast(bytes_to_read), 0); if (bytes_read <= 0) { ERROR_LOG_FMT(SP1, "Failed to read data from destination: {}", Common::StrNetworkError()); diff --git a/Source/Core/Core/HW/EXI/EXI_DeviceModem.cpp b/Source/Core/Core/HW/EXI/EXI_DeviceModem.cpp index e488570a42..3efabc3d7a 100644 --- a/Source/Core/Core/HW/EXI/EXI_DeviceModem.cpp +++ b/Source/Core/Core/HW/EXI/EXI_DeviceModem.cpp @@ -313,7 +313,8 @@ void CEXIModem::SetInterruptFlag(u8 what, bool enabled, bool from_cpu) void CEXIModem::OnReceiveBufferSizeChangedLocked(bool from_cpu) { // The caller is expected to hold m_receive_buffer_lock when calling this. - const u16 bytes_available = std::min(m_receive_buffer.size(), 0x200); + const u16 bytes_available = + static_cast(std::min(m_receive_buffer.size(), 0x200)); m_regs[Register::BYTES_AVAILABLE_HIGH] = (bytes_available >> 8) & 0xFF; m_regs[Register::BYTES_AVAILABLE_LOW] = bytes_available & 0xFF; SetInterruptFlag(Interrupt::RECEIVE_BUFFER_ABOVE_THRESHOLD,