From 1d1acc0c34228f68ccfed25ec61fb6982233ab2e Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 30 Sep 2018 12:12:27 -0700 Subject: Ensure BUFFERSIZE is a power of 2 --- Alc/mastering.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Alc/mastering.c b/Alc/mastering.c index f443de37..637cd8d2 100644 --- a/Alc/mastering.c +++ b/Alc/mastering.c @@ -5,10 +5,12 @@ #include "mastering.h" #include "alu.h" #include "almalloc.h" +#include "static_assert.h" -/* These structures assume BUFFERSIZE is a power of 2. - */ +/* These structures assume BUFFERSIZE is a power of 2. */ +static_assert((BUFFERSIZE & (BUFFERSIZE-1)) == 0, "BUFFERSIZE is not a power of 2"); + typedef struct SlidingHold { ALfloat Values[BUFFERSIZE]; ALsizei Expiries[BUFFERSIZE]; -- cgit v1.2.3