Fix compiler warnings in 3.4

This commit is contained in:
Charles Schlosser
2023-12-21 00:57:21 +00:00
parent ebf968b272
commit 25270e35db
9 changed files with 26 additions and 24 deletions

View File

@@ -126,7 +126,7 @@ template<>
struct NumTraits<AnnoyingScalar> : NumTraits<float>
{
enum {
RequireInitialization = 1,
RequireInitialization = 1
};
typedef AnnoyingScalar Real;
typedef AnnoyingScalar Nested;

View File

@@ -143,11 +143,12 @@ template<typename MatrixType> void block(const MatrixType& m)
// check that linear acccessors works on blocks
m1 = m1_copy;
if((MatrixType::Flags&RowMajorBit)==0)
VERIFY_IS_EQUAL(m1.leftCols(c1).coeff(r1+c1*rows), m1(r1,c1));
else
VERIFY_IS_EQUAL(m1.topRows(r1).coeff(c1+r1*cols), m1(r1,c1));
if (c1 > 0 && r1 > 0) {
if ((MatrixType::Flags & RowMajorBit) == 0)
VERIFY_IS_EQUAL(m1.leftCols(c1).coeff(r1 + c1 * rows), m1(r1, c1));
else
VERIFY_IS_EQUAL(m1.topRows(r1).coeff(c1 + r1 * cols), m1(r1, c1));
}
// now test some block-inside-of-block.

View File

@@ -63,7 +63,7 @@ void check_stdlist_matrix(const MatrixType& m)
++itw;
}
v.resize(21);
v.resize(21, MatrixType::Zero(rows, cols));
set(v, 20, x);
VERIFY_IS_APPROX(*get(v, 20), x);
v.resize(22,y);

View File

@@ -52,7 +52,7 @@ void check_stdvector_transform(const TransformType&)
{
typedef typename TransformType::MatrixType MatrixType;
TransformType x(MatrixType::Random()), y(MatrixType::Random());
std::vector<TransformType,Eigen::aligned_allocator<TransformType> > v(10), w(20, y);
std::vector<TransformType,Eigen::aligned_allocator<TransformType> > v(10, TransformType(MatrixType::Zero())), w(20, y);
v[5] = x;
w[6] = v[5];
VERIFY_IS_APPROX(w[6], v[5]);
@@ -124,7 +124,7 @@ void std_vector_gcc_warning()
{
typedef Eigen::Vector3f T;
std::vector<T, Eigen::aligned_allocator<T> > v;
v.push_back(T());
v.push_back(T::Zero());
}
EIGEN_DECLARE_TEST(stdvector)

View File

@@ -280,8 +280,8 @@ struct vectorization_logic_half
// EIGEN_UNALIGNED_VECTORIZE is 0 (the matrix is assumed unaligned).
// Adjust the matrix sizes to account for these alignment issues.
enum { PacketBytes = sizeof(Scalar)*PacketSize };
enum { MinVSize = EIGEN_UNALIGNED_VECTORIZE ? PacketSize
: PacketBytes >= EIGEN_MIN_ALIGN_BYTES ? PacketSize
enum { MinVSize = EIGEN_UNALIGNED_VECTORIZE ? int(PacketSize)
: int(PacketBytes) >= EIGEN_MIN_ALIGN_BYTES ? int(PacketSize)
: (EIGEN_MIN_ALIGN_BYTES + sizeof(Scalar) - 1) / sizeof(Scalar) };
typedef Matrix<Scalar,MinVSize,1> Vector1;