all repos — mgba @ 6049c1b34025bf285d11dd799d22510836b35ea8

mGBA Game Boy Advance Emulator

Util: Make clz consistent
Jeffrey Pfau jeffrey@endrift.com
Fri, 10 Jun 2016 13:20:19 -0700
commit

6049c1b34025bf285d11dd799d22510836b35ea8

parent

12928954abf244675e2eb924d3219a47f4aca407

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M src/util/math.hsrc/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] = {