diff options
author | Woazboat <f.kargl@posteo.de> | 2015-05-06 01:53:28 +0200 |
---|---|---|
committer | Woazboat <f.kargl@posteo.de> | 2015-05-08 15:12:33 +0200 |
commit | eb84ffe5a6eb4a79b91e58c263bf222496ad5afb (patch) | |
tree | 27ee46c5ae8ee42cf00ce06937737b8d7ce8e929 /src/Vector3.h | |
parent | Ignoring Clang warnings for strict float comparison in Vector::Equals() (diff) | |
download | cuberite-eb84ffe5a6eb4a79b91e58c263bf222496ad5afb.tar cuberite-eb84ffe5a6eb4a79b91e58c263bf222496ad5afb.tar.gz cuberite-eb84ffe5a6eb4a79b91e58c263bf222496ad5afb.tar.bz2 cuberite-eb84ffe5a6eb4a79b91e58c263bf222496ad5afb.tar.lz cuberite-eb84ffe5a6eb4a79b91e58c263bf222496ad5afb.tar.xz cuberite-eb84ffe5a6eb4a79b91e58c263bf222496ad5afb.tar.zst cuberite-eb84ffe5a6eb4a79b91e58c263bf222496ad5afb.zip |
Diffstat (limited to 'src/Vector3.h')
-rw-r--r-- | src/Vector3.h | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/Vector3.h b/src/Vector3.h index d454fda06..f116c07f6 100644 --- a/src/Vector3.h +++ b/src/Vector3.h @@ -80,7 +80,16 @@ public: inline bool HasNonZeroLength(void) const { + #ifndef __GNUC__ + #pragma clang diagnostics push + #pragma clang diagnostics ignored "-Wfloat-equal" + #endif + return ((x != 0) || (y != 0) || (z != 0)); + + #ifndef __GNUC__ + #pragma clang diagnostics pop + #endif } inline double Length(void) const @@ -127,16 +136,16 @@ public: // Perform a strict comparison of the contents - we want to know whether this object is exactly equal // To perform EPS-based comparison, use the EqualsEps() function -#ifndef __GNUC__ -#pragma clang diagnostics push -#pragma clang diagnostics ignored "-Wfloat-equal" -#endif + #ifndef __GNUC__ + #pragma clang diagnostics push + #pragma clang diagnostics ignored "-Wfloat-equal" + #endif return !((x != a_Rhs.x) || (y != a_Rhs.y) || (z != a_Rhs.z)); -#ifndef __GNUC__ -#pragma clang diagnostics pop -#endif + #ifndef __GNUC__ + #pragma clang diagnostics pop + #endif } inline bool EqualsEps(const Vector3<T> & a_Rhs, T a_Eps) const |