aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-12-18 20:48:02 +0000
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2008-12-18 20:48:02 +0000
commit8106d354089d5699d37f1e3ed16709bc9a0334e5 (patch)
tree4d3fa36cdb4fc2688b19ed7687934f1b36a4ef4c /Eigen/src
parentfabaa6915be063a5390ad78c4ddd86b335691418 (diff)
Patch by Kenneth Riddile: disable MSVC warnings, reenable them outside
of Eigen, and add a MSVC-friendly path in StaticAssert.
Diffstat (limited to 'Eigen/src')
-rw-r--r--Eigen/src/Core/util/StaticAssert.h16
-rw-r--r--Eigen/src/Geometry/Quaternion.h2
2 files changed, 15 insertions, 3 deletions
diff --git a/Eigen/src/Core/util/StaticAssert.h b/Eigen/src/Core/util/StaticAssert.h
index 0e2a70638..2594b73f8 100644
--- a/Eigen/src/Core/util/StaticAssert.h
+++ b/Eigen/src/Core/util/StaticAssert.h
@@ -74,8 +74,20 @@
};
};
- #define EIGEN_STATIC_ASSERT(CONDITION,MSG) \
- if (Eigen::ei_static_assert<CONDITION ? true : false>::MSG) {}
+ // Specialized implementation for MSVC to avoid "conditional
+ // expression is constant" warnings. This implementation doesn't
+ // appear to work under GCC, hence the multiple implementations.
+ #ifdef _MSC_VER
+
+ #define EIGEN_STATIC_ASSERT(CONDITION,MSG) \
+ {Eigen::ei_static_assert<CONDITION ? true : false>::MSG;}
+
+ #else
+
+ #define EIGEN_STATIC_ASSERT(CONDITION,MSG) \
+ if (Eigen::ei_static_assert<CONDITION ? true : false>::MSG) {}
+
+ #endif
#endif // not CXX0X
diff --git a/Eigen/src/Geometry/Quaternion.h b/Eigen/src/Geometry/Quaternion.h
index ec79afa25..f6630e63e 100644
--- a/Eigen/src/Geometry/Quaternion.h
+++ b/Eigen/src/Geometry/Quaternion.h
@@ -279,7 +279,7 @@ inline Quaternion<Scalar>& Quaternion<Scalar>::operator=(const Quaternion& other
template<typename Scalar>
inline Quaternion<Scalar>& Quaternion<Scalar>::operator=(const AngleAxisType& aa)
{
- Scalar ha = 0.5*aa.angle();
+ Scalar ha = Scalar(0.5)*aa.angle(); // Scalar(0.5) to suppress precision loss warnings
this->w() = ei_cos(ha);
this->vec() = ei_sin(ha) * aa.axis();
return *this;