Skip to content

Commit

Permalink
fix: correct unsigned types for bitwise NOT of zero
Browse files Browse the repository at this point in the history
  • Loading branch information
oktonion committed Apr 9, 2020
1 parent bb14921 commit a060320
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions compress.c
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ enet_range_coder_compress (void * context, const ENetBuffer * inBuffers, size_t
ENetRangeCoder * rangeCoder = (ENetRangeCoder *) context;
enet_uint8 * outStart = outData, * outEnd = & outData [outLimit];
const enet_uint8 * inData, * inEnd;
enet_uint32 encodeLow = 0, encodeRange = ~0;
enet_uint32 encodeLow = 0, encodeRange = ~0u;
ENetSymbol * root;
enet_uint16 predicted = 0;
size_t order = 0, nextSymbol = 0;
Expand Down Expand Up @@ -501,7 +501,7 @@ enet_range_coder_decompress (void * context, const enet_uint8 * inData, size_t i
ENetRangeCoder * rangeCoder = (ENetRangeCoder *) context;
enet_uint8 * outStart = outData, * outEnd = & outData [outLimit];
const enet_uint8 * inEnd = & inData [inLimit];
enet_uint32 decodeLow = 0, decodeCode = 0, decodeRange = ~0;
enet_uint32 decodeLow = 0, decodeCode = 0, decodeRange = ~0u;
ENetSymbol * root;
enet_uint16 predicted = 0;
size_t order = 0, nextSymbol = 0;
Expand Down
4 changes: 2 additions & 2 deletions host.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,8 @@ enet_host_bandwidth_throttle (ENetHost * host)
enet_uint32 timeCurrent = enet_time_get (),
elapsedTime = timeCurrent - host -> bandwidthThrottleEpoch,
peersRemaining = (enet_uint32) host -> connectedPeers,
dataTotal = ~0,
bandwidth = ~0,
dataTotal = ~0u,
bandwidth = ~0u,
throttle = 0,
bandwidthLimit = 0;
int needsAdjustment = host -> bandwidthLimitedPeers > 0 ? 1 : 0;
Expand Down

0 comments on commit a060320

Please sign in to comment.