aboutsummaryrefslogtreecommitdiffstats
path: root/Alc
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-04-21 02:44:01 -0700
committerChris Robinson <[email protected]>2018-04-21 02:44:01 -0700
commit4ee26f4ca3dc952dc9d7fdf58b735396b798df9c (patch)
tree819734490a330b1282cfeeff2c5aecfae2031e3f /Alc
parenta55c93e1f59dfadda64a63e4c1b0881ca34dbad8 (diff)
Add some more ASSUME statements
Diffstat (limited to 'Alc')
-rw-r--r--Alc/hrtf.c1
-rw-r--r--Alc/mixer/mixer_c.c2
-rw-r--r--Alc/mixer/mixer_neon.c2
-rw-r--r--Alc/mixer/mixer_sse.c2
4 files changed, 7 insertions, 0 deletions
diff --git a/Alc/hrtf.c b/Alc/hrtf.c
index fb2e0068..fe71800b 100644
--- a/Alc/hrtf.c
+++ b/Alc/hrtf.c
@@ -173,6 +173,7 @@ void GetHrtfCoeffs(const struct Hrtf *Hrtf, ALfloat elevation, ALfloat azimuth,
idx[2] *= Hrtf->irSize;
idx[3] *= Hrtf->irSize;
+ ASSUME(Hrtf->irSize >= MIN_IR_SIZE && (Hrtf->irSize%MOD_IR_SIZE) == 0);
coeffs = ASSUME_ALIGNED(coeffs, 16);
/* Calculate the blended HRIR coefficients. */
coeffs[0][0] = PassthruCoeff * (1.0f-dirfact);
diff --git a/Alc/mixer/mixer_c.c b/Alc/mixer/mixer_c.c
index 05b7932d..84485206 100644
--- a/Alc/mixer/mixer_c.c
+++ b/Alc/mixer/mixer_c.c
@@ -122,6 +122,7 @@ void Mix_C(const ALfloat *data, ALsizei OutChans, ALfloat (*restrict OutBuffer)[
ALfloat gain, delta, step;
ALsizei c;
+ ASSUME(OutChans > 0);
ASSUME(BufferSize > 0);
delta = (Counter > 0) ? 1.0f/(ALfloat)Counter : 0.0f;
@@ -160,6 +161,7 @@ void MixRow_C(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*restrict
{
ALsizei c, i;
+ ASSUME(InChans > 0);
ASSUME(BufferSize > 0);
for(c = 0;c < InChans;c++)
diff --git a/Alc/mixer/mixer_neon.c b/Alc/mixer/mixer_neon.c
index 1413d1c1..1a5e8ee7 100644
--- a/Alc/mixer/mixer_neon.c
+++ b/Alc/mixer/mixer_neon.c
@@ -169,6 +169,7 @@ void Mix_Neon(const ALfloat *data, ALsizei OutChans, ALfloat (*restrict OutBuffe
float32x4_t gain4;
ALsizei c;
+ ASSUME(OutChans > 0);
ASSUME(BufferSize > 0);
data = ASSUME_ALIGNED(data, 16);
OutBuffer = ASSUME_ALIGNED(OutBuffer, 16);
@@ -242,6 +243,7 @@ void MixRow_Neon(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*restr
float32x4_t gain4;
ALsizei c;
+ ASSUME(InChans > 0);
ASSUME(BufferSize > 0);
data = ASSUME_ALIGNED(data, 16);
OutBuffer = ASSUME_ALIGNED(OutBuffer, 16);
diff --git a/Alc/mixer/mixer_sse.c b/Alc/mixer/mixer_sse.c
index 81dc0a34..a178477f 100644
--- a/Alc/mixer/mixer_sse.c
+++ b/Alc/mixer/mixer_sse.c
@@ -139,6 +139,7 @@ void Mix_SSE(const ALfloat *data, ALsizei OutChans, ALfloat (*restrict OutBuffer
__m128 gain4;
ALsizei c;
+ ASSUME(OutChans > 0);
ASSUME(BufferSize > 0);
delta = (Counter > 0) ? 1.0f/(ALfloat)Counter : 0.0f;
@@ -211,6 +212,7 @@ void MixRow_SSE(ALfloat *OutBuffer, const ALfloat *Gains, const ALfloat (*restri
__m128 gain4;
ALsizei c;
+ ASSUME(InChans > 0);
ASSUME(BufferSize > 0);
for(c = 0;c < InChans;c++)