git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
edbef9e
)
ctdb/server: cppcheck: fix shiftTooManyBitsSigned error
author
Noel Power
<noel.power@suse.com>
Thu, 23 May 2019 13:15:58 +0000
(13:15 +0000)
committer
Andreas Schneider
<asn@cryptomilk.org>
Tue, 4 Jun 2019 22:13:07 +0000
(22:13 +0000)
Fixes
ctdb/server/ipalloc_lcp2.c:61: error: shiftTooManyBitsSigned: Shifting signed 32-bit value by 31 bits is undefined behaviour <--[cppcheck]
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
ctdb/server/ipalloc_lcp2.c
patch
|
blob
|
history
diff --git
a/ctdb/server/ipalloc_lcp2.c
b/ctdb/server/ipalloc_lcp2.c
index 565b58c9a0c6537554e66b4b8c8269cd78855566..1146bb60f16088bf58967fc532022d9ee447a6c7 100644
(file)
--- a/
ctdb/server/ipalloc_lcp2.c
+++ b/
ctdb/server/ipalloc_lcp2.c
@@
-58,7
+58,7
@@
static uint32_t ip_distance(ctdb_sock_addr *ip1, ctdb_sock_addr *ip2)
/* Count number of leading zeroes.
* FIXME? This could be optimised...
*/
- while ((x & (1 << 31)) == 0) {
+ while ((x & (
(uint32_t)
1 << 31)) == 0) {
x <<= 1;
distance += 1;
}