Made the supression of unused variables portable.

EIGEN_UNUSED is not supported on non GCC systems.
This commit is contained in:
Hauke Heibel
2010-06-08 15:52:00 +02:00
parent 2a64fa4947
commit 4c5778d29d
6 changed files with 13 additions and 10 deletions

View File

@@ -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;

View File

@@ -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

View File

@@ -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

View File

@@ -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;