Split r3159..r3161, part 7: code touching networking.

git-svn-id: https://svn.eduke32.com/eduke32@3173 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-11-15 14:28:14 +00:00
parent 6d5d415ea5
commit 7c07fee1b3
5 changed files with 11 additions and 11 deletions

View file

@ -128,7 +128,7 @@ enet_symbol_rescale (ENetSymbol * symbol)
if((encodeLow ^ (encodeLow + encodeRange)) >= ENET_RANGE_CODER_TOP) \ if((encodeLow ^ (encodeLow + encodeRange)) >= ENET_RANGE_CODER_TOP) \
{ \ { \
if(encodeRange >= ENET_RANGE_CODER_BOTTOM) break; \ if(encodeRange >= ENET_RANGE_CODER_BOTTOM) break; \
encodeRange = -encodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \ encodeRange = -(signed)encodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
} \ } \
ENET_RANGE_CODER_OUTPUT (encodeLow >> 24); \ ENET_RANGE_CODER_OUTPUT (encodeLow >> 24); \
encodeRange <<= 8; \ encodeRange <<= 8; \
@ -360,7 +360,7 @@ enet_range_coder_compress (void * context, const ENetBuffer * inBuffers, size_t
if((decodeLow ^ (decodeLow + decodeRange)) >= ENET_RANGE_CODER_TOP) \ if((decodeLow ^ (decodeLow + decodeRange)) >= ENET_RANGE_CODER_TOP) \
{ \ { \
if(decodeRange >= ENET_RANGE_CODER_BOTTOM) break; \ if(decodeRange >= ENET_RANGE_CODER_BOTTOM) break; \
decodeRange = -decodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \ decodeRange = -(signed)decodeLow & (ENET_RANGE_CODER_BOTTOM - 1); \
} \ } \
decodeCode <<= 8; \ decodeCode <<= 8; \
if (inData < inEnd) \ if (inData < inEnd) \

View file

@ -430,7 +430,7 @@ enet_peer_ping (ENetPeer * peer)
void void
enet_peer_ping_interval (ENetPeer * peer, enet_uint32 pingInterval) enet_peer_ping_interval (ENetPeer * peer, enet_uint32 pingInterval)
{ {
peer -> pingInterval = pingInterval ? pingInterval : ENET_PEER_PING_INTERVAL; peer -> pingInterval = pingInterval ? pingInterval : (enet_uint32)ENET_PEER_PING_INTERVAL;
} }
/** Sets the timeout parameters for a peer. /** Sets the timeout parameters for a peer.
@ -453,9 +453,9 @@ enet_peer_ping_interval (ENetPeer * peer, enet_uint32 pingInterval)
void void
enet_peer_timeout (ENetPeer * peer, enet_uint32 timeoutLimit, enet_uint32 timeoutMinimum, enet_uint32 timeoutMaximum) enet_peer_timeout (ENetPeer * peer, enet_uint32 timeoutLimit, enet_uint32 timeoutMinimum, enet_uint32 timeoutMaximum)
{ {
peer -> timeoutLimit = timeoutLimit ? timeoutLimit : ENET_PEER_TIMEOUT_LIMIT; peer -> timeoutLimit = timeoutLimit ? timeoutLimit : (enet_uint32)ENET_PEER_TIMEOUT_LIMIT;
peer -> timeoutMinimum = timeoutMinimum ? timeoutMinimum : ENET_PEER_TIMEOUT_MINIMUM; peer -> timeoutMinimum = timeoutMinimum ? timeoutMinimum : (enet_uint32)ENET_PEER_TIMEOUT_MINIMUM;
peer -> timeoutMaximum = timeoutMaximum ? timeoutMaximum : ENET_PEER_TIMEOUT_MAXIMUM; peer -> timeoutMaximum = timeoutMaximum ? timeoutMaximum : (enet_uint32)ENET_PEER_TIMEOUT_MAXIMUM;
} }
/** Force an immediate disconnection from a peer. /** Force an immediate disconnection from a peer.

View file

@ -45,7 +45,7 @@ uint32_t g_netMapRevision = 0;
ENetHost *g_netServer = NULL; ENetHost *g_netServer = NULL;
ENetHost *g_netClient = NULL; ENetHost *g_netClient = NULL;
ENetPeer *g_netClientPeer = NULL; ENetPeer *g_netClientPeer = NULL;
int32_t g_netPort = 23513; enet_uint16 g_netPort = 23513;
int32_t g_netDisconnect = 0; int32_t g_netDisconnect = 0;
char g_netPassword[32]; char g_netPassword[32];
int32_t g_netPlayersWaiting = 0; int32_t g_netPlayersWaiting = 0;
@ -71,14 +71,14 @@ static void alloc_multimapstate(int32_t i)
{ {
if (g_multiMapState[i] == NULL) if (g_multiMapState[i] == NULL)
{ {
g_multiMapState[i] = Bcalloc(1, sizeof(netmapstate_t)); g_multiMapState[i] = (netmapstate_t *)Bcalloc(1, sizeof(netmapstate_t));
if (g_multiMapState[i] == NULL) if (g_multiMapState[i] == NULL)
G_GameExit("OUT OF MEMORY in alloc_multimapstate"); G_GameExit("OUT OF MEMORY in alloc_multimapstate");
} }
if (g_pendingMapState[i] == NULL) if (g_pendingMapState[i] == NULL)
{ {
g_pendingMapState[i] = Bcalloc(1, sizeof(netmapstate_t)); g_pendingMapState[i] = (netmapstate_t *)Bcalloc(1, sizeof(netmapstate_t));
if (g_pendingMapState[i] == NULL) if (g_pendingMapState[i] == NULL)
G_GameExit("OUT OF MEMORY in alloc_multimapstate"); G_GameExit("OUT OF MEMORY in alloc_multimapstate");
} }

View file

@ -135,7 +135,7 @@ extern ENetPeer *g_netClientPeer;
extern char g_netPassword[32]; extern char g_netPassword[32];
extern int32_t g_netDisconnect; extern int32_t g_netDisconnect;
extern int32_t g_netPlayersWaiting; extern int32_t g_netPlayersWaiting;
extern int32_t g_netPort; extern enet_uint16 g_netPort;
extern int32_t g_networkMode; extern int32_t g_networkMode;
extern int32_t lastsectupdate[MAXSECTORS]; extern int32_t lastsectupdate[MAXSECTORS];
extern int32_t lastupdate[MAXSPRITES]; extern int32_t lastupdate[MAXSPRITES];

View file

@ -135,7 +135,7 @@
typedef signed int ssize_t; typedef signed int ssize_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef unsigned long uint32_t; typedef unsigned __int32 uint32_t;
typedef ULONGLONG uint64_t; typedef ULONGLONG uint64_t;
#else #else
/* mingw32, lcc and watcom provide a proper header */ /* mingw32, lcc and watcom provide a proper header */