Util: Make clz consistent
Jeffrey Pfau jeffrey@endrift.com
Fri, 10 Jun 2016 13:20:19 -0700
1 files changed,
3 insertions(+),
0 deletions(-)
jump to
M
src/util/math.h
→
src/util/math.h
@@ -16,6 +16,9 @@ }
static inline unsigned clz32(uint32_t bits) { #if defined(__GNUC__) || __clang__ + if (!bits) { + return 32; + } return __builtin_clz(bits); #else static const int table[256] = {