aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/alu.cpp7
-rw-r--r--OpenAL32/alSource.cpp9
2 files changed, 9 insertions, 7 deletions
diff --git a/Alc/alu.cpp b/Alc/alu.cpp
index 1ebf3adc..e9d251fc 100644
--- a/Alc/alu.cpp
+++ b/Alc/alu.cpp
@@ -29,6 +29,7 @@
#include <cmath>
#include <limits>
#include <algorithm>
+#include <functional>
#include "alMain.h"
#include "alcontext.h"
@@ -53,6 +54,8 @@
namespace {
+using namespace std::placeholders;
+
ALfloat InitConeScale()
{
ALfloat ret{1.0f};
@@ -1418,9 +1421,7 @@ void CalcSourceParams(ALvoice *voice, ALCcontext *context, bool force)
{
auto buffers_end = BufferListItem->buffers+BufferListItem->num_buffers;
auto buffer = std::find_if(BufferListItem->buffers, buffers_end,
- [](const ALbuffer *buffer) noexcept -> bool
- { return buffer != nullptr; }
- );
+ std::bind(std::not_equal_to<const ALbuffer*>{}, _1, nullptr));
if(LIKELY(buffer != buffers_end))
{
if(voice->Props.mSpatializeMode==SpatializeOn ||
diff --git a/OpenAL32/alSource.cpp b/OpenAL32/alSource.cpp
index 03375e2d..6db7161a 100644
--- a/OpenAL32/alSource.cpp
+++ b/OpenAL32/alSource.cpp
@@ -28,6 +28,7 @@
#include <thread>
#include <limits>
#include <algorithm>
+#include <functional>
#include "AL/al.h"
#include "AL/alc.h"
@@ -49,6 +50,8 @@
namespace {
+using namespace std::placeholders;
+
inline ALvoice *GetSourceVoice(ALsource *source, ALCcontext *context)
{
ALint idx{source->VoiceIdx};
@@ -465,7 +468,7 @@ ALsource *AllocSource(ALCcontext *context)
return nullptr;
}
auto sublist = std::find_if(context->SourceList.begin(), context->SourceList.end(),
- [](const SourceSubList &entry) -> bool
+ [](const SourceSubList &entry) noexcept -> bool
{ return entry.FreeMask != 0; }
);
auto lidx = static_cast<ALsizei>(std::distance(context->SourceList.begin(), sublist));
@@ -2812,9 +2815,7 @@ AL_API ALvoid AL_APIENTRY alSourcePlayv(ALsizei n, const ALuint *sources)
auto buffers_end = BufferList->buffers + BufferList->num_buffers;
auto buffer = std::find_if(BufferList->buffers, buffers_end,
- [](const ALbuffer *buffer) noexcept -> bool
- { return buffer != nullptr; }
- );
+ std::bind(std::not_equal_to<const ALbuffer*>{}, _1, nullptr));
if(buffer != buffers_end)
{
voice->NumChannels = ChannelsFromFmt((*buffer)->mFmtChannels);