UDPEndpointImpl: Fixed clang warnings.

master
Mattes D 2015-02-20 16:05:53 +01:00
parent 9c5162041e
commit e30ee8063d
1 changed files with 3 additions and 3 deletions

View File

@ -554,10 +554,10 @@ void cUDPEndpointImpl::Callback(evutil_socket_t a_Socket, short a_What)
{ {
// Receive datagram from the socket: // Receive datagram from the socket:
char buf[64 KiB]; char buf[64 KiB];
int buflen = static_cast<int>(sizeof(buf)); socklen_t buflen = static_cast<socklen_t>(sizeof(buf));
sockaddr_storage sa; sockaddr_storage sa;
socklen_t salen = static_cast<socklen_t>(sizeof(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) if (len >= 0)
{ {
// Convert the remote IP address to a string: // 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: // Call the callback:
m_Callbacks.OnReceivedData(buf, len, RemoteHost, RemotePort); m_Callbacks.OnReceivedData(buf, static_cast<size_t>(len), RemoteHost, RemotePort);
} }
} }
} }