]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use functions/types from std:: instead of ::. 18222/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Tue, 11 Mar 2025 00:35:46 +0000 (18:35 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Tue, 11 Mar 2025 03:31:05 +0000 (21:31 -0600)
16 files changed:
include/deal.II/base/aligned_vector.h
include/deal.II/base/memory_consumption.h
include/deal.II/base/mpi.h
include/deal.II/base/signaling_nan.h
include/deal.II/base/table.h
include/deal.II/base/utilities.h
include/deal.II/base/vectorization.h
include/deal.II/grid/grid_tools.h
include/deal.II/grid/reference_cell.h
include/deal.II/hp/collection.h
include/deal.II/numerics/data_out_dof_data.h
include/deal.II/numerics/rtree.h
source/base/job_identifier.cc
source/grid/grid_refinement.cc
source/grid/tria.cc
source/lac/trilinos_tpetra_sparsity_pattern.cc

index 09be5577c02b5005600fa7e1c19e904aec1b2857..1ae7ebb81273e6f0b2060ada2cb377d40ea841f1 100644 (file)
@@ -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<T>::resize(const size_type new_size, const T &init)
 
 template <class T>
 inline void
-AlignedVector<T>::allocate_and_move(const size_t old_size,
-                                    const size_t new_size,
-                                    const size_t new_allocated_size)
+AlignedVector<T>::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)
index 8a4e58061c27ff00d22534a1a1f3aa9dbc1fa73b..0762378bf70be681034fd916f03c4c6d8c490922 100644 (file)
@@ -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);
       }
   }
 
index 382e1adb3df21e5b85020bf54c7d0d8f789ebf76..3bc3222e95aa9606c993ca47a20211189437c2dc 100644 (file)
@@ -1261,7 +1261,7 @@ namespace Utilities
     template <typename T>
     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 <typename T>
     void
     broadcast(T                 *buffer,
-              const size_t       count,
+              const std::size_t  count,
               const unsigned int root,
               const MPI_Comm     comm)
     {
index 9534501956b084e0b2c5ebd961031832915ab05d..a2c5056493fb1fecddd532e57aab068b5d0b8ce1 100644 (file)
@@ -81,7 +81,7 @@ namespace numbers
       };
 
 
-      template <typename T, size_t width>
+      template <typename T, std::size_t width>
       struct NaNInitializer<VectorizedArray<T, width>>
       {
         static VectorizedArray<T, width>
index 82d59f822ecc60774ef8cb164f4585cc09b976ec..78322fd176abf739793fc9d5e058a00afa287e00 100644 (file)
@@ -165,8 +165,8 @@ namespace internal
       using iterator       = typename Types<N, T, C>::iterator;
       using const_iterator = typename Types<N, T, C>::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<N, T, C>::reference;
       using const_reference = typename Types<N, T, C>::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.
index 85159ca4123954d3c358fdb9376e408cc2f79067..b81ff966512acb55ac73708a95543c54720a7b15 100644 (file)
@@ -575,7 +575,7 @@ namespace Utilities
    * most common use cases for this function).
    */
   template <typename T>
-  size_t
+  std::size_t
   pack(const T           &object,
        std::vector<char> &dest_buffer,
        const bool         allow_compression = true);
@@ -1378,7 +1378,7 @@ namespace Utilities
 
 
   template <typename T>
-  size_t
+  std::size_t
   pack(const T           &object,
        std::vector<char> &dest_buffer,
        const bool         allow_compression)
index 85f1f2d34ae90f09015e2429c7ff8760c2fcfd36..f7fa3f49ade8766a5b90d82bc3224a879ea8a690 100644 (file)
@@ -218,7 +218,7 @@ public:
   operator-(const VectorizedArrayIterator<T> &other) const
   {
     return static_cast<std::ptrdiff_t>(lane) -
-           static_cast<ptrdiff_t>(other.lane);
+           static_cast<std::ptrdiff_t>(other.lane);
   }
 
 private:
index d2b9afc1c486b9451d6d54fb5a4d136239b83024..ed61b87975b8d94c8d9b83b59f141ab23dbcb8eb 100644 (file)
@@ -3159,7 +3159,8 @@ namespace GridTools
             if (cell->face(face)->has_children() &&
                 !cell->face(face)->at_boundary())
               {
-                if (static_cast<uint8_t>(cell->face(face)->refinement_case()) ==
+                if (static_cast<std::uint8_t>(
+                      cell->face(face)->refinement_case()) ==
                     RefinementCase<dim - 1>::isotropic_refinement)
                   {
                     Assert(cell->reference_cell() ==
index e1691f886350710bde56f7b82c6167a83e566642..bffec5089cfded8f0cf87d4c5a227d30b399c01f 100644 (file)
@@ -3242,14 +3242,14 @@ ReferenceCell::face_tangent_vector(const unsigned int face_no,
           AssertIndexRange(face_no, 5);
           static const ndarray<Tensor<1, dim>, 5, 2> table = {
             {{{Point<dim>(0, 1, 0), Point<dim>(1, 0, 0)}},
-             {{Point<dim>(+1.0 / sqrt(2.0), 0, +1.0 / sqrt(2.0)),
+             {{Point<dim>(+1.0 / std::sqrt(2.0), 0, +1.0 / std::sqrt(2.0)),
                Point<dim>(0, 1, 0)}},
-             {{Point<dim>(+1.0 / sqrt(2.0), 0, -1.0 / sqrt(2.0)),
+             {{Point<dim>(+1.0 / std::sqrt(2.0), 0, -1.0 / std::sqrt(2.0)),
                Point<dim>(0, 1, 0)}},
              {{Point<dim>(1, 0, 0),
-               Point<dim>(0, +1.0 / sqrt(2.0), +1.0 / sqrt(2.0))}},
+               Point<dim>(0, +1.0 / std::sqrt(2.0), +1.0 / std::sqrt(2.0))}},
              {{Point<dim>(1, 0, 0),
-               Point<dim>(0, +1.0 / sqrt(2.0), -1.0 / sqrt(2.0))}}}};
+               Point<dim>(0, +1.0 / std::sqrt(2.0), -1.0 / std::sqrt(2.0))}}}};
 
           return table[face_no][i];
         }
index 67b346e8e4c7f0705651c6d8f020048ca38821ec..55eb822a796d5066072f9467fb562e0126f67f51 100644 (file)
@@ -197,7 +197,7 @@ namespace hp
     operator-(const CollectionIterator<T> &other) const
     {
       return static_cast<std::ptrdiff_t>(index) -
-             static_cast<ptrdiff_t>(other.index);
+             static_cast<std::ptrdiff_t>(other.index);
     }
 
   private:
index aeb192c9c713fb6fb3338e48568929bb3e0148c5..503cdbc53483f1688d65643a1d857d052c40e6fb 100644 (file)
@@ -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
index 4ccd8e2d4890871f838e19bdbcbb3b72143210e4..5b5bd76bf8157deac3c34660cedee54c195dbfeb 100644 (file)
@@ -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<Value, Options, Translator, Box, Allocators>::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<Value, Options, Translator, Box, Allocators>::operator()(
       return;
     }
 
-  size_t level_backup = level;
+  std::size_t level_backup = level;
   ++level;
 
   for (typename elements_type::const_iterator it = elements.begin();
index da40f684486993967a0920d24092dc3ee589e656..f61a9f62d8c781aa4de860628e9b3543acf559fe 100644 (file)
@@ -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];
index b43b1af63e2b14318cb963fbf55d26be02d3b2e4..0991c89f95750fe1b33d665ae6821a9e9dd54e88 100644 (file)
@@ -349,7 +349,7 @@ GridRefinement::refine_and_coarsen_fixed_number(
       Vector<Number> tmp(criteria);
       if (refine_cells)
         {
-          if (static_cast<size_t>(refine_cells) == criteria.size())
+          if (static_cast<std::size_t>(refine_cells) == criteria.size())
             refine(tria, criteria, std::numeric_limits<double>::lowest());
           else
             {
@@ -363,7 +363,7 @@ GridRefinement::refine_and_coarsen_fixed_number(
 
       if (coarsen_cells)
         {
-          if (static_cast<size_t>(coarsen_cells) == criteria.size())
+          if (static_cast<std::size_t>(coarsen_cells) == criteria.size())
             coarsen(tria, criteria, std::numeric_limits<double>::max());
           else
             {
index 2637217acb65fde60a9621fba8c7c8c6e2378df9..965c568992644baa541d77681c2db491267e8bfe 100644 (file)
@@ -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<size_t>(local_num_cells) *
+          dest_data_fixed.resize(static_cast<std::size_t>(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<size_t>(local_num_cells) *
+          dest_data_fixed.resize(static_cast<std::size_t>(local_num_cells) *
                                  bytes_per_cell);
 
           // Read packed data.
index 7c4857d2259d7b06f4faad0bd6b9b74f72119707..cc96178063a005c818896573faeff32c0fa33fcb 100644 (file)
@@ -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<size_t>(this->a_row) == sparsity_pattern->n_rows())
+        if (static_cast<std::size_t>(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<size_t>(local_col_index) != col_indices.size();
+      return static_cast<std::size_t>(local_col_index) != col_indices.size();
 #  else
       (void)i;
       (void)j;

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.