From d76c204d0564701b4b8b6a2bdda50e2939683e66 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 13 Nov 2017 11:17:41 -0800 Subject: util: Move util_is_power_of_two to bitscan.h and rename to util_is_power_of_two_or_zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The new name make the zero-input behavior more obvious. The next patch adds a new function with different zero-input behavior. Signed-off-by: Ian Romanick Suggested-by: Matt Turner Reviewed-by: Alejandro PiƱeiro --- src/util/u_vector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/util/u_vector.c') diff --git a/src/util/u_vector.c b/src/util/u_vector.c index 0de492ccf9a..bec6e5bbc30 100644 --- a/src/util/u_vector.c +++ b/src/util/u_vector.c @@ -37,8 +37,8 @@ int u_vector_init(struct u_vector *vector, uint32_t element_size, uint32_t size) { - assert(util_is_power_of_two(size)); - assert(element_size < size && util_is_power_of_two(element_size)); + assert(util_is_power_of_two_or_zero(size)); + assert(element_size < size && util_is_power_of_two_or_zero(element_size)); vector->head = 0; vector->tail = 0; -- cgit v1.2.3