From 8bbea8bf30ca6dc76f41d9c5d4cabec1d87b5efb Mon Sep 17 00:00:00 2001 From: David Wells Date: Tue, 3 Jan 2017 12:55:33 -0500 Subject: [PATCH] Clarify comparison order in a ternary operator. This was caught by cppcheck. --- .../matrix_free/mapping_info.templates.h | 6 +++--- source/fe/fe_dgp_nonparametric.cc | 18 +++++++++--------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/deal.II/matrix_free/mapping_info.templates.h b/include/deal.II/matrix_free/mapping_info.templates.h index 6e98153867..09028d4940 100644 --- a/include/deal.II/matrix_free/mapping_info.templates.h +++ b/include/deal.II/matrix_free/mapping_info.templates.h @@ -245,9 +245,9 @@ namespace internal std::vector > > fe_values (current_data.quadrature.size()); UpdateFlags update_flags_feval = - (update_flags & update_inverse_jacobians ? update_jacobians : update_default) | - (update_flags & update_jacobian_grads ? update_jacobian_grads : update_default) | - (update_flags & update_quadrature_points ? update_quadrature_points : update_default); + ((update_flags & update_inverse_jacobians) ? update_jacobians : update_default) | + ((update_flags & update_jacobian_grads) ? update_jacobian_grads : update_default) | + ((update_flags & update_quadrature_points) ? update_quadrature_points : update_default); // resize the fields that have fixed size or for which we know // something from an earlier loop diff --git a/source/fe/fe_dgp_nonparametric.cc b/source/fe/fe_dgp_nonparametric.cc index 58a93dc7f6..7e56ea3c92 100644 --- a/source/fe/fe_dgp_nonparametric.cc +++ b/source/fe/fe_dgp_nonparametric.cc @@ -293,9 +293,9 @@ fill_fe_values (const typename Triangulation::cell_iterator &, const unsigned int n_q_points = mapping_data.quadrature_points.size(); - std::vector values(fe_internal.update_each & update_values ? this->dofs_per_cell : 0); - std::vector > grads(fe_internal.update_each & update_gradients ? this->dofs_per_cell : 0); - std::vector > grad_grads(fe_internal.update_each & update_hessians ? this->dofs_per_cell : 0); + std::vector values((fe_internal.update_each & update_values) ? this->dofs_per_cell : 0); + std::vector > grads((fe_internal.update_each & update_gradients) ? this->dofs_per_cell : 0); + std::vector > grad_grads((fe_internal.update_each & update_hessians) ? this->dofs_per_cell : 0); std::vector > empty_vector_of_3rd_order_tensors; std::vector > empty_vector_of_4th_order_tensors; @@ -339,9 +339,9 @@ fill_fe_face_values (const typename Triangulation::cell_iterator & const unsigned int n_q_points = mapping_data.quadrature_points.size(); - std::vector values(fe_internal.update_each & update_values ? this->dofs_per_cell : 0); - std::vector > grads(fe_internal.update_each & update_gradients ? this->dofs_per_cell : 0); - std::vector > grad_grads(fe_internal.update_each & update_hessians ? this->dofs_per_cell : 0); + std::vector values((fe_internal.update_each & update_values) ? this->dofs_per_cell : 0); + std::vector > grads((fe_internal.update_each & update_gradients) ? this->dofs_per_cell : 0); + std::vector > grad_grads((fe_internal.update_each & update_hessians) ? this->dofs_per_cell : 0); std::vector > empty_vector_of_3rd_order_tensors; std::vector > empty_vector_of_4th_order_tensors; @@ -386,9 +386,9 @@ fill_fe_subface_values (const typename Triangulation::cell_iterato const unsigned int n_q_points = mapping_data.quadrature_points.size(); - std::vector values(fe_internal.update_each & update_values ? this->dofs_per_cell : 0); - std::vector > grads(fe_internal.update_each & update_gradients ? this->dofs_per_cell : 0); - std::vector > grad_grads(fe_internal.update_each & update_hessians ? this->dofs_per_cell : 0); + std::vector values((fe_internal.update_each & update_values) ? this->dofs_per_cell : 0); + std::vector > grads((fe_internal.update_each & update_gradients) ? this->dofs_per_cell : 0); + std::vector > grad_grads((fe_internal.update_each & update_hessians) ? this->dofs_per_cell : 0); std::vector > empty_vector_of_3rd_order_tensors; std::vector > empty_vector_of_4th_order_tensors; -- 2.39.5