mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-18 19:23:56 +00:00
Fix macOS warnings
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#define ZeroMemory(x, y) memset(x, 0, y)
|
||||
#define ZeroMemory(x, y) memset(x, 0, static_cast<size_t>(y))
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace network
|
||||
|
||||
bool socket::bind_port(const address& target)
|
||||
{
|
||||
const auto result = bind(this->socket_, &target.get_addr(), target.get_size()) == 0;
|
||||
const auto result = bind(this->socket_, &target.get_addr(), static_cast<socklen_t>(target.get_size())) == 0;
|
||||
if (result)
|
||||
{
|
||||
this->port_ = target.get_port();
|
||||
@@ -82,7 +82,7 @@ namespace network
|
||||
bool socket::receive(address& source, std::string& data) const
|
||||
{
|
||||
char buffer[0x2000];
|
||||
socklen_t len = source.get_max_size();
|
||||
auto len = static_cast<socklen_t>(source.get_max_size());
|
||||
|
||||
const auto result = recvfrom(this->socket_, buffer, static_cast<int>(sizeof(buffer)), 0, &source.get_addr(),
|
||||
&len);
|
||||
|
||||
@@ -13,7 +13,7 @@ using send_size = int;
|
||||
#define SOCK_WOULDBLOCK WSAEWOULDBLOCK
|
||||
#else
|
||||
using SOCKET = int;
|
||||
using send_size = ssize_t;
|
||||
using send_size = size_t;
|
||||
#define INVALID_SOCKET (SOCKET)(~0)
|
||||
#define SOCKET_ERROR (-1)
|
||||
#define GET_SOCKET_ERROR() (errno)
|
||||
|
||||
@@ -97,6 +97,7 @@ namespace utils
|
||||
const std::span result(this->buffer_.data() + this->offset_, length);
|
||||
this->offset_ += length;
|
||||
|
||||
(void)this->no_debugging_;
|
||||
|
||||
#ifndef NDEBUG
|
||||
if (!this->no_debugging_)
|
||||
|
||||
Reference in New Issue
Block a user