From bfcba411190db38cf262e40098864ce55f74fb57 Mon Sep 17 00:00:00 2001 From: Matthias Maier Date: Sat, 9 Aug 2014 01:22:38 +0200 Subject: [PATCH] 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. --- source/grid/manifold_lib.cc | 40 +++++++++++++++++++------------------ 1 file changed, 21 insertions(+), 19 deletions(-) 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 -- 2.39.5