]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix some warnings in tests with clang-10
authorDaniel Arndt <arndtd@ornl.gov>
Tue, 7 Apr 2020 16:28:41 +0000 (12:28 -0400)
committerDaniel Arndt <arndtd@ornl.gov>
Tue, 7 Apr 2020 17:46:12 +0000 (13:46 -0400)
tests/base/mpi_noncontiguous_partitioner_02.cc
tests/base/transpose_table_iterators_1.cc
tests/data_out/data_out_12.cc
tests/data_out/data_out_13.cc
tests/distributed_grids/intergrid_transfer_representation_parallel.cc
tests/grid/mesh_3d_17.cc
tests/grid/user_data_01.cc
tests/matrix_free/iterators.cc
tests/matrix_free/mapping_info_01.cc
tests/mpi/parallel_partitioner_09.cc
tests/numerics/project_bv_curl_conf_04.cc

index 0e00e1c86880da3fce41730104789e66505742fe..d419bd6974ef90474aefa037d4e1bda549b3fc6d 100644 (file)
@@ -81,7 +81,7 @@ test(const MPI_Comm &comm, const bool do_revert, const unsigned int dir)
         for (unsigned int i = 0; i < dim; i++)
           c[i] = c[i] / delta;
 
-        const unsigned int lid = norm_point_to_lex(c);
+        const auto lid = static_cast<unsigned int>(norm_point_to_lex(c));
 
         for (unsigned int i = lid * n_points_cell;
              i < (lid + 1) * n_points_cell;
index 7f59b0dda283165b31fd0aa9dc5646338c0472f7..661483ee041e47305008d73b5313c19fbde661cc 100644 (file)
@@ -31,7 +31,7 @@ main()
   // test a non-empty rectangular table
   TransposeTable<double> table(3, 4);
   std::iota(table.begin(), table.end(), 1.0);
-  for (const auto entry : table)
+  for (const auto &entry : table)
     {
       deallog << entry.row() << ", " << entry.column() << ", " << entry.value()
               << std::endl;
index ff36bcbdda723e992411de2b85f13f90fe51a533..59a8f5aa7a936fed15e497c5765504f356174778 100644 (file)
@@ -132,7 +132,7 @@ check()
             {
               // find matching location
               unsigned int p = 0;
-              for (const auto c : coords)
+              for (const auto &c : coords)
                 {
                   Point<dim> point;
                   for (unsigned int d = 0; d < dim; ++d)
index 42a53904255ed11cc89c09697a1faf09d4dad052..0af98f7e3e4bd8acbd36cffba1999e7015e70411 100644 (file)
@@ -132,7 +132,7 @@ check()
             {
               // find matching location
               unsigned int p = 0;
-              for (const auto c : coords)
+              for (const auto &c : coords)
                 {
                   Point<dim> point;
                   for (unsigned int d = 0; d < dim; ++d)
index e9f05f423d6540552d8b11f43db636d9a8d7e21f..d102b9390dac1bd09a6acc2d6609ebf8c0f24ae5 100644 (file)
@@ -103,7 +103,7 @@ test(unsigned n_refinements)
       for (TransferRep::value_type::const_iterator it = m.begin();
            it != m.end();
            ++it)
-        local_sum += it->second;
+        local_sum += static_cast<unsigned int>(it->second);
     }
 
   unsigned global_sum = Utilities::MPI::sum(local_sum, MPI_COMM_WORLD);
index d901cb5cd38562f2ff9167a52f5c0ec73e7ccb92..22a830b898c2c59963ef30b4d8486d2458167f50 100644 (file)
@@ -111,7 +111,8 @@ void check(Triangulation<3> &tria)
                 // we used to abort in the
                 // following call, due to a
                 // wrong Assert condition:
-                cell->neighbor_child_on_subface(face_no, subface_no);
+                auto dummy =
+                  cell->neighbor_child_on_subface(face_no, subface_no);
               }
           }
       }
index 9609bbb8bce8af502e36965f4afd31489cfb7677..4b9443a6206f297d21d1e23962ec0949f0608145 100644 (file)
@@ -179,11 +179,11 @@ user_pointers(Triangulation<dim> &tr)
   // Create two pointer index clashes here
   try
     {
-      tr.begin()->user_index();
+      auto dummy = tr.begin()->user_index();
     }
   catch (...)
     {}
-  tr.begin()->user_pointer();
+  auto dummy = tr.begin()->user_pointer();
 
 
   // Check if save and load work
@@ -259,13 +259,13 @@ user_indices(Triangulation<dim> &tr)
   // Create two pointer index clashes here
   try
     {
-      tr.begin()->user_pointer();
+      auto dummy = tr.begin()->user_pointer();
     }
   catch (ExceptionBase &e)
     {
       deallog << e.get_exc_name() << std::endl;
     }
-  tr.begin()->user_index();
+  auto dummy = tr.begin()->user_index();
 
 
 
index c951ae903fd4ec9494e4f7076b9fe207c3e6fb88..ad48a129c76e44701ebc93b071b6c68976b95824 100644 (file)
@@ -105,7 +105,7 @@ public:
         for (const auto cell : cells)
           deallog << "cell:      " << cell.to_string() << std::endl;
 
-        for (const auto face : faces)
+        for (const auto &face : faces)
           deallog << "face:      " << face.first.to_string() << " "
                   << face.second.to_string() << std::endl;
 
index 1afa066ca7d4f6f8b34a861d9af45564579b5a93..5675b98050ce0ccaba8eeb7768eb21252291e2e2 100644 (file)
@@ -55,14 +55,14 @@ test(const unsigned int degree)
   data.mapping_update_flags_boundary_faces =
     (update_gradients | update_JxW_values);
 
-  mf_data.reinit(
-    mapping,
-    std::vector<const DoFHandler<dim> *>({{&dof}}),
-    std::vector<const AffineConstraints<double> *>({{&constraints}}),
-    std::vector<Quadrature<1>>({{QGauss<1>(std::max(degree / 2, 1U)),
-                                 QGauss<1>(degree + 1),
-                                 QGauss<1>(3 * degree / 2)}}),
-    data);
+  mf_data.reinit(mapping,
+                 std::vector<const DoFHandler<dim> *>{&dof},
+                 std::vector<const AffineConstraints<double> *>{&constraints},
+                 std::vector<Quadrature<1>>{
+                   {QGauss<1>(std::max(degree / 2, 1U)),
+                    QGauss<1>(degree + 1),
+                    QGauss<1>(3 * degree / 2)}},
+                 data);
 
   deallog << std::setw(5) << degree;
   for (unsigned int index = 0; index < 3; ++index)
index a7ff3676c12b37c66b3149b1ac9d5f9497d57696..9606009b5f89fa034351daa1457cc59739b4ad44 100644 (file)
@@ -38,15 +38,15 @@ main(int argc, char **argv)
   Utilities::MPI::Partitioner part(owned, ghosted, MPI_COMM_WORLD);
 
   deallog << "ghost targets: ";
-  for (const auto p : part.ghost_targets())
+  for (const auto &p : part.ghost_targets())
     deallog << "p" << p.first << " n_indices=" << p.second << "   ";
   deallog << std::endl;
   deallog << "import targets: ";
-  for (const auto p : part.import_targets())
+  for (const auto &p : part.import_targets())
     deallog << "p" << p.first << " n_indices=" << p.second << "   ";
   deallog << std::endl;
   deallog << "import indices: ";
-  for (const auto p : part.import_indices())
+  for (const auto &p : part.import_indices())
     deallog << "[" << p.first << " " << p.second << ") ";
   deallog << std::endl;
 }
index 559ce11db9b40cadf0954f66f025e81923d94694..1e358b45c62933eaf823e29ed17d47f751c67f7d 100644 (file)
@@ -69,7 +69,6 @@ test_boundary_values(DoFHandler<dim> &   dof_handler,
                      unsigned int        start_comp,
                      Vector<double> &    vec)
 {
-  double ret = true;
   // Initialize
   QGaussLobatto<dim - 1> quadrature(3);
   FEFaceValues<dim>      fe_values(mapping,
@@ -138,6 +137,7 @@ test_boundary_values(DoFHandler<dim> &   dof_handler,
       num_cells++;
     }
   // Test if ok
+  bool ret = true;
   for (unsigned int bc = 0; bc < 6; ++bc)
     {
       for (unsigned int basis = 0; basis < dof_handler.n_dofs(); basis++)

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.