diff options
author | Chris Robinson <[email protected]> | 2019-09-16 07:16:31 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-09-16 07:16:31 -0700 |
commit | bf2c865d3953370ccf9d56e7a5dc6d2d4c587be1 (patch) | |
tree | bf9dd4ec305dfc61dd5d899d883453e94f0612f3 /al/source.cpp | |
parent | e16e2269b6a18c960a25d58f43ffad5ed408bee9 (diff) |
Clean up some more shadowing warnings
Diffstat (limited to 'al/source.cpp')
-rw-r--r-- | al/source.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/al/source.cpp b/al/source.cpp index 53d2a705..f5550caf 100644 --- a/al/source.cpp +++ b/al/source.cpp @@ -2749,15 +2749,15 @@ START_API_FUNC } /* Look for an unused voice to play this source with. */ + auto find_voice = [](const ALvoice &v) noexcept -> bool + { + return v.mPlayState.load(std::memory_order_acquire) == ALvoice::Stopped + && v.mSourceID.load(std::memory_order_relaxed) == 0u; + }; auto voices_end = context->mVoices.data() + context->mVoices.size(); - voice = std::find_if(context->mVoices.data(), voices_end, - [](const ALvoice &voice) noexcept -> bool - { - return voice.mPlayState.load(std::memory_order_acquire) == ALvoice::Stopped && - voice.mSourceID.load(std::memory_order_relaxed) == 0u; - } - ); + voice = std::find_if(context->mVoices.data(), voices_end, find_voice); assert(voice != voices_end); + auto vidx = static_cast<ALuint>(std::distance(context->mVoices.data(), voice)); voice->mPlayState.store(ALvoice::Stopped, std::memory_order_release); |