]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make the arguments const
authorDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Thu, 22 Nov 2018 17:39:07 +0000 (18:39 +0100)
committerDaniel Garcia-Sanchez <daniel.garcia-sanchez@insp.upmc.fr>
Wed, 9 Jan 2019 18:29:18 +0000 (19:29 +0100)
include/deal.II/base/hdf5.h
source/base/hdf5.cc

index cf3a3b29d0ca5f48951ba68022bf8061eb596858..5af01783663819418884a5561ea6f35b156e1095 100644 (file)
@@ -857,7 +857,7 @@ namespace HDF5
      * This function sets the boolean query_io_mode.
      */
     void
-    set_query_io_mode(bool query_io_mode);
+    set_query_io_mode(const bool query_io_mode);
 
     /**
      * This function returns the dimensions of the dataset. The vector
index 6e3b2817e59b7f69a3dd2bf34c43a4ec5c3f7270..8885254d3306431e2f758a2557689e8d7e124cd8 100644 (file)
@@ -193,7 +193,7 @@ namespace HDF5
       std::is_same<Container,
                    std::vector<typename Container::value_type>>::value,
       Container>::type
-    initialize_container(std::vector<hsize_t> dimensions)
+    initialize_container(const std::vector<hsize_t> dimensions)
     {
       return Container(std::accumulate(
         dimensions.begin(), dimensions.end(), 1, std::multiplies<int>()));
@@ -205,7 +205,7 @@ namespace HDF5
     typename std::enable_if<
       std::is_same<Container, Vector<typename Container::value_type>>::value,
       Container>::type
-    initialize_container(std::vector<hsize_t> dimensions)
+    initialize_container(const std::vector<hsize_t> dimensions)
     {
       return Container(std::accumulate(
         dimensions.begin(), dimensions.end(), 1, std::multiplies<int>()));
@@ -218,7 +218,7 @@ namespace HDF5
       std::is_same<Container,
                    FullMatrix<typename Container::value_type>>::value,
       Container>::type
-    initialize_container(std::vector<hsize_t> dimensions)
+    initialize_container(const std::vector<hsize_t> dimensions)
     {
       // If the rank is higher than 2, then remove single-dimensional entries
       // from the shape defined by dimensions. This is equivalent to the squeeze
@@ -228,7 +228,7 @@ namespace HDF5
 
       if (dimensions.size() > 2)
         {
-          for (auto &&dimension : dimensions)
+          for (const auto &dimension : dimensions)
             {
               if (dimension > 1)
                 squeezed_dimensions.push_back(dimension);
@@ -247,7 +247,7 @@ namespace HDF5
 
     // Convert a HDF5 no_collective_cause code to a human readable string
     std::string
-    no_collective_cause_to_string(uint32_t no_collective_cause)
+    no_collective_cause_to_string(const uint32_t no_collective_cause)
     {
       std::string message;
 
@@ -1349,7 +1349,7 @@ namespace HDF5
 
 
   void
-  DataSet::set_query_io_mode(bool new_query_io_mode)
+  DataSet::set_query_io_mode(const bool new_query_io_mode)
   {
     query_io_mode = new_query_io_mode;
   }

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.