From: Matthias Maier Date: Fri, 8 Aug 2014 23:22:38 +0000 (+0200) Subject: Silence a warning X-Git-Tag: v8.2.0-rc1~209^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F78%2Fhead;p=dealii.git Silence a warning A logical construct of the form "EXPR && EXPR || EXPR" in manifold_lib.cc triggered a bunch of warning. Silence them by explicitly enclosing the intended precedence: (EXPR && EXPR) || EXPR. Also run reindent on the file. --- diff --git a/source/grid/manifold_lib.cc b/source/grid/manifold_lib.cc index c2e0a42279..b164676afa 100644 --- a/source/grid/manifold_lib.cc +++ b/source/grid/manifold_lib.cc @@ -226,10 +226,10 @@ FunctionManifold::FunctionManifold template FunctionManifold::FunctionManifold (const std::string push_forward_expression, - const std::string pull_back_expression, - const Point periodicity, + const std::string pull_back_expression, + const Point periodicity, const typename FunctionParser::ConstMap const_map, - const std::string chart_vars, + const std::string chart_vars, const std::string space_vars, const double tolerance) : ChartManifold(periodicity), @@ -237,8 +237,8 @@ FunctionManifold::FunctionManifold tolerance(tolerance), owns_pointers(true) { - FunctionParser * pf = new FunctionParser(spacedim); - FunctionParser * pb = new FunctionParser(chartdim); + FunctionParser *pf = new FunctionParser(spacedim); + FunctionParser *pb = new FunctionParser(chartdim); pf->initialize(chart_vars, push_forward_expression, const_map); pb->initialize(space_vars, pull_back_expression, const_map); push_forward_function = pf; @@ -246,18 +246,20 @@ FunctionManifold::FunctionManifold } template -FunctionManifold::~FunctionManifold() { - if(owns_pointers == true) { - const Function * pf = push_forward_function; - push_forward_function = 0; - delete pf; - - const Function * pb = pull_back_function; - pull_back_function = 0; - delete pb; - } +FunctionManifold::~FunctionManifold() +{ + if (owns_pointers == true) + { + const Function *pf = push_forward_function; + push_forward_function = 0; + delete pf; + + const Function *pb = pull_back_function; + pull_back_function = 0; + delete pb; + } } - + template Point FunctionManifold::push_forward(const Point &chart_point) const @@ -272,9 +274,9 @@ FunctionManifold::push_forward(const Point &cha Vector pb(chartdim); pull_back_function->vector_value(result, pb); for (unsigned int i=0; i tolerance && - (abs(pb[i]-chart_point[i]) < tolerance*chart_point.norm() ) || - (abs(pb[i]-chart_point[i]) < tolerance) ), + Assert((chart_point.norm() > tolerance && + (abs(pb[i]-chart_point[i]) < tolerance*chart_point.norm())) || + (abs(pb[i]-chart_point[i]) < tolerance), ExcMessage("The push forward is not the inverse of the pull back! Bailing out.")); #endif