diff options
author | Chris Robinson <[email protected]> | 2018-09-30 12:12:27 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2018-09-30 12:12:27 -0700 |
commit | 1d1acc0c34228f68ccfed25ec61fb6982233ab2e (patch) | |
tree | 37fa1b414d6ba9976618b4ccfab39118d533b105 | |
parent | 1860b2ec8a1927ce98e516f498dbdf19419ae0a6 (diff) |
Ensure BUFFERSIZE is a power of 2
-rw-r--r-- | Alc/mastering.c | 6 |
1 files 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]; |