diff options
| author | bunnei <bunneidev@gmail.com> | 2020-09-11 15:17:34 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-11 15:17:34 -0700 |
| commit | ec634b6a8844b41d91d6c19d5faac50c35177b32 (patch) | |
| tree | 4dcdbc5fb6f1393bd1cbb155e9ca3fa329e42a5e /src/core/hle/service/sockets/bsd.cpp | |
| parent | 324029d4f9fd2381f474e608a2859360324161e5 (diff) | |
| parent | 40968e39937e3af3da399f66e7024f754ba1236b (diff) | |
Merge pull request #4634 from lioncash/blocking
bsd: Resolve a few warnings
Diffstat (limited to 'src/core/hle/service/sockets/bsd.cpp')
| -rw-r--r-- | src/core/hle/service/sockets/bsd.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/hle/service/sockets/bsd.cpp b/src/core/hle/service/sockets/bsd.cpp index 803505452..7b9dd42d8 100644 --- a/src/core/hle/service/sockets/bsd.cpp +++ b/src/core/hle/service/sockets/bsd.cpp @@ -491,7 +491,7 @@ std::pair<s32, Errno> BSD::PollImpl(std::vector<u8>& write_buffer, std::vector<u for (PollFD& pollfd : fds) { ASSERT(pollfd.revents == 0); - if (pollfd.fd > MAX_FD || pollfd.fd < 0) { + if (pollfd.fd > static_cast<s32>(MAX_FD) || pollfd.fd < 0) { LOG_ERROR(Service, "File descriptor handle={} is invalid", pollfd.fd); pollfd.revents = 0; return {0, Errno::SUCCESS}; @@ -764,6 +764,7 @@ std::pair<s32, Errno> BSD::SendToImpl(s32 fd, u32 flags, const std::vector<u8>& SockAddrIn guest_addr_in; std::memcpy(&guest_addr_in, addr.data(), sizeof(guest_addr_in)); addr_in = Translate(guest_addr_in); + p_addr_in = &addr_in; } return Translate(file_descriptors[fd]->socket->SendTo(flags, message, p_addr_in)); @@ -795,7 +796,7 @@ s32 BSD::FindFreeFileDescriptorHandle() noexcept { } bool BSD::IsFileDescriptorValid(s32 fd) const noexcept { - if (fd > MAX_FD || fd < 0) { + if (fd > static_cast<s32>(MAX_FD) || fd < 0) { LOG_ERROR(Service, "Invalid file descriptor handle={}", fd); return false; } @@ -809,7 +810,7 @@ bool BSD::IsFileDescriptorValid(s32 fd) const noexcept { bool BSD::IsBlockingSocket(s32 fd) const noexcept { // Inform invalid sockets as non-blocking // This way we avoid using a worker thread as it will fail without blocking host - if (fd > MAX_FD || fd < 0) { + if (fd > static_cast<s32>(MAX_FD) || fd < 0) { return false; } if (!file_descriptors[fd]) { |
