diff options
author | Chris Robinson <[email protected]> | 2023-10-15 02:38:20 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2023-10-15 02:38:20 -0700 |
commit | bfee94dfec64dd22ad8d985e71803fbe411f7a1a (patch) | |
tree | 1336374fa65a1eed4dcc790b4707dde13341a765 /core | |
parent | 5619de5ca05684656f32eafd8cfc987fb6161d97 (diff) |
Use a span for a known array length instead of a raw pointer
Diffstat (limited to 'core')
-rw-r--r-- | core/mixer.cpp | 7 | ||||
-rw-r--r-- | core/mixer.h | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/core/mixer.cpp b/core/mixer.cpp index 066c57bd..806ac8b8 100644 --- a/core/mixer.cpp +++ b/core/mixer.cpp @@ -82,14 +82,13 @@ std::array<float,MaxAmbiChannels> CalcAmbiCoeffs(const float y, const float z, c return coeffs; } -void ComputePanGains(const MixParams *mix, const float*RESTRICT coeffs, const float ingain, - const al::span<float,MaxAmbiChannels> gains) +void ComputePanGains(const MixParams *mix, const al::span<const float,MaxAmbiChannels> coeffs, + const float ingain, const al::span<float,MaxAmbiChannels> gains) { auto ambimap = mix->AmbiMap.cbegin(); auto iter = std::transform(ambimap, ambimap+mix->Buffer.size(), gains.begin(), [coeffs,ingain](const BFChannelConfig &chanmap) noexcept -> float - { return chanmap.Scale * coeffs[chanmap.Index] * ingain; } - ); + { return chanmap.Scale * coeffs[chanmap.Index] * ingain; }); std::fill(iter, gains.end(), 0.0f); } diff --git a/core/mixer.h b/core/mixer.h index a9c1f931..9062ebac 100644 --- a/core/mixer.h +++ b/core/mixer.h @@ -103,7 +103,7 @@ inline std::array<float,MaxAmbiChannels> CalcAngleCoeffs(const float azimuth, * coeffs are a 'slice' of a transform matrix for the input channel, used to * scale and orient the sound samples. */ -void ComputePanGains(const MixParams *mix, const float*RESTRICT coeffs, const float ingain, - const al::span<float,MaxAmbiChannels> gains); +void ComputePanGains(const MixParams *mix, const al::span<const float,MaxAmbiChannels> coeffs, + const float ingain, const al::span<float,MaxAmbiChannels> gains); #endif /* CORE_MIXER_H */ |