From ebf33b7c6b747b647eb2177080dc6f46db89867b Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sat, 25 May 2019 08:17:37 -0700 Subject: Avoid some uses of RESTRICT --- Alc/mixer/mixer_c.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'Alc/mixer') diff --git a/Alc/mixer/mixer_c.cpp b/Alc/mixer/mixer_c.cpp index 1c22115d..6ee5df88 100644 --- a/Alc/mixer/mixer_c.cpp +++ b/Alc/mixer/mixer_c.cpp @@ -12,13 +12,15 @@ #include "hrtfbase.h" -static inline ALfloat do_point(const InterpState&, const ALfloat *RESTRICT vals, const ALsizei) noexcept +namespace { + +inline ALfloat do_point(const InterpState&, const ALfloat *RESTRICT vals, const ALsizei) noexcept { return vals[0]; } -static inline ALfloat do_lerp(const InterpState&, const ALfloat *RESTRICT vals, const ALsizei frac) noexcept +inline ALfloat do_lerp(const InterpState&, const ALfloat *RESTRICT vals, const ALsizei frac) noexcept { return lerp(vals[0], vals[1], frac * (1.0f/FRACTIONONE)); } -static inline ALfloat do_cubic(const InterpState&, const ALfloat *RESTRICT vals, const ALsizei frac) noexcept +inline ALfloat do_cubic(const InterpState&, const ALfloat *RESTRICT vals, const ALsizei frac) noexcept { return cubic(vals[0], vals[1], vals[2], vals[3], frac * (1.0f/FRACTIONONE)); } -static inline ALfloat do_bsinc(const InterpState &istate, const ALfloat *RESTRICT vals, const ALsizei frac) noexcept +inline ALfloat do_bsinc(const InterpState &istate, const ALfloat *RESTRICT vals, const ALsizei frac) noexcept { ASSUME(istate.bsinc.m > 0); @@ -42,9 +44,8 @@ static inline ALfloat do_bsinc(const InterpState &istate, const ALfloat *RESTRIC using SamplerT = ALfloat(const InterpState&, const ALfloat*RESTRICT, const ALsizei); template -static const ALfloat *DoResample(const InterpState *state, const ALfloat *RESTRICT src, - ALsizei frac, ALint increment, ALfloat *RESTRICT dst, - ALsizei numsamples) +const ALfloat *DoResample(const InterpState *state, const ALfloat *RESTRICT src, + ALsizei frac, ALint increment, ALfloat *RESTRICT dst, ALsizei numsamples) { ASSUME(numsamples > 0); ASSUME(increment > 0); @@ -61,11 +62,12 @@ static const ALfloat *DoResample(const InterpState *state, const ALfloat *RESTRI return ret; }; - std::generate_n(dst, numsamples, proc_sample); + std::generate_n(dst, numsamples, proc_sample); return dst; } +} // namespace template<> const ALfloat *Resample_(const InterpState* UNUSED(state), -- cgit v1.2.3