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
include/mgba-util/math.h
→
include/mgba-util/math.h
@@ -18,6 +18,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] = {