mirror of
https://bitbucket.org/seefoe/src.git
synced 2026-07-30 00:15:46 -04:00
theoretically this will fix our unsigned comparison warnings
This commit is contained in:
+4
-4
@@ -58,7 +58,7 @@ TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAllo
|
||||
|
||||
int err = connect(m_socket, (sockaddr *)&m_addr, sizeof(m_addr));
|
||||
|
||||
if(err == SOCKET_ERROR)
|
||||
if((unsigned) err == SOCKET_ERROR)
|
||||
{
|
||||
#ifdef WIN32
|
||||
int sockerr = WSAGetLastError();
|
||||
@@ -132,7 +132,7 @@ TcpConnection::TcpConnection(TcpManager *tcpManager, TcpBlockAllocator *sendAllo
|
||||
|
||||
void TcpConnection::setOptions()
|
||||
{
|
||||
if (m_socket != INVALID_SOCKET)
|
||||
if ((unsigned) m_socket != INVALID_SOCKET)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
unsigned long isNonBlocking = 1;
|
||||
@@ -249,7 +249,7 @@ int TcpConnection::finishConnect()
|
||||
#else // not WIN32
|
||||
int err = connect(m_socket, (sockaddr *)&m_addr, sizeof(m_addr));
|
||||
|
||||
if(err == SOCKET_ERROR)
|
||||
if((unsigned) err == SOCKET_ERROR)
|
||||
{
|
||||
if (errno != EINPROGRESS && errno != EALREADY)
|
||||
{
|
||||
@@ -413,7 +413,7 @@ void TcpConnection::Disconnect(bool notifyApplication)
|
||||
}
|
||||
|
||||
|
||||
if(m_socket != INVALID_SOCKET)
|
||||
if((unsigned) m_socket != INVALID_SOCKET)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
closesocket(m_socket);
|
||||
|
||||
@@ -101,7 +101,7 @@ bool TcpManager::BindAsServer()
|
||||
|
||||
m_socket = socket(AF_INET, SOCK_STREAM, 0);
|
||||
|
||||
if (m_socket != INVALID_SOCKET)
|
||||
if ((unsigned) m_socket != INVALID_SOCKET)
|
||||
{
|
||||
#if defined(WIN32)
|
||||
FD_SET(m_socket, &m_permfds);//the socket this server is listening on
|
||||
@@ -197,7 +197,7 @@ TcpConnection *TcpManager::acceptClient()
|
||||
SOCKET sock = ::accept(m_socket, (sockaddr *) &addr, (socklen_t *) &addrLength);
|
||||
|
||||
|
||||
if (sock != INVALID_SOCKET)
|
||||
if ((unsigned) sock != INVALID_SOCKET)
|
||||
{
|
||||
newConn = new TcpConnection(this, &m_allocator, m_params, sock, IPAddress(addr.sin_addr.s_addr), ntohs(addr.sin_port));
|
||||
addNewConnection(newConn);
|
||||
@@ -445,7 +445,7 @@ bool TcpManager::GiveTime(unsigned maxTimeAcceptingConnections,unsigned maxSendT
|
||||
|
||||
int cnt = poll(pollfds, numfds, 1);
|
||||
|
||||
if(cnt == SOCKET_ERROR)
|
||||
if((unsigned) cnt == SOCKET_ERROR)
|
||||
{
|
||||
//poll not working?
|
||||
//TODO: need to notify client somehow, don't think we can assume a fatal error here
|
||||
|
||||
+1
-1
@@ -345,7 +345,7 @@ ByteStream::Data *ByteStream::Data::getNewData()
|
||||
|
||||
void ByteStream::Data::releaseOldData(ByteStream::Data *oldData)
|
||||
{
|
||||
assert(reinterpret_cast<long>(oldData) != 0xefefefefu);
|
||||
assert((unsigned) reinterpret_cast<long>(oldData) != 0xefefefefu);
|
||||
|
||||
if (oldData->size > 4096)
|
||||
delete oldData;
|
||||
|
||||
Reference in New Issue
Block a user