From c1d005e976af679ed52291fd549d7c9370f2672f Mon Sep 17 00:00:00 2001 From: Thomas Capricelli Date: Fri, 21 May 2010 02:05:25 +0200 Subject: introduce a new macro EIGEN_ARG_UNUSED(arg) and use it in some places to silent some warnings (from clang) --- Eigen/src/Core/DenseBase.h | 7 +++++++ Eigen/src/Core/TriangularMatrix.h | 4 ++++ Eigen/src/Core/util/Macros.h | 2 ++ Eigen/src/QR/ColPivHouseholderQR.h | 7 +++++-- 4 files changed, 18 insertions(+), 2 deletions(-) (limited to 'Eigen') diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index 796623637..3e2bcafd9 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -214,6 +214,9 @@ template class DenseBase */ void resize(int size) { +#ifdef EIGEN_NO_DEBUG + EIGEN_ARG_UNUSED(size); +#endif ei_assert(size == this->size() && "DenseBase::resize() does not actually allow to resize."); } @@ -223,6 +226,10 @@ template class DenseBase */ void resize(int rows, int cols) { +#ifdef EIGEN_NO_DEBUG + EIGEN_ARG_UNUSED(rows); + EIGEN_ARG_UNUSED(cols); +#endif ei_assert(rows == this->rows() && cols == this->cols() && "DenseBase::resize() does not actually allow to resize."); } diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index e6599f9c8..632acc2d7 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -89,6 +89,10 @@ template class TriangularBase : public EigenBase void check_coordinates(int row, int col) { +#ifdef EIGEN_NO_DEBUG + EIGEN_ARG_UNUSED(row); + EIGEN_ARG_UNUSED(col); +#endif ei_assert(col>=0 && col=0 && row=row) || (Mode==Lower && col<=row) diff --git a/Eigen/src/Core/util/Macros.h b/Eigen/src/Core/util/Macros.h index 787182444..9b277128c 100644 --- a/Eigen/src/Core/util/Macros.h +++ b/Eigen/src/Core/util/Macros.h @@ -172,6 +172,8 @@ #define EIGEN_UNUSED #endif +#define EIGEN_ARG_UNUSED(x) (void)x; + #if (defined __GNUC__) #define EIGEN_ASM_COMMENT(X) asm("#"X) #else diff --git a/Eigen/src/QR/ColPivHouseholderQR.h b/Eigen/src/QR/ColPivHouseholderQR.h index 8c9c8840b..fbc80adf2 100644 --- a/Eigen/src/QR/ColPivHouseholderQR.h +++ b/Eigen/src/QR/ColPivHouseholderQR.h @@ -461,9 +461,12 @@ struct ei_solve_retval, Rhs> template void evalTo(Dest& dst) const { - const int rows = dec().rows(), cols = dec().cols(), - nonzero_pivots = dec().nonzeroPivots(); +#ifndef EIGEN_NO_DEBUG + const int rows = dec().rows(); ei_assert(rhs().rows() == rows); +#endif + const int cols = dec().cols(), + nonzero_pivots = dec().nonzeroPivots(); if(nonzero_pivots == 0) { -- cgit v1.2.3