Fix most conversion warnings

This commit is contained in:
momo5502
2025-01-05 20:34:54 +01:00
parent eeac915a55
commit 17860edc4c
9 changed files with 34 additions and 39 deletions

View File

@@ -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);