From 844579b7100ca44772fa7984a25a72a99dabf1df Mon Sep 17 00:00:00 2001 From: Oliver Sander <oliver.sander@tu-dresden.de> Date: Tue, 26 Jan 2016 06:36:15 +0100 Subject: [PATCH] Guard a few things by #ifndef NDEBUG that are only used within assertions This silences a few warnings when compiling with -DNDEBUG. --- dune/foamgrid/foamgrid/foamgrid.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dune/foamgrid/foamgrid/foamgrid.cc b/dune/foamgrid/foamgrid/foamgrid.cc index e033c4e..39a2dfb 100644 --- a/dune/foamgrid/foamgrid/foamgrid.cc +++ b/dune/foamgrid/foamgrid/foamgrid.cc @@ -540,8 +540,10 @@ void Dune::FoamGrid<dimgrid, dimworld>::refineSimplexElement(FoamGridEntityImp<2 array<FoamGridEntityImp<1, dimgrid, dimworld>*, 9> nextLevelFacets; std::size_t facetIndex=0; +#ifndef NDEBUG const Dune::ReferenceElement<double, dimgrid>& refElement = Dune::ReferenceElements<double, dimgrid>::general(element.type()); +#endif // I am just to dumb for a general facet to vertice mapping. // Therefore we just store it here @@ -552,9 +554,11 @@ void Dune::FoamGrid<dimgrid, dimworld>::refineSimplexElement(FoamGridEntityImp<2 for(FacetIterator facet=element.facet_.begin(); facet != element.facet_.end(); ++facet) { +#ifndef NDEBUG typedef FoamGridEntityImp<0, dimgrid, dimworld> FoamGridVertex; const FoamGridVertex* v0 = element.vertex_[refElement.subEntity(facetIndex/2, 1, 0, 2)]; const FoamGridVertex* v1 = element.vertex_[refElement.subEntity(facetIndex/2, 1, 1, 2)]; +#endif if(!(*facet)->nSons_) { -- GitLab