From 25579df2d4b38e434aee4cf0368bf4ffc8ac847d Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 22 Feb 2011 08:54:55 -0500 Subject: [PATCH] 'fix' a couple of clang -Wconstant-logical-operand warnings (still not convinced about the pertinence of that warning) --- Eigen/src/Core/Assign.h | 6 +++--- Eigen/src/Core/Redux.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Core/Assign.h b/Eigen/src/Core/Assign.h index b06d07d05..3a17152f0 100644 --- a/Eigen/src/Core/Assign.h +++ b/Eigen/src/Core/Assign.h @@ -41,7 +41,7 @@ public: DstIsAligned = Derived::Flags & AlignedBit, DstHasDirectAccess = Derived::Flags & DirectAccessBit, SrcIsAligned = OtherDerived::Flags & AlignedBit, - JointAlignment = DstIsAligned && SrcIsAligned ? Aligned : Unaligned + JointAlignment = bool(DstIsAligned) && bool(SrcIsAligned) ? Aligned : Unaligned }; private: @@ -106,9 +106,9 @@ public: : int(NoUnrolling) ) : int(Traversal) == int(LinearVectorizedTraversal) - ? ( int(MayUnrollCompletely) && int(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) ) + ? ( bool(MayUnrollCompletely) && bool(DstIsAligned) ? int(CompleteUnrolling) : int(NoUnrolling) ) : int(Traversal) == int(LinearTraversal) - ? ( int(MayUnrollCompletely) ? int(CompleteUnrolling) : int(NoUnrolling) ) + ? ( bool(MayUnrollCompletely) ? int(CompleteUnrolling) : int(NoUnrolling) ) : int(NoUnrolling) }; diff --git a/Eigen/src/Core/Redux.h b/Eigen/src/Core/Redux.h index 25febb773..f9f5a95d5 100644 --- a/Eigen/src/Core/Redux.h +++ b/Eigen/src/Core/Redux.h @@ -216,7 +216,7 @@ struct redux_impl const Index packetSize = packet_traits::size; const Index alignedStart = first_aligned(mat); enum { - alignment = (Derived::Flags & DirectAccessBit) || (Derived::Flags & AlignedBit) + alignment = bool(Derived::Flags & DirectAccessBit) || bool(Derived::Flags & AlignedBit) ? Aligned : Unaligned }; const Index alignedSize = ((size-alignedStart)/packetSize)*packetSize;