From: Wolfgang Bangerth Date: Sat, 10 Jun 2017 00:57:31 +0000 (-0600) Subject: Use only enum values, don't look at bits. X-Git-Tag: v9.0.0-rc1~1497^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e0aa9241448ae878e24eaa1d3236da8f0395330;p=dealii.git Use only enum values, don't look at bits. This fixes an (undocumented) oddity in ParameterHandler::print_parameters(): We were at times looking at individual bits instead of just the declared values of ParameterHandler::OutputStyle. This presumably allowed for calling that function with a combination of the OutputStyle flags, for reasons that no longer seem particularly relevant nor obvious. This patch removes this possibility from the current implementation of the function, but retains it for the (deprecated) function ParameterHandler::print_parameters_section(). --- diff --git a/source/base/parameter_handler.cc b/source/base/parameter_handler.cc index 9d2f8b9995..ae4e5d35ac 100644 --- a/source/base/parameter_handler.cc +++ b/source/base/parameter_handler.cc @@ -2386,7 +2386,7 @@ ParameterHandler::recursively_print_parameters (const std::vector & // the documentation, and then the actual entry; break the // documentation into readable chunks such that the whole // thing is at most 78 characters wide - if ((!(style & 128)) && + if ((style == Text) && !p->second.get("documentation").empty()) { if (first_entry == false) @@ -2417,7 +2417,7 @@ ParameterHandler::recursively_print_parameters (const std::vector & // finally print the default value, but only if it differs // from the actual value - if ((!(style & 64)) && value != p->second.get("default_value")) + if ((style == Text) && value != p->second.get("default_value")) { out << std::setw(longest_value-value.length()+1) << ' ' << "# "; @@ -2612,7 +2612,7 @@ ParameterHandler::recursively_print_parameters (const std::vector & if ((style != Description) && - (!(style & 128)) + (style != ShortText) && (n_parameters != 0) &&