From b5617058e45717063eda7aa0128036d241d881c9 Mon Sep 17 00:00:00 2001 From: Sil Vilerino Date: Thu, 9 Jan 2025 07:10:45 -0500 Subject: [PATCH] u_math.h: Change power of two assert to fix warning C4146: unary minus operator applied to unsigned type, result still unsigned Reviewed-By: Jesse Natalie Reviewed-by: Jesse Natalie Part-of: --- src/util/u_math.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/u_math.h b/src/util/u_math.h index e714adc2249..9bfe395e113 100644 --- a/src/util/u_math.h +++ b/src/util/u_math.h @@ -830,7 +830,7 @@ util_clamped_uadd(unsigned a, unsigned b) static inline bool util_is_aligned(uintmax_t n, uintmax_t a) { - assert(a == (a & -a)); + assert((a != 0) && ((a & (a - 1)) == 0)); return (n & (a - 1)) == 0; }