isfinite -> finite
This commit is contained in:
@@ -13,6 +13,7 @@
|
|||||||
#include "RageFileManager.h"
|
#include "RageFileManager.h"
|
||||||
#include "CourseWriterCRS.h"
|
#include "CourseWriterCRS.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
const int MAX_EDIT_COURSE_SIZE_BYTES = 30*1024; // 30KB
|
const int MAX_EDIT_COURSE_SIZE_BYTES = 30*1024; // 30KB
|
||||||
|
|
||||||
@@ -63,7 +64,7 @@ bool CourseLoaderCRS::LoadFromMsd( const RString &sPath, const MsdFile &msd, Cou
|
|||||||
{
|
{
|
||||||
fGainSeconds = StringToFloat( sParams[1] );
|
fGainSeconds = StringToFloat( sParams[1] );
|
||||||
|
|
||||||
if( !isfinite(fGainSeconds) )
|
if( !finite(fGainSeconds) )
|
||||||
fGainSeconds = 0.0f;
|
fGainSeconds = 0.0f;
|
||||||
}
|
}
|
||||||
else if( 0 == stricmp(sValueName, "METER") )
|
else if( 0 == stricmp(sValueName, "METER") )
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
#include "Style.h"
|
#include "Style.h"
|
||||||
#include "CommonMetrics.h"
|
#include "CommonMetrics.h"
|
||||||
#include "arch/Dialog/Dialog.h"
|
#include "arch/Dialog/Dialog.h"
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYSIZE(arr); ++Z ) arr[Z]=1.0f; }
|
#define ONE( arr ) { for( unsigned Z = 0; Z < ARRAYSIZE(arr); ++Z ) arr[Z]=1.0f; }
|
||||||
|
|
||||||
@@ -257,7 +258,7 @@ void PlayerOptions::FromString( const RString &sOptions, bool bWarnOnInvalid )
|
|||||||
else if( *s[0]=='*' )
|
else if( *s[0]=='*' )
|
||||||
{
|
{
|
||||||
sscanf( *s, "*%f", &speed );
|
sscanf( *s, "*%f", &speed );
|
||||||
if( !isfinite(speed) )
|
if( !finite(speed) )
|
||||||
speed = 1.0f;
|
speed = 1.0f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -279,7 +280,7 @@ void PlayerOptions::FromString( const RString &sOptions, bool bWarnOnInvalid )
|
|||||||
}
|
}
|
||||||
else if( sscanf( sBit, "c%f", &level ) == 1 )
|
else if( sscanf( sBit, "c%f", &level ) == 1 )
|
||||||
{
|
{
|
||||||
if( !isfinite(level) || level <= 0.0f )
|
if( !finite(level) || level <= 0.0f )
|
||||||
level = 200.0f; // Just pick some value.
|
level = 200.0f; // Just pick some value.
|
||||||
SET_FLOAT( fScrollBPM )
|
SET_FLOAT( fScrollBPM )
|
||||||
SET_FLOAT( fTimeSpacing )
|
SET_FLOAT( fTimeSpacing )
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#include "Foreach.h"
|
#include "Foreach.h"
|
||||||
#include "LocalizedString.h"
|
#include "LocalizedString.h"
|
||||||
#include "LuaFunctions.h"
|
#include "LuaFunctions.h"
|
||||||
|
#include <float.h>
|
||||||
|
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
@@ -1476,7 +1477,7 @@ float StringToFloat( const RString &sString )
|
|||||||
{
|
{
|
||||||
float ret = strtof( sString, NULL );
|
float ret = strtof( sString, NULL );
|
||||||
|
|
||||||
if( !isfinite(ret) )
|
if( !finite(ret) )
|
||||||
ret = 0.0f;
|
ret = 0.0f;
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -1905,7 +1906,7 @@ bool FromString( const RString &sValue, float &out )
|
|||||||
{
|
{
|
||||||
const char *endptr = sValue.data() + sValue.size();
|
const char *endptr = sValue.data() + sValue.size();
|
||||||
out = strtof( sValue, (char **) &endptr );
|
out = strtof( sValue, (char **) &endptr );
|
||||||
return endptr != sValue.data() && isfinite( out );
|
return endptr != sValue.data() && finite( out );
|
||||||
}
|
}
|
||||||
|
|
||||||
bool FromString( const RString &sValue, bool &out )
|
bool FromString( const RString &sValue, bool &out )
|
||||||
|
|||||||
Reference in New Issue
Block a user