aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2012-10-14 10:16:46 -0700
committerChris Robinson <[email protected]>2012-10-14 10:27:15 -0700
commit5ac0a93fbab37cfce1b1a2546295eee37e7ee2d4 (patch)
tree4671534ed04a5b8252532231d1ced55ae11ae31b
parentf7655d44a266a4eeadd7d14921363594b64ac15f (diff)
Mark some parameters as const and/or RESTRICT
-rw-r--r--Alc/alcDedicated.c2
-rw-r--r--Alc/alcEcho.c2
-rw-r--r--Alc/alcModulator.c5
-rw-r--r--Alc/alcReverb.c16
4 files changed, 13 insertions, 12 deletions
diff --git a/Alc/alcDedicated.c b/Alc/alcDedicated.c
index 2fb3dbbe..1d2cbc42 100644
--- a/Alc/alcDedicated.c
+++ b/Alc/alcDedicated.c
@@ -66,7 +66,7 @@ static ALvoid DedicatedUpdate(ALeffectState *effect, ALCdevice *device, const AL
state->gains[LFE] = Gain;
}
-static ALvoid DedicatedProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[BUFFERSIZE])
+static ALvoid DedicatedProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
{
ALdedicatedState *state = (ALdedicatedState*)effect;
const ALfloat *gains = state->gains;
diff --git a/Alc/alcEcho.c b/Alc/alcEcho.c
index 1a586488..9ca91747 100644
--- a/Alc/alcEcho.c
+++ b/Alc/alcEcho.c
@@ -126,7 +126,7 @@ static ALvoid EchoUpdate(ALeffectState *effect, ALCdevice *Device, const ALeffec
ComputeAngleGains(Device, atan2f(+lrpan, 0.0f), (1.0f-dirGain)*F_PI, gain, state->Gain[1]);
}
-static ALvoid EchoProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[BUFFERSIZE])
+static ALvoid EchoProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
{
ALechoState *state = (ALechoState*)effect;
const ALuint mask = state->BufferLength-1;
diff --git a/Alc/alcModulator.c b/Alc/alcModulator.c
index 46bf1717..de062151 100644
--- a/Alc/alcModulator.c
+++ b/Alc/alcModulator.c
@@ -84,7 +84,8 @@ static __inline ALfloat hpFilter1P(FILTER *iir, ALuint offset, ALfloat input)
#define DECL_TEMPLATE(func) \
static void Process##func(ALmodulatorState *state, ALuint SamplesToDo, \
- const ALfloat *SamplesIn, ALfloat (*SamplesOut)[BUFFERSIZE]) \
+ const ALfloat *RESTRICT SamplesIn, \
+ ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE]) \
{ \
const ALuint step = state->step; \
ALuint index = state->index; \
@@ -160,7 +161,7 @@ static ALvoid ModulatorUpdate(ALeffectState *effect, ALCdevice *Device, const AL
}
}
-static ALvoid ModulatorProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[BUFFERSIZE])
+static ALvoid ModulatorProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
{
ALmodulatorState *state = (ALmodulatorState*)effect;
diff --git a/Alc/alcReverb.c b/Alc/alcReverb.c
index c72d2e36..3181f87e 100644
--- a/Alc/alcReverb.c
+++ b/Alc/alcReverb.c
@@ -297,7 +297,7 @@ static __inline ALfloat EarlyDelayLineOut(ALverbState *State, ALuint index)
// Given an input sample, this function produces four-channel output for the
// early reflections.
-static __inline ALvoid EarlyReflection(ALverbState *State, ALfloat in, ALfloat *out)
+static __inline ALvoid EarlyReflection(ALverbState *State, ALfloat in, ALfloat *RESTRICT out)
{
ALfloat d[4], v, f[4];
@@ -368,7 +368,7 @@ static __inline ALfloat LateLowPassInOut(ALverbState *State, ALuint index, ALflo
// Given four decorrelated input samples, this function produces four-channel
// output for the late reverb.
-static __inline ALvoid LateReverb(ALverbState *State, ALfloat *in, ALfloat *out)
+static __inline ALvoid LateReverb(ALverbState *State, const ALfloat *RESTRICT in, ALfloat *RESTRICT out)
{
ALfloat d[4], f[4];
@@ -439,7 +439,7 @@ static __inline ALvoid LateReverb(ALverbState *State, ALfloat *in, ALfloat *out)
// Given an input sample, this function mixes echo into the four-channel late
// reverb.
-static __inline ALvoid EAXEcho(ALverbState *State, ALfloat in, ALfloat *late)
+static __inline ALvoid EAXEcho(ALverbState *State, ALfloat in, ALfloat *RESTRICT late)
{
ALfloat out, feed;
@@ -473,7 +473,7 @@ static __inline ALvoid EAXEcho(ALverbState *State, ALfloat in, ALfloat *late)
// Perform the non-EAX reverb pass on a given input sample, resulting in
// four-channel output.
-static __inline ALvoid VerbPass(ALverbState *State, ALfloat in, ALfloat *out)
+static __inline ALvoid VerbPass(ALverbState *State, ALfloat in, ALfloat *RESTRICT out)
{
ALfloat feed, late[4], taps[4];
@@ -512,7 +512,7 @@ static __inline ALvoid VerbPass(ALverbState *State, ALfloat in, ALfloat *out)
// Perform the EAX reverb pass on a given input sample, resulting in four-
// channel output.
-static __inline ALvoid EAXVerbPass(ALverbState *State, ALfloat in, ALfloat *early, ALfloat *late)
+static __inline ALvoid EAXVerbPass(ALverbState *State, ALfloat in, ALfloat *RESTRICT early, ALfloat *RESTRICT late)
{
ALfloat feed, taps[4];
@@ -551,7 +551,7 @@ static __inline ALvoid EAXVerbPass(ALverbState *State, ALfloat in, ALfloat *earl
// This processes the reverb state, given the input samples and an output
// buffer.
-static ALvoid VerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[BUFFERSIZE])
+static ALvoid VerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
{
ALverbState *State = (ALverbState*)effect;
ALuint index, c;
@@ -571,7 +571,7 @@ static ALvoid VerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALflo
// This processes the EAX reverb state, given the input samples and an output
// buffer.
-static ALvoid EAXVerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *SamplesIn, ALfloat (*SamplesOut)[BUFFERSIZE])
+static ALvoid EAXVerbProcess(ALeffectState *effect, ALuint SamplesToDo, const ALfloat *RESTRICT SamplesIn, ALfloat (*RESTRICT SamplesOut)[BUFFERSIZE])
{
ALverbState *State = (ALverbState*)effect;
ALuint index, c;
@@ -591,7 +591,7 @@ static ALvoid EAXVerbProcess(ALeffectState *effect, ALuint SamplesToDo, const AL
// Given the allocated sample buffer, this function updates each delay line
// offset.
-static __inline ALvoid RealizeLineOffset(ALfloat * sampleBuffer, DelayLine *Delay)
+static __inline ALvoid RealizeLineOffset(ALfloat *sampleBuffer, DelayLine *Delay)
{
Delay->Line = &sampleBuffer[(ALintptrEXT)Delay->Line];
}