git://git.onelab.eu
/
sliver-openvswitch.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib/util: Rename ctz() as ctz32().
[sliver-openvswitch.git]
/
lib
/
util.h
diff --git
a/lib/util.h
b/lib/util.h
index
fbab74c
..
4f8a291
100644
(file)
--- a/
lib/util.h
+++ b/
lib/util.h
@@
-325,7
+325,7
@@
int raw_ctz(uint64_t n);
/* Returns the number of trailing 0-bits in 'n', or 32 if 'n' is 0. */
static inline int
/* Returns the number of trailing 0-bits in 'n', or 32 if 'n' is 0. */
static inline int
-ctz(uint32_t n)
+ctz
32
(uint32_t n)
{
return n ? raw_ctz(n) : 32;
}
{
return n ? raw_ctz(n) : 32;
}
@@
-361,10
+361,10
@@
zero_rightmost_1bit(uintmax_t x)
static inline uint32_t
rightmost_1bit_idx(uint32_t x)
{
static inline uint32_t
rightmost_1bit_idx(uint32_t x)
{
- return
x ? ctz(x) : 32
;
+ return
ctz32(x)
;
}
}
-/* Returns the index of the
righ
tmost 1-bit in 'x' (e.g. 01011000 => 6), or 32
+/* Returns the index of the
lef
tmost 1-bit in 'x' (e.g. 01011000 => 6), or 32
* if 'x' is 0.
*
* This function only works with 32-bit integers. */
* if 'x' is 0.
*
* This function only works with 32-bit integers. */