Build/Clang: removed deprecated finite() fixing 59 warnings
This commit is contained in:
@@ -787,11 +787,7 @@ inline unsigned long long my_double2ulonglong(double d)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef isfinite
|
#ifndef isfinite
|
||||||
#ifdef HAVE_FINITE
|
#define isfinite(x) (1.0 / fabs(x) > 0.0)
|
||||||
#define isfinite(x) finite(x)
|
|
||||||
#else
|
|
||||||
#define finite(x) (1.0 / fabs(x) > 0.0)
|
|
||||||
#endif /* HAVE_FINITE */
|
|
||||||
#endif /* isfinite */
|
#endif /* isfinite */
|
||||||
|
|
||||||
#ifndef HAVE_ISNAN
|
#ifndef HAVE_ISNAN
|
||||||
|
|||||||
@@ -122,7 +122,9 @@
|
|||||||
#define snprintf _snprintf
|
#define snprintf _snprintf
|
||||||
#define atoll _atoi64
|
#define atoll _atoi64
|
||||||
#define vsnprintf _vsnprintf
|
#define vsnprintf _vsnprintf
|
||||||
#define finite(X) _finite(X)
|
#ifndef isfinite
|
||||||
|
#define isfinite(X) _finite(X)
|
||||||
|
#endif
|
||||||
#define llabs _abs64
|
#define llabs _abs64
|
||||||
|
|
||||||
#else
|
#else
|
||||||
@@ -134,12 +136,12 @@
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
inline float finiteAlways(float f) { return finite(f) ? f : 0.0f; }
|
inline float finiteAlways(float f) { return isfinite(f) ? f : 0.0f; }
|
||||||
|
|
||||||
#if COMPILER == COMPILER_MICROSOFT
|
#if COMPILER == COMPILER_MICROSOFT
|
||||||
inline bool myisfinite(float f) { return _finite(f) && !_isnan(f); }
|
inline bool myisfinite(float f) { return _finite(f) && !_isnan(f); }
|
||||||
#else
|
#else
|
||||||
inline bool myisfinite(float f) { return finite(f) && !std::isnan(f); }
|
inline bool myisfinite(float f) { return isfinite(f) && !std::isnan(f); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define atol(a) strtoul( a, NULL, 10)
|
#define atol(a) strtoul( a, NULL, 10)
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ namespace Trinity
|
|||||||
|
|
||||||
inline bool IsValidMapCoord(float c)
|
inline bool IsValidMapCoord(float c)
|
||||||
{
|
{
|
||||||
return finite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f);
|
return isfinite(c) && (std::fabs(c) <= MAP_HALFSIZE - 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool IsValidMapCoord(float x, float y)
|
inline bool IsValidMapCoord(float x, float y)
|
||||||
@@ -225,12 +225,12 @@ namespace Trinity
|
|||||||
|
|
||||||
inline bool IsValidMapCoord(float x, float y, float z)
|
inline bool IsValidMapCoord(float x, float y, float z)
|
||||||
{
|
{
|
||||||
return IsValidMapCoord(x, y) && finite(z);
|
return IsValidMapCoord(x, y) && isfinite(z);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool IsValidMapCoord(float x, float y, float z, float o)
|
inline bool IsValidMapCoord(float x, float y, float z, float o)
|
||||||
{
|
{
|
||||||
return IsValidMapCoord(x, y, z) && finite(o);
|
return IsValidMapCoord(x, y, z) && isfinite(o);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user