Simple pass over the codebase to standardize the platform types.

This commit is contained in:
cpusci 2013-08-04 16:26:01 -05:00
parent c75d6feb20
commit 4c35fd37af
189 changed files with 824 additions and 824 deletions

View file

@ -30,7 +30,7 @@
#define EINPROGRESS WSAEINPROGRESS
#define ioctl ioctlsocket
typedef int socklen_t;
typedef S32 socklen_t;
#elif defined ( TORQUE_OS_MAC )
@ -84,7 +84,7 @@ typedef in_addr IN_ADDR;
#define TORQUE_USE_WINSOCK
#define EINPROGRESS WSAEINPROGRESS
#define ioctl ioctlsocket
typedef int socklen_t;
typedef S32 socklen_t;
DWORD _getLastErrorAndClear()
{
@ -99,7 +99,7 @@ DWORD _getLastErrorAndClear()
#endif
#if defined(TORQUE_USE_WINSOCK)
static const char* strerror_wsa( int code )
static const char* strerror_wsa( S32 code )
{
switch( code )
{
@ -137,7 +137,7 @@ static const char* strerror_wsa( int code )
static Net::Error getLastError();
static S32 defaultPort = 28000;
static S32 netPort = 0;
static int udpSocket = InvalidSocket;
static S32 udpSocket = InvalidSocket;
ConnectionNotifyEvent Net::smConnectionNotify;
ConnectionAcceptedEvent Net::smConnectionAccept;
@ -441,7 +441,7 @@ void Net::closeConnectTo(NetSocket sock)
return;
// if this socket is in the list of polled sockets, remove it
for (int i = 0; i < gPolledSockets.size(); ++i)
for (S32 i = 0; i < gPolledSockets.size(); ++i)
{
if (gPolledSockets[i]->fd == sock)
{
@ -454,7 +454,7 @@ void Net::closeConnectTo(NetSocket sock)
closeSocket(sock);
}
Net::Error Net::sendtoSocket(NetSocket socket, const U8 *buffer, int bufferSize)
Net::Error Net::sendtoSocket(NetSocket socket, const U8 *buffer, S32 bufferSize)
{
if(Journal::IsPlaying())
{
@ -480,7 +480,7 @@ bool Net::openPort(S32 port, bool doBind)
// we turn off VDP in non-release builds because VDP does not support broadcast packets
// which are required for LAN queries (PC->Xbox connectivity). The wire protocol still
// uses the VDP packet structure, though.
int protocol = 0;
S32 protocol = 0;
bool useVDP = false;
#ifdef TORQUE_DISABLE_PC_CONNECTIVITY
// Xbox uses a VDP (voice/data protocol) socket for networking
@ -617,7 +617,7 @@ void Net::process()
sockaddr_in ipAddr;
NetSocket incoming = InvalidSocket;
char out_h_addr[1024];
int out_h_length = 0;
S32 out_h_length = 0;
RawData readBuff;
for (S32 i = 0; i < gPolledSockets.size();
@ -727,7 +727,7 @@ void Net::process()
if(::connect(currentSock->fd, (struct sockaddr *)&ipAddr,
sizeof(ipAddr)) == -1)
{
int errorCode;
S32 errorCode;
#if defined(TORQUE_USE_WINSOCK)
errorCode = WSAGetLastError();
if( errorCode == WSAEINPROGRESS || errorCode == WSAEWOULDBLOCK )
@ -786,7 +786,7 @@ void Net::process()
NetSocket Net::openSocket()
{
int retSocket;
S32 retSocket;
retSocket = socket(AF_INET, SOCK_STREAM, 0);
if(retSocket == InvalidSocket)
@ -831,7 +831,7 @@ NetSocket Net::accept(NetSocket acceptSocket, NetAddress *remoteAddress)
sockaddr_in socketAddress;
socklen_t addrLen = sizeof(socketAddress);
int retVal = ::accept(acceptSocket, (sockaddr *) &socketAddress, &addrLen);
S32 retVal = ::accept(acceptSocket, (sockaddr *) &socketAddress, &addrLen);
if(retVal != InvalidSocket)
{
IPSocketToNetAddress(&socketAddress, remoteAddress);