Use std::isfinite instead of isfinite
This commit is contained in:
parent
ddfed7187f
commit
3ae1c78d1a
@ -21,6 +21,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cmath>
|
||||
|
||||
#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;
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
#include <cmath>
|
||||
#include <algorithm>
|
||||
|
||||
#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];
|
||||
|
@ -20,6 +20,8 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#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];
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "version.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <cmath>
|
||||
|
||||
#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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user