From: Xiaochuan Tian Date: Mon, 12 Aug 2024 21:38:50 +0000 (-0600) Subject: Replaced (void) cast with maybe unused | Modernize void cast X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b779149fb527f33415516632b28561dbd2c26f5;p=dealii.git Replaced (void) cast with maybe unused | Modernize void cast --- diff --git a/source/grid/grid_tools.cc b/source/grid/grid_tools.cc index 0afe7ca0f8..92fdf88df5 100644 --- a/source/grid/grid_tools.cc +++ b/source/grid/grid_tools.cc @@ -2121,14 +2121,13 @@ namespace GridTools void get_subdomain_association( const parallel::distributed::Triangulation - &triangulation, - const std::vector &cell_ids, - std::vector &subdomain_ids) + &triangulation, + const std::vector &cell_ids, + [[maybe_unused]] std::vector &subdomain_ids) { #ifndef DEAL_II_WITH_P4EST (void)triangulation; (void)cell_ids; - (void)subdomain_ids; Assert( false, ExcMessage( @@ -4201,14 +4200,13 @@ namespace GridTools std::map> DistributedComputeIntersectionLocationsInternal:: communicate_indices( - const std::vector> - &point_recv_components, - const MPI_Comm comm) const + [[maybe_unused]] const std::vector< + std::tuple> + &point_recv_components, + [[maybe_unused]] const MPI_Comm comm) const { #ifndef DEAL_II_WITH_MPI Assert(false, ExcNeedsMPI()); - (void)point_recv_components; - (void)comm; return {}; #else // since we are converting to DistributedComputePointLocationsInternal @@ -4436,8 +4434,8 @@ namespace GridTools marked_cell_tree; const auto answer_request = - [&](const unsigned int &other_rank, - const RequestType &request) -> AnswerType { + [&]([[maybe_unused]] const unsigned int &other_rank, + const RequestType &request) -> AnswerType { AnswerType answer; if (has_relevant_vertices) @@ -4456,7 +4454,7 @@ namespace GridTools const auto bb = BoundingBox(request[i].second) .create_extended(tolerance); - for (const auto &box_cell : + for ([[maybe_unused]] const auto &box_cell : marked_cell_tree | boost::geometry::index::adaptors::queried( boost::geometry::index::intersects(bb))) @@ -4492,8 +4490,6 @@ namespace GridTools } } #else - (void)other_rank; - (void)box_cell; Assert(false, ExcNeedsCGAL()); #endif } @@ -4606,12 +4602,10 @@ namespace GridTools template std::vector>> exchange_local_bounding_boxes( - const std::vector> &local_bboxes, - const MPI_Comm mpi_communicator) + [[maybe_unused]] const std::vector> &local_bboxes, + [[maybe_unused]] const MPI_Comm mpi_communicator) { #ifndef DEAL_II_WITH_MPI - (void)local_bboxes; - (void)mpi_communicator; Assert(false, ExcMessage( "GridTools::exchange_local_bounding_boxes() requires MPI.")); @@ -4704,10 +4698,9 @@ namespace GridTools RTree, unsigned int>> build_global_description_tree( const std::vector> &local_description, - const MPI_Comm mpi_communicator) + [[maybe_unused]] const MPI_Comm mpi_communicator) { #ifndef DEAL_II_WITH_MPI - (void)mpi_communicator; // Building a tree with the only boxes available without MPI std::vector, unsigned int>> boxes_index( local_description.size());