got an issue on arch linux/gcc6

runtime errors due to the shifting operations done in eNet
This commit is contained in:
David Carlier 2017-04-25 22:07:20 +00:00
parent 9c2c28c110
commit abd2812e1b
2 changed files with 6 additions and 6 deletions

View File

@ -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)))

View File

@ -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;
}