mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 01:08:35 +00:00
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
|
||||
|
||||
#ifndef isfinite
|
||||
#ifdef HAVE_FINITE
|
||||
#define isfinite(x) finite(x)
|
||||
#else
|
||||
#define finite(x) (1.0 / fabs(x) > 0.0)
|
||||
#endif /* HAVE_FINITE */
|
||||
#define isfinite(x) (1.0 / fabs(x) > 0.0)
|
||||
#endif /* isfinite */
|
||||
|
||||
#ifndef HAVE_ISNAN
|
||||
|
||||
@@ -122,7 +122,9 @@
|
||||
#define snprintf _snprintf
|
||||
#define atoll _atoi64
|
||||
#define vsnprintf _vsnprintf
|
||||
#define finite(X) _finite(X)
|
||||
#ifndef isfinite
|
||||
#define isfinite(X) _finite(X)
|
||||
#endif
|
||||
#define llabs _abs64
|
||||
|
||||
#else
|
||||
@@ -134,12 +136,12 @@
|
||||
|
||||
#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
|
||||
inline bool myisfinite(float f) { return _finite(f) && !_isnan(f); }
|
||||
#else
|
||||
inline bool myisfinite(float f) { return finite(f) && !std::isnan(f); }
|
||||
inline bool myisfinite(float f) { return isfinite(f) && !std::isnan(f); }
|
||||
#endif
|
||||
|
||||
#define atol(a) strtoul( a, NULL, 10)
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace Trinity
|
||||
|
||||
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)
|
||||
@@ -225,12 +225,12 @@ namespace Trinity
|
||||
|
||||
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)
|
||||
{
|
||||
return IsValidMapCoord(x, y, z) && finite(o);
|
||||
return IsValidMapCoord(x, y, z) && isfinite(o);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user