From c4ea25e136026004526a63516cbed498e2b6fabe Mon Sep 17 00:00:00 2001 From: Mattes D Date: Thu, 8 May 2014 20:16:35 +0200 Subject: Fixed MSVC 64-bit build warnings. --- src/OSSupport/ListenThread.cpp | 2 +- src/OSSupport/Socket.cpp | 8 ++++---- src/OSSupport/Socket.h | 4 ++-- src/OSSupport/SocketThreads.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/OSSupport') diff --git a/src/OSSupport/ListenThread.cpp b/src/OSSupport/ListenThread.cpp index ba3198764..02e98acfc 100644 --- a/src/OSSupport/ListenThread.cpp +++ b/src/OSSupport/ListenThread.cpp @@ -214,7 +214,7 @@ void cListenThread::Execute(void) timeval tv; // On Linux select() doesn't seem to wake up when socket is closed, so let's kinda busy-wait: tv.tv_sec = 1; tv.tv_usec = 0; - if (select(Highest + 1, &fdRead, NULL, NULL, &tv) == -1) + if (select((int)Highest + 1, &fdRead, NULL, NULL, &tv) == -1) { LOG("select(R) call failed in cListenThread: \"%s\"", cSocket::GetLastErrorString().c_str()); continue; diff --git a/src/OSSupport/Socket.cpp b/src/OSSupport/Socket.cpp index 98f694a79..56835b518 100644 --- a/src/OSSupport/Socket.cpp +++ b/src/OSSupport/Socket.cpp @@ -328,18 +328,18 @@ bool cSocket::ConnectIPv4(const AString & a_HostNameOrAddr, unsigned short a_Por -int cSocket::Receive(char * a_Buffer, unsigned int a_Length, unsigned int a_Flags) +int cSocket::Receive(char * a_Buffer, size_t a_Length, unsigned int a_Flags) { - return recv(m_Socket, a_Buffer, a_Length, a_Flags); + return recv(m_Socket, a_Buffer, (int)a_Length, a_Flags); } -int cSocket::Send(const char * a_Buffer, unsigned int a_Length) +int cSocket::Send(const char * a_Buffer, size_t a_Length) { - return send(m_Socket, a_Buffer, a_Length, MSG_NOSIGNAL); + return send(m_Socket, a_Buffer, (int)a_Length, MSG_NOSIGNAL); } diff --git a/src/OSSupport/Socket.h b/src/OSSupport/Socket.h index bdc2babf5..35ecadfa0 100644 --- a/src/OSSupport/Socket.h +++ b/src/OSSupport/Socket.h @@ -110,8 +110,8 @@ public: /// Connects to the specified host or string IP address and port, using IPv4. Returns true if successful. bool ConnectIPv4(const AString & a_HostNameOrAddr, unsigned short a_Port); - int Receive(char * a_Buffer, unsigned int a_Length, unsigned int a_Flags); - int Send (const char * a_Buffer, unsigned int a_Length); + int Receive(char * a_Buffer, size_t a_Length, unsigned int a_Flags); + int Send (const char * a_Buffer, size_t a_Length); unsigned short GetPort(void) const; // Returns 0 on failure diff --git a/src/OSSupport/SocketThreads.cpp b/src/OSSupport/SocketThreads.cpp index 0bc1d6b55..0ab5b6298 100644 --- a/src/OSSupport/SocketThreads.cpp +++ b/src/OSSupport/SocketThreads.cpp @@ -406,7 +406,7 @@ void cSocketThreads::cSocketThread::Execute(void) timeval Timeout; Timeout.tv_sec = 5; Timeout.tv_usec = 0; - if (select(Highest + 1, &fdRead, &fdWrite, NULL, &Timeout) == -1) + if (select((int)Highest + 1, &fdRead, &fdWrite, NULL, &Timeout) == -1) { LOG("select() call failed in cSocketThread: \"%s\"", cSocket::GetLastErrorString().c_str()); continue; -- cgit v1.2.3