From ece7cd3004841a821c6ca1b095c021429e221c6d Mon Sep 17 00:00:00 2001 From: Patrick Jaap <patrick.jaap@tu-dresden.de> Date: Mon, 19 Apr 2021 17:22:31 +0200 Subject: [PATCH] Replace DUNE_UNUSED by [[maybe_unused]] --- dune/fufem/assemblers/localassemblers/vvlaplaceassembler.hh | 4 ++-- dune/fufem/assemblers/localassemblers/vvmassassembler.hh | 4 ++-- dune/fufem/dunedataio.hh | 6 +++--- dune/fufem/estimators/errorfractionmarking.hh | 2 +- dune/fufem/functions/portablegreymap.hh | 4 ++-- dune/fufem/functionspacebases/q1nodalbasis.hh | 2 +- dune/fufem/functionspacebases/refinedp1nodalbasis.hh | 2 +- dune/fufem/test/boundarypatchtest.cc | 4 ++-- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dune/fufem/assemblers/localassemblers/vvlaplaceassembler.hh b/dune/fufem/assemblers/localassemblers/vvlaplaceassembler.hh index 0fc310cc..5a27f139 100644 --- a/dune/fufem/assemblers/localassemblers/vvlaplaceassembler.hh +++ b/dune/fufem/assemblers/localassemblers/vvlaplaceassembler.hh @@ -35,13 +35,13 @@ class VVLaplaceAssembler : public LocalOperatorAssembler <GridType, TrialLocalFE : one_(one) {} - void indices(const Element& element DUNE_UNUSED, BoolMatrix& isNonZero, const TrialLocalFE& tFE DUNE_UNUSED, const AnsatzLocalFE& aFE DUNE_UNUSED) const + void indices([[maybe_unused]] const Element& element, BoolMatrix& isNonZero, [[maybe_unused]] const TrialLocalFE& tFE, [[maybe_unused]] const AnsatzLocalFE& aFE) const { isNonZero = true; } template <class BoundaryIterator> - void indices(const BoundaryIterator& it DUNE_UNUSED, BoolMatrix& isNonZero, const TrialLocalFE& tFE DUNE_UNUSED, const AnsatzLocalFE& aFE DUNE_UNUSED) const + void indices([[maybe_unused]] const BoundaryIterator& it, BoolMatrix& isNonZero, [[maybe_unused]] const TrialLocalFE& tFE, [[maybe_unused]] const AnsatzLocalFE& aFE) const { isNonZero = true; } diff --git a/dune/fufem/assemblers/localassemblers/vvmassassembler.hh b/dune/fufem/assemblers/localassemblers/vvmassassembler.hh index 2f8e14ea..63267afb 100644 --- a/dune/fufem/assemblers/localassemblers/vvmassassembler.hh +++ b/dune/fufem/assemblers/localassemblers/vvmassassembler.hh @@ -32,13 +32,13 @@ class VVMassAssembler : public LocalOperatorAssembler < GridType, TrialLocalFE, : one_(one) {} - void indices(const Element& element DUNE_UNUSED, BoolMatrix& isNonZero, const TrialLocalFE& tFE DUNE_UNUSED, const AnsatzLocalFE& aFE DUNE_UNUSED) const + void indices([[maybe_unused]] const Element& element, BoolMatrix& isNonZero, [[maybe_unused]] const TrialLocalFE& tFE, [[maybe_unused]] const AnsatzLocalFE& aFE) const { isNonZero = true; } template <class BoundaryIterator> - void indices(const BoundaryIterator& it DUNE_UNUSED, BoolMatrix& isNonZero, const TrialLocalFE& tFE DUNE_UNUSED, const AnsatzLocalFE& aFE DUNE_UNUSED) const + void indices([[maybe_unused]] const BoundaryIterator& it, BoolMatrix& isNonZero, [[maybe_unused]] const TrialLocalFE& tFE, [[maybe_unused]] const AnsatzLocalFE& aFE) const { isNonZero = true; } diff --git a/dune/fufem/dunedataio.hh b/dune/fufem/dunedataio.hh index 8d086eb3..45e760e0 100644 --- a/dune/fufem/dunedataio.hh +++ b/dune/fufem/dunedataio.hh @@ -16,7 +16,7 @@ namespace serialization { * mark the use of the operator & that works both ways, << or >> , depending on the type of Archive. */ template <class Archive, class T, int n> -void serialize(Archive& ar, Dune::FieldVector<T,n>& fvec, const unsigned int version DUNE_UNUSED) +void serialize(Archive& ar, Dune::FieldVector<T,n>& fvec, [[maybe_unused]] const unsigned int version) { for (int i=0; i<n; ++i) ar & fvec[i]; @@ -26,7 +26,7 @@ void serialize(Archive& ar, Dune::FieldVector<T,n>& fvec, const unsigned int ver * two separate save() and load() functions later to be "unified" via boost::serialization::split_free (see below) */ template <class Archive, class BlockType> -void save(Archive& ar, const Dune::BlockVector<BlockType>& vec, const unsigned int version DUNE_UNUSED) +void save(Archive& ar, const Dune::BlockVector<BlockType>& vec, [[maybe_unused]] const unsigned int version) { size_t size = vec.size(); ar << size; @@ -35,7 +35,7 @@ void save(Archive& ar, const Dune::BlockVector<BlockType>& vec, const unsigned i } template <class Archive, class BlockType> -void load(Archive& ar, Dune::BlockVector<BlockType>& vec, const unsigned int version DUNE_UNUSED) +void load(Archive& ar, Dune::BlockVector<BlockType>& vec, [[maybe_unused]] const unsigned int version) { size_t size; ar >> size; diff --git a/dune/fufem/estimators/errorfractionmarking.hh b/dune/fufem/estimators/errorfractionmarking.hh index 739c8189..76548c2a 100644 --- a/dune/fufem/estimators/errorfractionmarking.hh +++ b/dune/fufem/estimators/errorfractionmarking.hh @@ -35,7 +35,7 @@ class ErrorFractionMarkingStrategy //! Layout class for a all codim all geometry type mapper struct AllCodimLayout { - bool operator() (Dune::GeometryType gt DUNE_UNUSED, int) const { + bool operator() ([[maybe_unused]] Dune::GeometryType gt, int) const { return true; } }; diff --git a/dune/fufem/functions/portablegreymap.hh b/dune/fufem/functions/portablegreymap.hh index 8c91a6d7..dbdf7231 100644 --- a/dune/fufem/functions/portablegreymap.hh +++ b/dune/fufem/functions/portablegreymap.hh @@ -371,7 +371,7 @@ class PortableGreyMap: * \param x point (global coordinates) at which to evaluate the derivative * \param d will contain the derivative at x after return */ - virtual void evaluateDerivative(const DomainType& x DUNE_UNUSED, DerivativeType& d DUNE_UNUSED) const + virtual void evaluateDerivative([[maybe_unused]] const DomainType& x, [[maybe_unused]] DerivativeType& d) const { DUNE_THROW(Dune::NotImplemented, "Derivative not implemented"); } @@ -382,7 +382,7 @@ class PortableGreyMap: * \param x point in local coordinates at which to evaluate the derivative * \param d will contain the derivative at x after return */ - virtual void evaluateDerivativeLocal(const Element& e DUNE_UNUSED, const LocalDomainType& x DUNE_UNUSED, DerivativeType& d DUNE_UNUSED) const + virtual void evaluateDerivativeLocal([[maybe_unused]] const Element& e, [[maybe_unused]] const LocalDomainType& x, [[maybe_unused]] DerivativeType& d) const { DUNE_THROW(Dune::NotImplemented, "Derivative not implemented"); } diff --git a/dune/fufem/functionspacebases/q1nodalbasis.hh b/dune/fufem/functionspacebases/q1nodalbasis.hh index 86d1fcb6..129c7f21 100644 --- a/dune/fufem/functionspacebases/q1nodalbasis.hh +++ b/dune/fufem/functionspacebases/q1nodalbasis.hh @@ -55,7 +55,7 @@ class Q1NodalBasis : return gridview_.indexSet().size(dim); } - const LocalFiniteElement& getLocalFiniteElement(const Element& e DUNE_UNUSED) const + const LocalFiniteElement& getLocalFiniteElement([[maybe_unused]] const Element& e) const { return localFE_; } diff --git a/dune/fufem/functionspacebases/refinedp1nodalbasis.hh b/dune/fufem/functionspacebases/refinedp1nodalbasis.hh index c907f638..cc9e699d 100644 --- a/dune/fufem/functionspacebases/refinedp1nodalbasis.hh +++ b/dune/fufem/functionspacebases/refinedp1nodalbasis.hh @@ -55,7 +55,7 @@ class RefinedP1NodalBasis : mapper_.update(); } - const LocalFiniteElement& getLocalFiniteElement(const Element& e DUNE_UNUSED) const + const LocalFiniteElement& getLocalFiniteElement([[maybe_unused]] const Element& e) const { return fe_; } diff --git a/dune/fufem/test/boundarypatchtest.cc b/dune/fufem/test/boundarypatchtest.cc index e0564c6c..6e383610 100644 --- a/dune/fufem/test/boundarypatchtest.cc +++ b/dune/fufem/test/boundarypatchtest.cc @@ -47,7 +47,7 @@ struct BoundaryPatchTestSuite // Test copy construction BP fooBoundary = boundary; - int c DUNE_UNUSED; + [[maybe_unused]] int c; c = fooBoundary.gridView().indexSet().size(0); // make the copy do something useful // Test assignment @@ -70,7 +70,7 @@ struct BoundaryPatchTestSuite // Test leaf copy construction BoundaryPatch<typename GridType::LeafGridView> leafBoundary(grid.leafGridView(), true); BoundaryPatch<typename GridType::LeafGridView> foo = leafBoundary; - int c DUNE_UNUSED; + [[maybe_unused]] int c; c = foo.gridView().indexSet().size(0); // make the copy do something useful -- GitLab