From: David Wells Date: Tue, 3 Jan 2017 17:55:33 +0000 (-0500) Subject: Clarify comparison order in a ternary operator. X-Git-Tag: v8.5.0-rc1~291^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F3731%2Fhead;p=dealii.git Clarify comparison order in a ternary operator. This was caught by cppcheck. --- 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;