From: Ian Romanick Date: Mon, 26 Mar 2018 17:52:43 +0000 (-0700) Subject: util: Use util_is_power_of_two_nonzero in u_vector X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=cd18aa1e50e4668c8d992816bcdb74376dd1064c;p=mesa.git util: Use util_is_power_of_two_nonzero in u_vector Previously size=0, element_size=0 would have been allowed. That combination can only lead to despair. Signed-off-by: Ian Romanick Reviewed-by: Alejandro PiƱeiro --- diff --git a/src/util/u_vector.c b/src/util/u_vector.c index bec6e5bbc30..15f8ed6bdad 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_or_zero(size)); - assert(element_size < size && util_is_power_of_two_or_zero(element_size)); + assert(util_is_power_of_two_nonzero(size)); + assert(element_size < size && util_is_power_of_two_nonzero(element_size)); vector->head = 0; vector->tail = 0;