diff options
-rw-r--r-- | Eigen/src/Core/products/GeneralMatrixMatrix.h | 3 | ||||
-rw-r--r-- | Eigen/src/Core/util/Macros.h | 3 | ||||
-rw-r--r-- | Eigen/src/Core/util/Memory.h | 2 | ||||
-rw-r--r-- | Eigen/src/Sparse/SparseProduct.h | 6 | ||||
-rw-r--r-- | test/first_aligned.cpp | 5 | ||||
-rw-r--r-- | test/triangular.cpp | 4 |
6 files changed, 13 insertions, 10 deletions
diff --git a/Eigen/src/Core/products/GeneralMatrixMatrix.h b/Eigen/src/Core/products/GeneralMatrixMatrix.h index 3286379e8..07721145a 100644 --- a/Eigen/src/Core/products/GeneralMatrixMatrix.h +++ b/Eigen/src/Core/products/GeneralMatrixMatrix.h @@ -160,7 +160,8 @@ static void run(Index rows, Index cols, Index depth, else #endif // EIGEN_HAS_OPENMP { - (void)info; // info is not used + EIGEN_UNUSED_VARIABLE(info); + // this is the sequential version! Scalar* blockA = ei_aligned_stack_new(Scalar, kc*mc); std::size_t sizeB = kc*Blocking::PacketSize*Blocking::nr + kc*cols; diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 82045b37c..061767039 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -176,6 +176,9 @@ #define EIGEN_UNUSED #endif +// Suppresses 'unused variable' warnings. +#define EIGEN_UNUSED_VARIABLE(var) (void)var; + #if (defined __GNUC__) #define EIGEN_ASM_COMMENT(X) asm("#"X) #else diff --git a/Eigen/src/Core/util/Memory.h b/Eigen/src/Core/util/Memory.h index 6b202dbc8..c67b9774f 100644 --- a/Eigen/src/Core/util/Memory.h +++ b/Eigen/src/Core/util/Memory.h @@ -218,7 +218,7 @@ inline void ei_aligned_free(void *ptr) **/ inline void* ei_aligned_realloc(void *ptr, size_t new_size, size_t old_size) { - (void)old_size; // Suppress 'unused variable' warning. Seen in boost tee. + EIGEN_UNUSED_VARIABLE(old_size); void *result; #if !EIGEN_ALIGN diff --git a/Eigen/src/Sparse/SparseProduct.h b/Eigen/src/Sparse/SparseProduct.h index 2f86b2b2d..7a91c9cf0 100644 --- a/Eigen/src/Sparse/SparseProduct.h +++ b/Eigen/src/Sparse/SparseProduct.h @@ -382,9 +382,9 @@ struct ei_sparse_product_selector2<Lhs,Rhs,ResultType,RowMajor,ColMajor,ColMajor static void run(const Lhs& lhs, const Rhs& rhs, ResultType& res) { // prevent warnings until the code is fixed - (void) lhs; - (void) rhs; - (void) res; + EIGEN_UNUSED_VARIABLE(lhs); + EIGEN_UNUSED_VARIABLE(rhs); + EIGEN_UNUSED_VARIABLE(res); // typedef SparseMatrix<typename ResultType::Scalar,RowMajor> RowMajorMatrix; // RowMajorMatrix rhsRow = rhs; diff --git a/test/first_aligned.cpp b/test/first_aligned.cpp index 5fb806298..687f4a5dc 100644 --- a/test/first_aligned.cpp +++ b/test/first_aligned.cpp @@ -34,9 +34,8 @@ void test_first_aligned_helper(Scalar *array, int size) template<typename Scalar> void test_none_aligned_helper(Scalar *array, int size) { - // Suppress 'unreferenced formal parameter's warnings. - (void)array; - (void)size; + EIGEN_UNUSED_VARIABLE(array); + EIGEN_UNUSED_VARIABLE(size); VERIFY(ei_packet_traits<Scalar>::size == 1 || ei_first_aligned(array, size) == size); } diff --git a/test/triangular.cpp b/test/triangular.cpp index d6d64e595..12452515e 100644 --- a/test/triangular.cpp +++ b/test/triangular.cpp @@ -235,8 +235,8 @@ void test_triangular() { for(int i = 0; i < g_repeat ; i++) { - EIGEN_UNUSED int r = ei_random<int>(2,20); - EIGEN_UNUSED int c = ei_random<int>(2,20); + int r = ei_random<int>(2,20); EIGEN_UNUSED_VARIABLE(r); + int c = ei_random<int>(2,20); EIGEN_UNUSED_VARIABLE(c); CALL_SUBTEST_1( triangular_square(Matrix<float, 1, 1>()) ); CALL_SUBTEST_2( triangular_square(Matrix<float, 2, 2>()) ); |