diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_cb_texture.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 22685bd5d95..15f84b66382 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -237,14 +237,12 @@ do_memcpy(void *dest, const void *src, size_t n) } -static int -logbase2(int n) +static INLINE unsigned +logbase2(unsigned n) { - GLint i = 1, log2 = 0; - while (n > i) { - i *= 2; - log2++; - } + unsigned log2 = 0; + while (n >>= 1) + ++log2; return log2; } |