From 0e0aa9241448ae878e24eaa1d3236da8f0395330 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 9 Jun 2017 18:57:31 -0600 Subject: [PATCH] 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(). --- source/base/parameter_handler.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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) && -- 2.39.5