diff options
author | Chris Robinson <[email protected]> | 2013-05-28 22:27:07 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2013-05-28 22:27:07 -0700 |
commit | e96cc656e9c9176ba60cd191896fd6386a7fd74d (patch) | |
tree | b6deb2a859ca08a519f9ff2c1c3d9022eb698462 /Alc | |
parent | 48aa1e10d64d7c62cab856a0c5d7f9e140efbd6b (diff) |
Use C99's inline instead of __inline
Diffstat (limited to 'Alc')
-rw-r--r-- | Alc/ALu.c | 24 | ||||
-rw-r--r-- | Alc/effects/chorus.c | 4 | ||||
-rw-r--r-- | Alc/effects/flanger.c | 4 | ||||
-rw-r--r-- | Alc/effects/modulator.c | 6 | ||||
-rw-r--r-- | Alc/effects/reverb.c | 42 | ||||
-rw-r--r-- | Alc/mixer.c | 6 | ||||
-rw-r--r-- | Alc/mixer_c.c | 24 | ||||
-rw-r--r-- | Alc/mixer_inc.c | 18 | ||||
-rw-r--r-- | Alc/mixer_neon.c | 18 | ||||
-rw-r--r-- | Alc/mixer_sse.c | 18 |
10 files changed, 82 insertions, 82 deletions
@@ -105,20 +105,20 @@ static WetMixerFunc SelectSendMixer(void) } -static __inline void aluCrossproduct(const ALfloat *inVector1, const ALfloat *inVector2, ALfloat *outVector) +static inline void aluCrossproduct(const ALfloat *inVector1, const ALfloat *inVector2, ALfloat *outVector) { outVector[0] = inVector1[1]*inVector2[2] - inVector1[2]*inVector2[1]; outVector[1] = inVector1[2]*inVector2[0] - inVector1[0]*inVector2[2]; outVector[2] = inVector1[0]*inVector2[1] - inVector1[1]*inVector2[0]; } -static __inline ALfloat aluDotproduct(const ALfloat *inVector1, const ALfloat *inVector2) +static inline ALfloat aluDotproduct(const ALfloat *inVector1, const ALfloat *inVector2) { return inVector1[0]*inVector2[0] + inVector1[1]*inVector2[1] + inVector1[2]*inVector2[2]; } -static __inline void aluNormalize(ALfloat *inVector) +static inline void aluNormalize(ALfloat *inVector) { ALfloat lengthsqr = aluDotproduct(inVector, inVector); if(lengthsqr > 0.0f) @@ -130,7 +130,7 @@ static __inline void aluNormalize(ALfloat *inVector) } } -static __inline ALvoid aluMatrixVector(ALfloat *vector, ALfloat w, ALfloat (*restrict matrix)[4]) +static inline ALvoid aluMatrixVector(ALfloat *vector, ALfloat w, ALfloat (*restrict matrix)[4]) { ALfloat temp[4] = { vector[0], vector[1], vector[2], w @@ -917,7 +917,7 @@ ALvoid CalcSourceParams(ALsource *ALSource, const ALCcontext *ALContext) } -static __inline ALint aluF2I25(ALfloat val) +static inline ALint aluF2I25(ALfloat val) { /* Clamp the value between -1 and +1. This handles that with only a single branch. */ if(fabsf(val) > 1.0f) @@ -926,19 +926,19 @@ static __inline ALint aluF2I25(ALfloat val) return fastf2i(val*16777215.0f); } -static __inline ALfloat aluF2F(ALfloat val) +static inline ALfloat aluF2F(ALfloat val) { return val; } -static __inline ALint aluF2I(ALfloat val) +static inline ALint aluF2I(ALfloat val) { return aluF2I25(val)<<7; } -static __inline ALuint aluF2UI(ALfloat val) +static inline ALuint aluF2UI(ALfloat val) { return aluF2I(val)+2147483648u; } -static __inline ALshort aluF2S(ALfloat val) +static inline ALshort aluF2S(ALfloat val) { return aluF2I25(val)>>9; } -static __inline ALushort aluF2US(ALfloat val) +static inline ALushort aluF2US(ALfloat val) { return aluF2S(val)+32768; } -static __inline ALbyte aluF2B(ALfloat val) +static inline ALbyte aluF2B(ALfloat val) { return aluF2I25(val)>>17; } -static __inline ALubyte aluF2UB(ALfloat val) +static inline ALubyte aluF2UB(ALfloat val) { return aluF2B(val)+128; } #define DECL_TEMPLATE(T, func) \ diff --git a/Alc/effects/chorus.c b/Alc/effects/chorus.c index 34caf62d..2c3aa742 100644 --- a/Alc/effects/chorus.c +++ b/Alc/effects/chorus.c @@ -147,7 +147,7 @@ static ALvoid ALchorusState_Update(ALchorusState *state, ALCdevice *Device, cons state->lfo_disp = fastf2i(frequency / rate / (360.0f/phase)); } -static __inline void Triangle(ALint *delay_left, ALint *delay_right, ALint offset, const ALchorusState *state) +static inline void Triangle(ALint *delay_left, ALint *delay_right, ALint offset, const ALchorusState *state) { ALfloat lfo_value; @@ -162,7 +162,7 @@ static __inline void Triangle(ALint *delay_left, ALint *delay_right, ALint offse *delay_right = fastf2i(lfo_value) + state->delay; } -static __inline void Sinusoid(ALint *delay_left, ALint *delay_right, ALint offset, const ALchorusState *state) +static inline void Sinusoid(ALint *delay_left, ALint *delay_right, ALint offset, const ALchorusState *state) { ALfloat lfo_value; diff --git a/Alc/effects/flanger.c b/Alc/effects/flanger.c index 28499cd1..86b067d5 100644 --- a/Alc/effects/flanger.c +++ b/Alc/effects/flanger.c @@ -147,7 +147,7 @@ static ALvoid ALflangerState_Update(ALflangerState *state, ALCdevice *Device, co state->lfo_disp = fastf2i(frequency / rate / (360.0f/phase)); } -static __inline void Triangle(ALint *delay_left, ALint *delay_right, ALint offset, const ALflangerState *state) +static inline void Triangle(ALint *delay_left, ALint *delay_right, ALint offset, const ALflangerState *state) { ALfloat lfo_value; @@ -162,7 +162,7 @@ static __inline void Triangle(ALint *delay_left, ALint *delay_right, ALint offse *delay_right = fastf2i(lfo_value) + state->delay; } -static __inline void Sinusoid(ALint *delay_left, ALint *delay_right, ALint offset, const ALflangerState *state) +static inline void Sinusoid(ALint *delay_left, ALint *delay_right, ALint offset, const ALflangerState *state) { ALfloat lfo_value; diff --git a/Alc/effects/modulator.c b/Alc/effects/modulator.c index 930be059..d253614c 100644 --- a/Alc/effects/modulator.c +++ b/Alc/effects/modulator.c @@ -58,17 +58,17 @@ typedef struct ALmodulatorState { #define WAVEFORM_FRACONE (1<<WAVEFORM_FRACBITS) #define WAVEFORM_FRACMASK (WAVEFORM_FRACONE-1) -static __inline ALfloat Sin(ALuint index) +static inline ALfloat Sin(ALuint index) { return sinf(index * (F_PI*2.0f / WAVEFORM_FRACONE) - F_PI)*0.5f + 0.5f; } -static __inline ALfloat Saw(ALuint index) +static inline ALfloat Saw(ALuint index) { return (ALfloat)index / WAVEFORM_FRACONE; } -static __inline ALfloat Square(ALuint index) +static inline ALfloat Square(ALuint index) { return (ALfloat)((index >> (WAVEFORM_FRACBITS - 1)) & 1); } diff --git a/Alc/effects/reverb.c b/Alc/effects/reverb.c index 74f2368c..e17a0833 100644 --- a/Alc/effects/reverb.c +++ b/Alc/effects/reverb.c @@ -230,24 +230,24 @@ static const ALfloat LATE_LINE_MULTIPLIER = 4.0f; // Basic delay line input/output routines. -static __inline ALfloat DelayLineOut(DelayLine *Delay, ALuint offset) +static inline ALfloat DelayLineOut(DelayLine *Delay, ALuint offset) { return Delay->Line[offset&Delay->Mask]; } -static __inline ALvoid DelayLineIn(DelayLine *Delay, ALuint offset, ALfloat in) +static inline ALvoid DelayLineIn(DelayLine *Delay, ALuint offset, ALfloat in) { Delay->Line[offset&Delay->Mask] = in; } // Attenuated delay line output routine. -static __inline ALfloat AttenuatedDelayLineOut(DelayLine *Delay, ALuint offset, ALfloat coeff) +static inline ALfloat AttenuatedDelayLineOut(DelayLine *Delay, ALuint offset, ALfloat coeff) { return coeff * Delay->Line[offset&Delay->Mask]; } // Basic attenuated all-pass input/output routine. -static __inline ALfloat AllpassInOut(DelayLine *Delay, ALuint outOffset, ALuint inOffset, ALfloat in, ALfloat feedCoeff, ALfloat coeff) +static inline ALfloat AllpassInOut(DelayLine *Delay, ALuint outOffset, ALuint inOffset, ALfloat in, ALfloat feedCoeff, ALfloat coeff) { ALfloat out, feed; @@ -263,7 +263,7 @@ static __inline ALfloat AllpassInOut(DelayLine *Delay, ALuint outOffset, ALuint // Given an input sample, this function produces modulation for the late // reverb. -static __inline ALfloat EAXModulation(ALreverbState *State, ALfloat in) +static inline ALfloat EAXModulation(ALreverbState *State, ALfloat in) { ALfloat sinus, frac; ALuint offset; @@ -300,7 +300,7 @@ static __inline ALfloat EAXModulation(ALreverbState *State, ALfloat in) } // Delay line output routine for early reflections. -static __inline ALfloat EarlyDelayLineOut(ALreverbState *State, ALuint index) +static inline ALfloat EarlyDelayLineOut(ALreverbState *State, ALuint index) { return AttenuatedDelayLineOut(&State->Early.Delay[index], State->Offset - State->Early.Offset[index], @@ -309,7 +309,7 @@ static __inline ALfloat EarlyDelayLineOut(ALreverbState *State, ALuint index) // Given an input sample, this function produces four-channel output for the // early reflections. -static __inline ALvoid EarlyReflection(ALreverbState *State, ALfloat in, ALfloat *restrict out) +static inline ALvoid EarlyReflection(ALreverbState *State, ALfloat in, ALfloat *restrict out) { ALfloat d[4], v, f[4]; @@ -354,7 +354,7 @@ static __inline ALvoid EarlyReflection(ALreverbState *State, ALfloat in, ALfloat } // All-pass input/output routine for late reverb. -static __inline ALfloat LateAllPassInOut(ALreverbState *State, ALuint index, ALfloat in) +static inline ALfloat LateAllPassInOut(ALreverbState *State, ALuint index, ALfloat in) { return AllpassInOut(&State->Late.ApDelay[index], State->Offset - State->Late.ApOffset[index], @@ -363,7 +363,7 @@ static __inline ALfloat LateAllPassInOut(ALreverbState *State, ALuint index, ALf } // Delay line output routine for late reverb. -static __inline ALfloat LateDelayLineOut(ALreverbState *State, ALuint index) +static inline ALfloat LateDelayLineOut(ALreverbState *State, ALuint index) { return AttenuatedDelayLineOut(&State->Late.Delay[index], State->Offset - State->Late.Offset[index], @@ -371,7 +371,7 @@ static __inline ALfloat LateDelayLineOut(ALreverbState *State, ALuint index) } // Low-pass filter input/output routine for late reverb. -static __inline ALfloat LateLowPassInOut(ALreverbState *State, ALuint index, ALfloat in) +static inline ALfloat LateLowPassInOut(ALreverbState *State, ALuint index, ALfloat in) { in = lerp(in, State->Late.LpSample[index], State->Late.LpCoeff[index]); State->Late.LpSample[index] = in; @@ -380,7 +380,7 @@ static __inline ALfloat LateLowPassInOut(ALreverbState *State, ALuint index, ALf // Given four decorrelated input samples, this function produces four-channel // output for the late reverb. -static __inline ALvoid LateReverb(ALreverbState *State, const ALfloat *restrict in, ALfloat *restrict out) +static inline ALvoid LateReverb(ALreverbState *State, const ALfloat *restrict in, ALfloat *restrict out) { ALfloat d[4], f[4]; @@ -451,7 +451,7 @@ static __inline ALvoid LateReverb(ALreverbState *State, const ALfloat *restrict // Given an input sample, this function mixes echo into the four-channel late // reverb. -static __inline ALvoid EAXEcho(ALreverbState *State, ALfloat in, ALfloat *restrict late) +static inline ALvoid EAXEcho(ALreverbState *State, ALfloat in, ALfloat *restrict late) { ALfloat out, feed; @@ -485,7 +485,7 @@ static __inline ALvoid EAXEcho(ALreverbState *State, ALfloat in, ALfloat *restri // Perform the non-EAX reverb pass on a given input sample, resulting in // four-channel output. -static __inline ALvoid VerbPass(ALreverbState *State, ALfloat in, ALfloat *restrict out) +static inline ALvoid VerbPass(ALreverbState *State, ALfloat in, ALfloat *restrict out) { ALfloat feed, late[4], taps[4]; @@ -524,7 +524,7 @@ static __inline ALvoid VerbPass(ALreverbState *State, ALfloat in, ALfloat *restr // Perform the EAX reverb pass on a given input sample, resulting in four- // channel output. -static __inline ALvoid EAXVerbPass(ALreverbState *State, ALfloat in, ALfloat *restrict early, ALfloat *restrict late) +static inline ALvoid EAXVerbPass(ALreverbState *State, ALfloat in, ALfloat *restrict early, ALfloat *restrict late) { ALfloat feed, taps[4]; @@ -619,7 +619,7 @@ static ALvoid ALreverbState_Process(ALreverbState *State, ALuint SamplesToDo, co // 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]; } @@ -765,28 +765,28 @@ static ALboolean ALreverbState_DeviceUpdate(ALreverbState *State, ALCdevice *Dev // Calculate a decay coefficient given the length of each cycle and the time // until the decay reaches -60 dB. -static __inline ALfloat CalcDecayCoeff(ALfloat length, ALfloat decayTime) +static inline ALfloat CalcDecayCoeff(ALfloat length, ALfloat decayTime) { return powf(0.001f/*-60 dB*/, length/decayTime); } // Calculate a decay length from a coefficient and the time until the decay // reaches -60 dB. -static __inline ALfloat CalcDecayLength(ALfloat coeff, ALfloat decayTime) +static inline ALfloat CalcDecayLength(ALfloat coeff, ALfloat decayTime) { return log10f(coeff) * decayTime / log10f(0.001f)/*-60 dB*/; } // Calculate the high frequency parameter for the I3DL2 coefficient // calculation. -static __inline ALfloat CalcI3DL2HFreq(ALfloat hfRef, ALuint frequency) +static inline ALfloat CalcI3DL2HFreq(ALfloat hfRef, ALuint frequency) { return cosf(F_PI*2.0f * hfRef / frequency); } // Calculate an attenuation to be applied to the input of any echo models to // compensate for modal density and decay time. -static __inline ALfloat CalcDensityGain(ALfloat a) +static inline ALfloat CalcDensityGain(ALfloat a) { /* The energy of a signal can be obtained by finding the area under the * squared signal. This takes the form of Sum(x_n^2), where x is the @@ -805,7 +805,7 @@ static __inline ALfloat CalcDensityGain(ALfloat a) } // Calculate the mixing matrix coefficients given a diffusion factor. -static __inline ALvoid CalcMatrixCoeffs(ALfloat diffusion, ALfloat *x, ALfloat *y) +static inline ALvoid CalcMatrixCoeffs(ALfloat diffusion, ALfloat *x, ALfloat *y) { ALfloat n, t; @@ -840,7 +840,7 @@ static ALfloat CalcLimitedHfRatio(ALfloat hfRatio, ALfloat airAbsorptionGainHF, // Calculate the coefficient for a HF (and eventually LF) decay damping // filter. -static __inline ALfloat CalcDampingCoeff(ALfloat hfRatio, ALfloat length, ALfloat decayTime, ALfloat decayCoeff, ALfloat cw) +static inline ALfloat CalcDampingCoeff(ALfloat hfRatio, ALfloat length, ALfloat decayTime, ALfloat decayCoeff, ALfloat cw) { ALfloat coeff, g; diff --git a/Alc/mixer.c b/Alc/mixer.c index b9dcc1c1..0dafe874 100644 --- a/Alc/mixer.c +++ b/Alc/mixer.c @@ -37,13 +37,13 @@ #include "bs2b.h" -static __inline ALfloat Sample_ALbyte(ALbyte val) +static inline ALfloat Sample_ALbyte(ALbyte val) { return val * (1.0f/127.0f); } -static __inline ALfloat Sample_ALshort(ALshort val) +static inline ALfloat Sample_ALshort(ALshort val) { return val * (1.0f/32767.0f); } -static __inline ALfloat Sample_ALfloat(ALfloat val) +static inline ALfloat Sample_ALfloat(ALfloat val) { return val; } #define DECL_TEMPLATE(T) \ diff --git a/Alc/mixer_c.c b/Alc/mixer_c.c index 94257504..2cfbcedc 100644 --- a/Alc/mixer_c.c +++ b/Alc/mixer_c.c @@ -8,11 +8,11 @@ #include "alAuxEffectSlot.h" -static __inline ALfloat point32(const ALfloat *vals, ALuint frac) +static inline ALfloat point32(const ALfloat *vals, ALuint frac) { return vals[0]; (void)frac; } -static __inline ALfloat lerp32(const ALfloat *vals, ALuint frac) +static inline ALfloat lerp32(const ALfloat *vals, ALuint frac) { return lerp(vals[0], vals[1], frac * (1.0f/FRACTIONONE)); } -static __inline ALfloat cubic32(const ALfloat *vals, ALuint frac) +static inline ALfloat cubic32(const ALfloat *vals, ALuint frac) { return cubic(vals[-1], vals[0], vals[1], vals[2], frac * (1.0f/FRACTIONONE)); } void Resample_copy32_C(const ALfloat *data, ALuint frac, @@ -47,11 +47,11 @@ DECL_TEMPLATE(cubic32) #undef DECL_TEMPLATE -static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], - const ALuint IrSize, - ALfloat (*restrict Coeffs)[2], - const ALfloat (*restrict CoeffStep)[2], - ALfloat left, ALfloat right) +static inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], + const ALuint IrSize, + ALfloat (*restrict Coeffs)[2], + const ALfloat (*restrict CoeffStep)[2], + ALfloat left, ALfloat right) { ALuint c; for(c = 0;c < IrSize;c++) @@ -64,10 +64,10 @@ static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2 } } -static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], - const ALuint IrSize, - ALfloat (*restrict Coeffs)[2], - ALfloat left, ALfloat right) +static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], + const ALuint IrSize, + ALfloat (*restrict Coeffs)[2], + ALfloat left, ALfloat right) { ALuint c; for(c = 0;c < IrSize;c++) diff --git a/Alc/mixer_inc.c b/Alc/mixer_inc.c index 08387220..6cffba66 100644 --- a/Alc/mixer_inc.c +++ b/Alc/mixer_inc.c @@ -18,15 +18,15 @@ #define MixDirect_Hrtf MERGE2(MixDirect_Hrtf_,SUFFIX) -static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], - const ALuint irSize, - ALfloat (*restrict Coeffs)[2], - const ALfloat (*restrict CoeffStep)[2], - ALfloat left, ALfloat right); -static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], - const ALuint irSize, - ALfloat (*restrict Coeffs)[2], - ALfloat left, ALfloat right); +static inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], + const ALuint irSize, + ALfloat (*restrict Coeffs)[2], + const ALfloat (*restrict CoeffStep)[2], + ALfloat left, ALfloat right); +static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], + const ALuint irSize, + ALfloat (*restrict Coeffs)[2], + ALfloat left, ALfloat right); void MixDirect_Hrtf(const DirectParams *params, const ALfloat *restrict data, ALuint srcchan, diff --git a/Alc/mixer_neon.c b/Alc/mixer_neon.c index 3006194c..4b80be5e 100644 --- a/Alc/mixer_neon.c +++ b/Alc/mixer_neon.c @@ -10,11 +10,11 @@ #include "alu.h" -static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], - const ALuint IrSize, - ALfloat (*restrict Coeffs)[2], - const ALfloat (*restrict CoeffStep)[2], - ALfloat left, ALfloat right) +static inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], + const ALuint IrSize, + ALfloat (*restrict Coeffs)[2], + const ALfloat (*restrict CoeffStep)[2], + ALfloat left, ALfloat right) { ALuint c; for(c = 0;c < IrSize;c++) @@ -27,10 +27,10 @@ static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2 } } -static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], - const ALuint IrSize, - ALfloat (*restrict Coeffs)[2], - ALfloat left, ALfloat right) +static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], + const ALuint IrSize, + ALfloat (*restrict Coeffs)[2], + ALfloat left, ALfloat right) { ALuint c; float32x4_t leftright4; diff --git a/Alc/mixer_sse.c b/Alc/mixer_sse.c index 2cb3db98..95893277 100644 --- a/Alc/mixer_sse.c +++ b/Alc/mixer_sse.c @@ -14,11 +14,11 @@ #include "mixer_defs.h" -static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], - const ALuint IrSize, - ALfloat (*restrict Coeffs)[2], - const ALfloat (*restrict CoeffStep)[2], - ALfloat left, ALfloat right) +static inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2], + const ALuint IrSize, + ALfloat (*restrict Coeffs)[2], + const ALfloat (*restrict CoeffStep)[2], + ALfloat left, ALfloat right) { const __m128 lrlr = { left, right, left, right }; __m128 coeffs, deltas, imp0, imp1; @@ -76,10 +76,10 @@ static __inline void ApplyCoeffsStep(ALuint Offset, ALfloat (*restrict Values)[2 } } -static __inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], - const ALuint IrSize, - ALfloat (*restrict Coeffs)[2], - ALfloat left, ALfloat right) +static inline void ApplyCoeffs(ALuint Offset, ALfloat (*restrict Values)[2], + const ALuint IrSize, + ALfloat (*restrict Coeffs)[2], + ALfloat left, ALfloat right) { const __m128 lrlr = { left, right, left, right }; __m128 vals = _mm_setzero_ps(); |