summaryrefslogtreecommitdiffstats
path: root/src/OSSupport/UDPEndpointImpl.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-02-20 16:05:53 +0100
committerMattes D <github@xoft.cz>2015-02-20 16:05:53 +0100
commite30ee8063d9e7b3471c9bbb197418d792d8fb468 (patch)
tree610f2fe70ddc70b940d8e36bf0e7f00479c18545 /src/OSSupport/UDPEndpointImpl.cpp
parentcNetwork: Added UDP API. (diff)
downloadcuberite-e30ee8063d9e7b3471c9bbb197418d792d8fb468.tar
cuberite-e30ee8063d9e7b3471c9bbb197418d792d8fb468.tar.gz
cuberite-e30ee8063d9e7b3471c9bbb197418d792d8fb468.tar.bz2
cuberite-e30ee8063d9e7b3471c9bbb197418d792d8fb468.tar.lz
cuberite-e30ee8063d9e7b3471c9bbb197418d792d8fb468.tar.xz
cuberite-e30ee8063d9e7b3471c9bbb197418d792d8fb468.tar.zst
cuberite-e30ee8063d9e7b3471c9bbb197418d792d8fb468.zip
Diffstat (limited to 'src/OSSupport/UDPEndpointImpl.cpp')
-rw-r--r--src/OSSupport/UDPEndpointImpl.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/OSSupport/UDPEndpointImpl.cpp b/src/OSSupport/UDPEndpointImpl.cpp
index c5190bcf6..ece521ab8 100644
--- a/src/OSSupport/UDPEndpointImpl.cpp
+++ b/src/OSSupport/UDPEndpointImpl.cpp
@@ -554,10 +554,10 @@ void cUDPEndpointImpl::Callback(evutil_socket_t a_Socket, short a_What)
{
// Receive datagram from the socket:
char buf[64 KiB];
- int buflen = static_cast<int>(sizeof(buf));
+ socklen_t buflen = static_cast<socklen_t>(sizeof(buf));
sockaddr_storage sa;
socklen_t salen = static_cast<socklen_t>(sizeof(sa));
- int len = recvfrom(a_Socket, buf, buflen, 0, reinterpret_cast<sockaddr *>(&sa), &salen);
+ auto len = recvfrom(a_Socket, buf, buflen, 0, reinterpret_cast<sockaddr *>(&sa), &salen);
if (len >= 0)
{
// Convert the remote IP address to a string:
@@ -586,7 +586,7 @@ void cUDPEndpointImpl::Callback(evutil_socket_t a_Socket, short a_What)
}
// Call the callback:
- m_Callbacks.OnReceivedData(buf, len, RemoteHost, RemotePort);
+ m_Callbacks.OnReceivedData(buf, static_cast<size_t>(len), RemoteHost, RemotePort);
}
}
}