summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_math.h10
-rw-r--r--src/gallium/auxiliary/util/u_ringbuffer.c2
2 files changed, 2 insertions, 10 deletions
diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index a441b5457b2..46d02978fd6 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -179,14 +179,6 @@ util_fast_pow(float x, float y)
return util_fast_exp2(util_fast_log2(x) * y);
}
-/* Note that this counts zero as a power of two.
- */
-static inline boolean
-util_is_power_of_two( unsigned v )
-{
- return (v & (v-1)) == 0;
-}
-
/**
* Floor(x), returned as int.
@@ -459,7 +451,7 @@ util_next_power_of_two(unsigned x)
if (x <= 1)
return 1;
- if (util_is_power_of_two(x))
+ if (util_is_power_of_two_or_zero(x))
return x;
val--;
diff --git a/src/gallium/auxiliary/util/u_ringbuffer.c b/src/gallium/auxiliary/util/u_ringbuffer.c
index 4d6166833e4..f6bb910671e 100644
--- a/src/gallium/auxiliary/util/u_ringbuffer.c
+++ b/src/gallium/auxiliary/util/u_ringbuffer.c
@@ -27,7 +27,7 @@ struct util_ringbuffer *util_ringbuffer_create( unsigned dwords )
if (!ring)
return NULL;
- assert(util_is_power_of_two(dwords));
+ assert(util_is_power_of_two_or_zero(dwords));
ring->buf = MALLOC( dwords * sizeof(unsigned) );
if (ring->buf == NULL)