From: Wolfgang Bangerth Date: Tue, 11 Mar 2025 00:35:46 +0000 (-0600) Subject: Use functions/types from std:: instead of ::. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36cf65b66708f236b67fbfdef6da63b703c7af1e;p=dealii.git Use functions/types from std:: instead of ::. --- diff --git a/include/deal.II/base/aligned_vector.h b/include/deal.II/base/aligned_vector.h index 09be5577c0..1ae7ebb812 100644 --- a/include/deal.II/base/aligned_vector.h +++ b/include/deal.II/base/aligned_vector.h @@ -514,9 +514,9 @@ private: * region, and release the old memory. */ void - allocate_and_move(const size_t old_size, - const size_t new_size, - const size_t new_allocated_size); + allocate_and_move(const std::size_t old_size, + const std::size_t new_size, + const std::size_t new_allocated_size); /** * A class that is used as the "deleter" for a `std::unique_ptr` object that @@ -1431,9 +1431,9 @@ AlignedVector::resize(const size_type new_size, const T &init) template inline void -AlignedVector::allocate_and_move(const size_t old_size, - const size_t new_size, - const size_t new_allocated_size) +AlignedVector::allocate_and_move(const std::size_t old_size, + const std::size_t new_size, + const std::size_t new_allocated_size) { // allocate and align along 64-byte boundaries (this is enough for all // levels of vectorization currently supported by deal.II) diff --git a/include/deal.II/base/memory_consumption.h b/include/deal.II/base/memory_consumption.h index 8a4e58061c..0762378bf7 100644 --- a/include/deal.II/base/memory_consumption.h +++ b/include/deal.II/base/memory_consumption.h @@ -286,7 +286,7 @@ namespace MemoryConsumption } else { - return sizeof(char) * (strlen(string) /*Remember the NUL*/ + 1); + return sizeof(char) * (std::strlen(string) /*Remember the NUL*/ + 1); } } diff --git a/include/deal.II/base/mpi.h b/include/deal.II/base/mpi.h index 382e1adb3d..3bc3222e95 100644 --- a/include/deal.II/base/mpi.h +++ b/include/deal.II/base/mpi.h @@ -1261,7 +1261,7 @@ namespace Utilities template void broadcast(T *buffer, - const size_t count, + const std::size_t count, const unsigned int root, const MPI_Comm comm); @@ -2134,7 +2134,7 @@ namespace Utilities template void broadcast(T *buffer, - const size_t count, + const std::size_t count, const unsigned int root, const MPI_Comm comm) { diff --git a/include/deal.II/base/signaling_nan.h b/include/deal.II/base/signaling_nan.h index 9534501956..a2c5056493 100644 --- a/include/deal.II/base/signaling_nan.h +++ b/include/deal.II/base/signaling_nan.h @@ -81,7 +81,7 @@ namespace numbers }; - template + template struct NaNInitializer> { static VectorizedArray diff --git a/include/deal.II/base/table.h b/include/deal.II/base/table.h index 82d59f822e..78322fd176 100644 --- a/include/deal.II/base/table.h +++ b/include/deal.II/base/table.h @@ -165,8 +165,8 @@ namespace internal using iterator = typename Types::iterator; using const_iterator = typename Types::const_iterator; - using size_type = size_t; - using difference_type = ptrdiff_t; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; private: /** @@ -251,8 +251,8 @@ namespace internal using reference = typename Types::reference; using const_reference = typename Types::const_reference; - using size_type = size_t; - using difference_type = ptrdiff_t; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; /** * Import an alias from the switch class above. diff --git a/include/deal.II/base/utilities.h b/include/deal.II/base/utilities.h index 85159ca412..b81ff96651 100644 --- a/include/deal.II/base/utilities.h +++ b/include/deal.II/base/utilities.h @@ -575,7 +575,7 @@ namespace Utilities * most common use cases for this function). */ template - size_t + std::size_t pack(const T &object, std::vector &dest_buffer, const bool allow_compression = true); @@ -1378,7 +1378,7 @@ namespace Utilities template - size_t + std::size_t pack(const T &object, std::vector &dest_buffer, const bool allow_compression) diff --git a/include/deal.II/base/vectorization.h b/include/deal.II/base/vectorization.h index 85f1f2d34a..f7fa3f49ad 100644 --- a/include/deal.II/base/vectorization.h +++ b/include/deal.II/base/vectorization.h @@ -218,7 +218,7 @@ public: operator-(const VectorizedArrayIterator &other) const { return static_cast(lane) - - static_cast(other.lane); + static_cast(other.lane); } private: diff --git a/include/deal.II/grid/grid_tools.h b/include/deal.II/grid/grid_tools.h index d2b9afc1c4..ed61b87975 100644 --- a/include/deal.II/grid/grid_tools.h +++ b/include/deal.II/grid/grid_tools.h @@ -3159,7 +3159,8 @@ namespace GridTools if (cell->face(face)->has_children() && !cell->face(face)->at_boundary()) { - if (static_cast(cell->face(face)->refinement_case()) == + if (static_cast( + cell->face(face)->refinement_case()) == RefinementCase::isotropic_refinement) { Assert(cell->reference_cell() == diff --git a/include/deal.II/grid/reference_cell.h b/include/deal.II/grid/reference_cell.h index e1691f8863..bffec5089c 100644 --- a/include/deal.II/grid/reference_cell.h +++ b/include/deal.II/grid/reference_cell.h @@ -3242,14 +3242,14 @@ ReferenceCell::face_tangent_vector(const unsigned int face_no, AssertIndexRange(face_no, 5); static const ndarray, 5, 2> table = { {{{Point(0, 1, 0), Point(1, 0, 0)}}, - {{Point(+1.0 / sqrt(2.0), 0, +1.0 / sqrt(2.0)), + {{Point(+1.0 / std::sqrt(2.0), 0, +1.0 / std::sqrt(2.0)), Point(0, 1, 0)}}, - {{Point(+1.0 / sqrt(2.0), 0, -1.0 / sqrt(2.0)), + {{Point(+1.0 / std::sqrt(2.0), 0, -1.0 / std::sqrt(2.0)), Point(0, 1, 0)}}, {{Point(1, 0, 0), - Point(0, +1.0 / sqrt(2.0), +1.0 / sqrt(2.0))}}, + Point(0, +1.0 / std::sqrt(2.0), +1.0 / std::sqrt(2.0))}}, {{Point(1, 0, 0), - Point(0, +1.0 / sqrt(2.0), -1.0 / sqrt(2.0))}}}}; + Point(0, +1.0 / std::sqrt(2.0), -1.0 / std::sqrt(2.0))}}}}; return table[face_no][i]; } diff --git a/include/deal.II/hp/collection.h b/include/deal.II/hp/collection.h index 67b346e8e4..55eb822a79 100644 --- a/include/deal.II/hp/collection.h +++ b/include/deal.II/hp/collection.h @@ -197,7 +197,7 @@ namespace hp operator-(const CollectionIterator &other) const { return static_cast(index) - - static_cast(other.index); + static_cast(other.index); } private: diff --git a/include/deal.II/numerics/data_out_dof_data.h b/include/deal.II/numerics/data_out_dof_data.h index aeb192c9c7..503cdbc534 100644 --- a/include/deal.II/numerics/data_out_dof_data.h +++ b/include/deal.II/numerics/data_out_dof_data.h @@ -100,7 +100,7 @@ namespace Exceptions DeclException2( ExcInvalidCharacter, std::string, - size_t, + std::size_t, << "Please use only the characters [a-zA-Z0-9_<>()] for" << std::endl << "description strings since some graphics formats will only accept these." << std::endl diff --git a/include/deal.II/numerics/rtree.h b/include/deal.II/numerics/rtree.h index 4ccd8e2d48..5b5bd76bf8 100644 --- a/include/deal.II/numerics/rtree.h +++ b/include/deal.II/numerics/rtree.h @@ -381,12 +381,12 @@ struct ExtractLevelVisitor /** * Store the level we are currently visiting. */ - size_t level; + std::size_t level; /** * The level we want to extract from the RTree object. */ - const size_t target_level; + const std::size_t target_level; /** * A reference to the input vector of BoundingBox objects. @@ -571,7 +571,7 @@ ExtractLevelVisitor::operator()( return; } - const size_t level_backup = level; + const std::size_t level_backup = level; ++level; for (typename ElementsType::const_iterator it = elements.begin(); @@ -708,19 +708,19 @@ struct NodeVisitor : public boost::geometry::index::detail::rtree::visitor< /** * Store the level we are currently visiting. */ - size_t level; + std::size_t level; /** * Index used to keep track of the number of different visited nodes during * recursion/ */ - size_t node_counter; + std::size_t node_counter; /** * The level where children are living. * Before: "we want to extract from the RTree object." */ - const size_t target_level; + const std::size_t target_level; /** * A reference to the input vector of vector of BoundingBox objects. This @@ -791,7 +791,7 @@ NodeVisitor::operator()( return; } - size_t level_backup = level; + std::size_t level_backup = level; ++level; for (typename elements_type::const_iterator it = elements.begin(); diff --git a/source/base/job_identifier.cc b/source/base/job_identifier.cc index da40f68448..f61a9f62d8 100644 --- a/source/base/job_identifier.cc +++ b/source/base/job_identifier.cc @@ -36,8 +36,8 @@ JobIdentifier::get_dealjobid() JobIdentifier::JobIdentifier() { - time_t t = std::time(nullptr); - id = "JobId "; + std::time_t t = std::time(nullptr); + id = "JobId "; #if defined(DEAL_II_HAVE_UNISTD_H) && defined(DEAL_II_HAVE_GETHOSTNAME) char name[100]; diff --git a/source/grid/grid_refinement.cc b/source/grid/grid_refinement.cc index b43b1af63e..0991c89f95 100644 --- a/source/grid/grid_refinement.cc +++ b/source/grid/grid_refinement.cc @@ -349,7 +349,7 @@ GridRefinement::refine_and_coarsen_fixed_number( Vector tmp(criteria); if (refine_cells) { - if (static_cast(refine_cells) == criteria.size()) + if (static_cast(refine_cells) == criteria.size()) refine(tria, criteria, std::numeric_limits::lowest()); else { @@ -363,7 +363,7 @@ GridRefinement::refine_and_coarsen_fixed_number( if (coarsen_cells) { - if (static_cast(coarsen_cells) == criteria.size()) + if (static_cast(coarsen_cells) == criteria.size()) coarsen(tria, criteria, std::numeric_limits::max()); else { diff --git a/source/grid/tria.cc b/source/grid/tria.cc index 2637217acb..965c568992 100644 --- a/source/grid/tria.cc +++ b/source/grid/tria.cc @@ -960,7 +960,7 @@ namespace internal // Allocate sufficient memory. const unsigned int bytes_per_cell = sizes_fixed_cumulative.back(); - dest_data_fixed.resize(static_cast(local_num_cells) * + dest_data_fixed.resize(static_cast(local_num_cells) * bytes_per_cell); // Read packed data from file simultaneously. @@ -1085,7 +1085,7 @@ namespace internal sizes_fixed_cumulative.size() * sizeof(unsigned int)); const unsigned int bytes_per_cell = sizes_fixed_cumulative.back(); - dest_data_fixed.resize(static_cast(local_num_cells) * + dest_data_fixed.resize(static_cast(local_num_cells) * bytes_per_cell); // Read packed data. diff --git a/source/lac/trilinos_tpetra_sparsity_pattern.cc b/source/lac/trilinos_tpetra_sparsity_pattern.cc index 7c4857d225..cc96178063 100644 --- a/source/lac/trilinos_tpetra_sparsity_pattern.cc +++ b/source/lac/trilinos_tpetra_sparsity_pattern.cc @@ -41,7 +41,7 @@ namespace LinearAlgebra { // if we are asked to visit the past-the-end line, then simply // release all our caches and go on with life - if (static_cast(this->a_row) == sparsity_pattern->n_rows()) + if (static_cast(this->a_row) == sparsity_pattern->n_rows()) { colnum_cache.reset(); return; @@ -850,7 +850,7 @@ namespace LinearAlgebra trilinos_j) - col_indices.data(); - return static_cast(local_col_index) != col_indices.size(); + return static_cast(local_col_index) != col_indices.size(); # else (void)i; (void)j;