summaryrefslogtreecommitdiffstats
path: root/src/OSSupport
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2014-05-08 20:16:35 +0200
committerMattes D <github@xoft.cz>2014-05-09 18:32:03 +0200
commitfb58ef55beddc73500029ae6c0fe08400de550d2 (patch)
tree8e36e0eba345faa98c499ac63f7bdeae5c02d9da /src/OSSupport
parentInitialise m_HasTeleported in both constructors (diff)
downloadcuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar
cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.gz
cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.bz2
cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.lz
cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.xz
cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.tar.zst
cuberite-fb58ef55beddc73500029ae6c0fe08400de550d2.zip
Diffstat (limited to 'src/OSSupport')
-rw-r--r--src/OSSupport/ListenThread.cpp2
-rw-r--r--src/OSSupport/Socket.cpp8
-rw-r--r--src/OSSupport/Socket.h4
-rw-r--r--src/OSSupport/SocketThreads.cpp2
4 files changed, 8 insertions, 8 deletions
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;