got an issue on arch linux/gcc6
runtime errors due to the shifting operations done in eNet
This commit is contained in:
parent
9c2c28c110
commit
abd2812e1b
@ -343,10 +343,10 @@ enet_range_coder_compress (void * context, const ENetBuffer * inBuffers, size_t
|
||||
|
||||
#define ENET_RANGE_CODER_SEED \
|
||||
{ \
|
||||
if (inData < inEnd) decodeCode |= * inData ++ << 24; \
|
||||
if (inData < inEnd) decodeCode |= * inData ++ << 16; \
|
||||
if (inData < inEnd) decodeCode |= * inData ++ << 8; \
|
||||
if (inData < inEnd) decodeCode |= * inData ++; \
|
||||
if (inData < inEnd) decodeCode |= (enet_uint32)(* inData ++) << 24; \
|
||||
if (inData < inEnd) decodeCode |= (enet_uint32)(* inData ++) << 16; \
|
||||
if (inData < inEnd) decodeCode |= (enet_uint32)(* inData ++) << 8; \
|
||||
if (inData < inEnd) decodeCode |= (enet_uint32)(* inData ++); \
|
||||
}
|
||||
|
||||
#define ENET_RANGE_CODER_READ(total) ((decodeCode - decodeLow) / (decodeRange /= (total)))
|
||||
|
@ -454,7 +454,7 @@ enet_protocol_handle_send_unsequenced (ENetHost * host, ENetPeer * peer, const E
|
||||
memset (peer -> unsequencedWindow, 0, sizeof (peer -> unsequencedWindow));
|
||||
}
|
||||
else
|
||||
if (peer -> unsequencedWindow [index / 32] & (1 << (index % 32)))
|
||||
if (peer -> unsequencedWindow [index / 32] & (1u << (index % 32)))
|
||||
return 0;
|
||||
|
||||
packet = enet_packet_create ((const enet_uint8 *) command + sizeof (ENetProtocolSendUnsequenced),
|
||||
@ -464,7 +464,7 @@ enet_protocol_handle_send_unsequenced (ENetHost * host, ENetPeer * peer, const E
|
||||
enet_peer_queue_incoming_command (peer, command, packet, 0) == NULL)
|
||||
return -1;
|
||||
|
||||
peer -> unsequencedWindow [index / 32] |= 1 << (index % 32);
|
||||
peer -> unsequencedWindow [index / 32] |= 1u << (index % 32);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user