Commit a650aaaf authored by Pierre Chapuis's avatar Pierre Chapuis Committed by antirez
Browse files

fix some compiler warnings

parent 3fd4baf1
...@@ -299,7 +299,7 @@ int checkUnsignedBitfieldOverflow(uint64_t value, int64_t incr, uint64_t bits, i ...@@ -299,7 +299,7 @@ int checkUnsignedBitfieldOverflow(uint64_t value, int64_t incr, uint64_t bits, i
handle_wrap: handle_wrap:
{ {
uint64_t mask = ((int64_t)-1) << bits; uint64_t mask = ((uint64_t)-1) << bits;
uint64_t res = value+incr; uint64_t res = value+incr;
res &= ~mask; res &= ~mask;
...@@ -342,7 +342,7 @@ int checkSignedBitfieldOverflow(int64_t value, int64_t incr, uint64_t bits, int ...@@ -342,7 +342,7 @@ int checkSignedBitfieldOverflow(int64_t value, int64_t incr, uint64_t bits, int
handle_wrap: handle_wrap:
{ {
uint64_t mask = ((int64_t)-1) << bits; uint64_t mask = ((uint64_t)-1) << bits;
uint64_t msb = (uint64_t)1 << (bits-1); uint64_t msb = (uint64_t)1 << (bits-1);
uint64_t a = value, b = incr, c; uint64_t a = value, b = incr, c;
c = a+b; /* Perform addition as unsigned so that's defined. */ c = a+b; /* Perform addition as unsigned so that's defined. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment