Fixed MSVC 64-bit build warnings.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user