From 6991d0af943b734d2f65e3c7df76c501477943b9 Mon Sep 17 00:00:00 2001 From: Patrick Jaap <patrick.jaap@tu-dresden.de> Date: Wed, 30 Jun 2021 14:38:40 +0200 Subject: [PATCH] Replace DUNE_UNUSED by [[maybe_unused]] --- dune/solvers/common/genericvectortools.hh | 4 ++-- .../iterationsteps/truncatedblockgsstep.hh | 2 +- dune/solvers/operators/nulloperator.hh | 20 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/dune/solvers/common/genericvectortools.hh b/dune/solvers/common/genericvectortools.hh index 4a1dccc..bc3f7ef 100644 --- a/dune/solvers/common/genericvectortools.hh +++ b/dune/solvers/common/genericvectortools.hh @@ -66,7 +66,7 @@ struct GenericVector //! weave two vector blocks into each other e.g. [[u1...un][w1...wn]] --> [[u1 w1]...[un wn]] template <class LVectorType, class RVectorType> - static void interlace(const LVectorType& lvec DUNE_UNUSED, RVectorType& rvec DUNE_UNUSED) + static void interlace([[maybe_unused]] const LVectorType& lvec, [[maybe_unused]] RVectorType& rvec) { DUNE_THROW(Dune::NotImplemented,"GenericVector::interlace not implemented for given VectorTypes"); } @@ -132,7 +132,7 @@ struct GenericVector //! unweave two vectors previously interlaced e.g. [[u1 w1]...[un wn]] --> [[u1...un][w1...wn]] template <class LVectorType, class RVectorType> - static void deinterlace(const LVectorType& lvec DUNE_UNUSED, RVectorType& rvec DUNE_UNUSED) + static void deinterlace([[maybe_unused]] const LVectorType& lvec, [[maybe_unused]] RVectorType& rvec) { DUNE_THROW(Dune::NotImplemented,"GenericVector::deinterlace not implemented for given VectorTypes"); } diff --git a/dune/solvers/iterationsteps/truncatedblockgsstep.hh b/dune/solvers/iterationsteps/truncatedblockgsstep.hh index 57e2863..32775af 100644 --- a/dune/solvers/iterationsteps/truncatedblockgsstep.hh +++ b/dune/solvers/iterationsteps/truncatedblockgsstep.hh @@ -96,7 +96,7 @@ template<> struct RecursiveGSStep<1> { template<class MType, class VType, class BVType> - static void apply(const MType& mat, const VType& rhs, const BVType& ignore, VType& x, int innerLoops DUNE_UNUSED) + static void apply(const MType& mat, const VType& rhs, const BVType& ignore, VType& x, [[maybe_unused]] int innerLoops) { typedef typename MType::block_type MBlock; diff --git a/dune/solvers/operators/nulloperator.hh b/dune/solvers/operators/nulloperator.hh index 2916a40..53fa40f 100644 --- a/dune/solvers/operators/nulloperator.hh +++ b/dune/solvers/operators/nulloperator.hh @@ -24,11 +24,11 @@ class NullOperator public: RowDummy(): zero_(0){} - const BlockType& operator[](size_t i DUNE_UNUSED) const + const BlockType& operator[]([[maybe_unused]] size_t i) const { return zero_; } - BlockType& operator[](size_t i DUNE_UNUSED) + BlockType& operator[]([[maybe_unused]] size_t i) { return zero_; } @@ -60,7 +60,7 @@ class NullOperator * Implements b += Nx and hence does nothing (N=0 !) */ template <class LVectorType, class RVectorType> - void umv(const LVectorType& x DUNE_UNUSED, RVectorType& b DUNE_UNUSED) const + void umv([[maybe_unused]] const LVectorType& x, [[maybe_unused]] RVectorType& b) const {} /** \brief transposed Matrix-Vector multiplication @@ -68,7 +68,7 @@ class NullOperator * Implements b += N^tx and hence does nothing (N=0 !) */ template <class LVectorType, class RVectorType> - void umtv(const LVectorType& x DUNE_UNUSED, RVectorType& b DUNE_UNUSED) const + void umtv([[maybe_unused]] const LVectorType& x, [[maybe_unused]] RVectorType& b) const {} /** \brief Matrix-Vector multiplication with scalar multiplication @@ -76,7 +76,7 @@ class NullOperator * Implements b += a*Nx and hence does nothing (N=0 !) */ template <class LVectorType, class RVectorType> - void usmv(const double a DUNE_UNUSED, const LVectorType& x DUNE_UNUSED, RVectorType& b DUNE_UNUSED) const + void usmv([[maybe_unused]] const double a, [[maybe_unused]] const LVectorType& x, [[maybe_unused]] RVectorType& b) const {} /** \brief transposed Matrix-Vector multiplication with scalar multiplication @@ -84,7 +84,7 @@ class NullOperator * Implements b += a*N^tx and hence does nothing (N=0 !) */ template <class LVectorType, class RVectorType> - void usmtv(const double a DUNE_UNUSED, const LVectorType& x DUNE_UNUSED, RVectorType& b DUNE_UNUSED) const + void usmtv([[maybe_unused]] const double a, [[maybe_unused]] const LVectorType& x, [[maybe_unused]] RVectorType& b) const {} /** \brief Matrix-Vector multiplication @@ -92,25 +92,25 @@ class NullOperator * Implements b = Nx and hence does nothing but set b=0 (N=0 !) */ template <class LVectorType, class RVectorType> - void mv(const LVectorType& x DUNE_UNUSED, RVectorType& b) const + void mv([[maybe_unused]] const LVectorType& x, RVectorType& b) const { b = 0.0; } //! random access operator - const RowDummy& operator[](size_t i DUNE_UNUSED) const + const RowDummy& operator[]([[maybe_unused]] size_t i) const { return rowDummy_; } //! random access operator - RowDummy& operator[](size_t i DUNE_UNUSED) + RowDummy& operator[]([[maybe_unused]] size_t i) { return rowDummy_; } //! return j-th diagonal entry - const block_type& diagonal(size_t i DUNE_UNUSED) const + const block_type& diagonal([[maybe_unused]] size_t i) const { return rowDummy_[0]; } -- GitLab