From 3ae1c78d1ac07cd22727296488a399c48597fd15 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Mon, 19 Nov 2018 09:51:29 -0800 Subject: [PATCH] Use std::isfinite instead of isfinite --- Alc/effects/dedicated.cpp | 3 ++- Alc/effects/reverb.cpp | 5 +++-- OpenAL32/alListener.cpp | 12 +++++++----- OpenAL32/alState.cpp | 7 ++++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Alc/effects/dedicated.cpp b/Alc/effects/dedicated.cpp index 59f31b52..f91458b3 100644 --- a/Alc/effects/dedicated.cpp +++ b/Alc/effects/dedicated.cpp @@ -21,6 +21,7 @@ #include "config.h" #include +#include #include "alMain.h" #include "alcontext.h" @@ -142,7 +143,7 @@ void ALdedicated_setParamf(ALeffect *effect, ALCcontext *context, ALenum param, switch(param) { case AL_DEDICATED_GAIN: - if(!(val >= 0.0f && isfinite(val))) + if(!(val >= 0.0f && std::isfinite(val))) SETERR_RETURN(context, AL_INVALID_VALUE,, "Dedicated gain out of range"); props->Dedicated.Gain = val; break; diff --git a/Alc/effects/reverb.cpp b/Alc/effects/reverb.cpp index 64676ed2..8b63e473 100644 --- a/Alc/effects/reverb.cpp +++ b/Alc/effects/reverb.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include "alMain.h" @@ -1741,14 +1742,14 @@ void ALeaxreverb_setParamfv(ALeffect *effect, ALCcontext *context, ALenum param, switch(param) { case AL_EAXREVERB_REFLECTIONS_PAN: - if(!(isfinite(vals[0]) && isfinite(vals[1]) && isfinite(vals[2]))) + if(!(std::isfinite(vals[0]) && std::isfinite(vals[1]) && std::isfinite(vals[2]))) SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb reflections pan out of range"); props->Reverb.ReflectionsPan[0] = vals[0]; props->Reverb.ReflectionsPan[1] = vals[1]; props->Reverb.ReflectionsPan[2] = vals[2]; break; case AL_EAXREVERB_LATE_REVERB_PAN: - if(!(isfinite(vals[0]) && isfinite(vals[1]) && isfinite(vals[2]))) + if(!(std::isfinite(vals[0]) && std::isfinite(vals[1]) && std::isfinite(vals[2]))) SETERR_RETURN(context, AL_INVALID_VALUE,, "EAX Reverb late reverb pan out of range"); props->Reverb.LateReverbPan[0] = vals[0]; props->Reverb.LateReverbPan[1] = vals[1]; diff --git a/OpenAL32/alListener.cpp b/OpenAL32/alListener.cpp index bf1ac3f9..d60f5254 100644 --- a/OpenAL32/alListener.cpp +++ b/OpenAL32/alListener.cpp @@ -20,6 +20,8 @@ #include "config.h" +#include + #include "alMain.h" #include "alcontext.h" #include "alu.h" @@ -48,7 +50,7 @@ AL_API ALvoid AL_APIENTRY alListenerf(ALenum param, ALfloat value) switch(param) { case AL_GAIN: - if(!(value >= 0.0f && isfinite(value))) + if(!(value >= 0.0f && std::isfinite(value))) SETERR_GOTO(context, AL_INVALID_VALUE, done, "Listener gain out of range"); listener->Gain = value; DO_UPDATEPROPS(); @@ -87,7 +89,7 @@ AL_API ALvoid AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat val switch(param) { case AL_POSITION: - if(!(isfinite(value1) && isfinite(value2) && isfinite(value3))) + if(!(std::isfinite(value1) && std::isfinite(value2) && std::isfinite(value3))) SETERR_GOTO(context, AL_INVALID_VALUE, done, "Listener position out of range"); listener->Position[0] = value1; listener->Position[1] = value2; @@ -96,7 +98,7 @@ AL_API ALvoid AL_APIENTRY alListener3f(ALenum param, ALfloat value1, ALfloat val break; case AL_VELOCITY: - if(!(isfinite(value1) && isfinite(value2) && isfinite(value3))) + if(!(std::isfinite(value1) && std::isfinite(value2) && std::isfinite(value3))) SETERR_GOTO(context, AL_INVALID_VALUE, done, "Listener velocity out of range"); listener->Velocity[0] = value1; listener->Velocity[1] = value2; @@ -144,8 +146,8 @@ AL_API ALvoid AL_APIENTRY alListenerfv(ALenum param, const ALfloat *values) switch(param) { case AL_ORIENTATION: - if(!(isfinite(values[0]) && isfinite(values[1]) && isfinite(values[2]) && - isfinite(values[3]) && isfinite(values[4]) && isfinite(values[5]))) + if(!(std::isfinite(values[0]) && std::isfinite(values[1]) && std::isfinite(values[2]) && + std::isfinite(values[3]) && std::isfinite(values[4]) && std::isfinite(values[5]))) SETERR_GOTO(context, AL_INVALID_VALUE, done, "Listener orientation out of range"); /* AT then UP */ listener->Forward[0] = values[0]; diff --git a/OpenAL32/alState.cpp b/OpenAL32/alState.cpp index a3c3cc1f..e3e8856f 100644 --- a/OpenAL32/alState.cpp +++ b/OpenAL32/alState.cpp @@ -23,6 +23,7 @@ #include "version.h" #include +#include #include "alMain.h" #include "alcontext.h" @@ -643,7 +644,7 @@ AL_API ALvoid AL_APIENTRY alDopplerFactor(ALfloat value) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - if(!(value >= 0.0f && isfinite(value))) + if(!(value >= 0.0f && std::isfinite(value))) alSetError(context.get(), AL_INVALID_VALUE, "Doppler factor %f out of range", value); else { @@ -670,7 +671,7 @@ AL_API ALvoid AL_APIENTRY alDopplerVelocity(ALfloat value) context->EventParam); } - if(!(value >= 0.0f && isfinite(value))) + if(!(value >= 0.0f && std::isfinite(value))) alSetError(context.get(), AL_INVALID_VALUE, "Doppler velocity %f out of range", value); else { @@ -685,7 +686,7 @@ AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat value) ContextRef context{GetContextRef()}; if(UNLIKELY(!context)) return; - if(!(value > 0.0f && isfinite(value))) + if(!(value > 0.0f && std::isfinite(value))) alSetError(context.get(), AL_INVALID_VALUE, "Speed of sound %f out of range", value); else { -- 2.11.4.GIT