From 63c2169edc163ebac32e5f436fb9634a66d457f2 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 12 Dec 2018 23:51:11 +0100 Subject: [PATCH] Update clang-tidy checks --- contrib/utilities/run_clang_tidy.sh | 10 ++++++---- source/fe/fe_poly.cc | 12 ++++++++---- source/lac/trilinos_sparsity_pattern.cc | 15 +++++++++------ 3 files changed, 23 insertions(+), 14 deletions(-) diff --git a/contrib/utilities/run_clang_tidy.sh b/contrib/utilities/run_clang_tidy.sh index 401f058731..06d1bb66ee 100755 --- a/contrib/utilities/run_clang_tidy.sh +++ b/contrib/utilities/run_clang_tidy.sh @@ -47,12 +47,14 @@ ARGS="-D DEAL_II_WITH_MUPARSER=OFF -D DEAL_II_WITH_MPI=ON -D CMAKE_EXPORT_COMPIL # disable performance-inefficient-string-concatenation because we don't care about "a"+to_string(5)+... CHECKS="-*, - mpi-*, - performance-*, - -performance-inefficient-string-concatenation, + cppcoreguidelines-pro-type-static-cast-downcast, + google-readability-casting, modernize-use-emplace, modernize-deprecated-headers, - modernize-use-using" + modernize-use-using, + mpi-*, + performance-*, + -performance-inefficient-string-concatenation" CHECKS="$(echo "${CHECKS}" | tr -d '[:space:]')" echo "$CHECKS" diff --git a/source/fe/fe_poly.cc b/source/fe/fe_poly.cc index fc419f181b..2881ef1c85 100644 --- a/source/fe/fe_poly.cc +++ b/source/fe/fe_poly.cc @@ -47,7 +47,8 @@ FE_Poly, 1, 2>::fill_fe_values( // exception if that is not possible Assert(dynamic_cast(&fe_internal) != nullptr, ExcInternalError()); - const InternalData &fe_data = static_cast(fe_internal); + const InternalData &fe_data = + static_cast(fe_internal); // NOLINT // transform gradients and higher derivatives. there is nothing to do // for values since we already emplaced them into output_data when @@ -115,7 +116,8 @@ FE_Poly, 2, 3>::fill_fe_values( // exception if that is not possible Assert(dynamic_cast(&fe_internal) != nullptr, ExcInternalError()); - const InternalData &fe_data = static_cast(fe_internal); + const InternalData &fe_data = + static_cast(fe_internal); // NOLINT // transform gradients and higher derivatives. there is nothing to do // for values since we already emplaced them into output_data when @@ -182,7 +184,8 @@ FE_Poly, 1, 2>::fill_fe_values( // exception if that is not possible Assert(dynamic_cast(&fe_internal) != nullptr, ExcInternalError()); - const InternalData &fe_data = static_cast(fe_internal); + const InternalData &fe_data = + static_cast(fe_internal); // NOLINT // transform gradients and higher derivatives. there is nothing to do // for values since we already emplaced them into output_data when @@ -249,7 +252,8 @@ FE_Poly, 2, 3>::fill_fe_values( // exception if that is not possible Assert(dynamic_cast(&fe_internal) != nullptr, ExcInternalError()); - const InternalData &fe_data = static_cast(fe_internal); + const InternalData &fe_data = + static_cast(fe_internal); // NOLINT // transform gradients and higher derivatives. there is nothing to do // for values since we already emplaced them into output_data when diff --git a/source/lac/trilinos_sparsity_pattern.cc b/source/lac/trilinos_sparsity_pattern.cc index c0eba0764a..c6769aa313 100644 --- a/source/lac/trilinos_sparsity_pattern.cc +++ b/source/lac/trilinos_sparsity_pattern.cc @@ -462,7 +462,7 @@ namespace TrilinosWrappers // TODO A dynamic_cast fails here, this is suspicious. const auto &range_map = - static_cast(graph->RangeMap()); + static_cast(graph->RangeMap()); // NOLINT int ierr = graph->GlobalAssemble(*column_space_map, range_map, true); AssertThrow(ierr == 0, ExcTrilinosError(ierr)); @@ -814,7 +814,7 @@ namespace TrilinosWrappers { // TODO A dynamic_cast fails here, this is suspicious. const auto &range_map = - static_cast(graph->RangeMap()); + static_cast(graph->RangeMap()); // NOLINT ierr = graph->GlobalAssemble(*column_space_map, range_map, true); AssertThrow(ierr == 0, ExcTrilinosError(ierr)); } @@ -1035,7 +1035,7 @@ namespace TrilinosWrappers { // TODO A dynamic_cast fails here, this is suspicious. const auto &domain_map = - static_cast(graph->DomainMap()); + static_cast(graph->DomainMap()); // NOLINT return domain_map; } @@ -1045,7 +1045,8 @@ namespace TrilinosWrappers SparsityPattern::range_partitioner() const { // TODO A dynamic_cast fails here, this is suspicious. - const auto &range_map = static_cast(graph->RangeMap()); + const auto &range_map = + static_cast(graph->RangeMap()); // NOLINT return range_map; } @@ -1055,7 +1056,8 @@ namespace TrilinosWrappers SparsityPattern::row_partitioner() const { // TODO A dynamic_cast fails here, this is suspicious. - const auto &row_map = static_cast(graph->RowMap()); + const auto &row_map = + static_cast(graph->RowMap()); // NOLINT return row_map; } @@ -1065,7 +1067,8 @@ namespace TrilinosWrappers SparsityPattern::col_partitioner() const { // TODO A dynamic_cast fails here, this is suspicious. - const auto &col_map = static_cast(graph->ColMap()); + const auto &col_map = + static_cast(graph->ColMap()); // NOLINT return col_map; } -- 2.39.5