From 38874b16511f25c5e712d7e294a02b0d9aa6c397 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 16 Jun 2015 14:43:46 +0200 Subject: Fix shadow warnings in Tensor module --- unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h') diff --git a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h index 2a7dd45c0..5a165dab0 100644 --- a/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h +++ b/unsupported/Eigen/CXX11/src/Tensor/TensorPadding.h @@ -185,11 +185,13 @@ struct TensorEvaluator, Device { Index inputIndex; if (static_cast(Layout) == static_cast(ColMajor)) { - const Index idx = coords[0]; - if (idx < m_padding[0].first || idx >= m_dimensions[0] - m_padding[0].second) { - return Scalar(0); + { + const Index idx = coords[0]; + if (idx < m_padding[0].first || idx >= m_dimensions[0] - m_padding[0].second) { + return Scalar(0); + } + inputIndex = idx - m_padding[0].first; } - inputIndex = idx - m_padding[0].first; for (int i = 1; i < NumDims; ++i) { const Index idx = coords[i]; if (idx < m_padding[i].first || idx >= m_dimensions[i] - m_padding[i].second) { @@ -198,11 +200,13 @@ struct TensorEvaluator, Device inputIndex += (idx - m_padding[i].first) * m_inputStrides[i]; } } else { - const Index idx = coords[NumDims-1]; - if (idx < m_padding[NumDims-1].first || idx >= m_dimensions[NumDims-1] - m_padding[NumDims-1].second) { - return Scalar(0); + { + const Index idx = coords[NumDims-1]; + if (idx < m_padding[NumDims-1].first || idx >= m_dimensions[NumDims-1] - m_padding[NumDims-1].second) { + return Scalar(0); + } + inputIndex = idx - m_padding[NumDims-1].first; } - inputIndex = idx - m_padding[NumDims-1].first; for (int i = NumDims - 2; i >= 0; --i) { const Index idx = coords[i]; if (idx < m_padding[i].first || idx >= m_dimensions[i] - m_padding[i].second) { -- cgit v1.2.3