From bf2c865d3953370ccf9d56e7a5dc6d2d4c587be1 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 16 Sep 2019 07:16:31 -0700 Subject: Clean up some more shadowing warnings --- al/source.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'al/source.cpp') 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(std::distance(context->mVoices.data(), voice)); voice->mPlayState.store(ALvoice::Stopped, std::memory_order_release); -- cgit v1.2.3