mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-18 03:13:55 +00:00
Fix most conversion warnings
This commit is contained in:
@@ -57,7 +57,7 @@ namespace network
|
||||
|
||||
bool socket::bind_port(const address& target)
|
||||
{
|
||||
const auto result = bind(this->socket_, &target.get_addr(), static_cast<socklen_t>(target.get_size())) == 0;
|
||||
const auto result = bind(this->socket_, &target.get_addr(), target.get_size()) == 0;
|
||||
if (result)
|
||||
{
|
||||
this->port_ = target.get_port();
|
||||
@@ -70,7 +70,7 @@ namespace network
|
||||
{
|
||||
const auto res = sendto(this->socket_, static_cast<const char*>(data), static_cast<send_size>(size), 0,
|
||||
&target.get_addr(),
|
||||
static_cast<socklen_t>(target.get_size()));
|
||||
target.get_size());
|
||||
return static_cast<size_t>(res) == size;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace network
|
||||
bool socket::receive(address& source, std::string& data) const
|
||||
{
|
||||
char buffer[0x2000];
|
||||
auto len = static_cast<socklen_t>(source.get_max_size());
|
||||
auto len = source.get_max_size();
|
||||
|
||||
const auto result = recvfrom(this->socket_, buffer, static_cast<int>(sizeof(buffer)), 0, &source.get_addr(),
|
||||
&len);
|
||||
|
||||
Reference in New Issue
Block a user