]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Avoid C-style casts in examples
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 12 Dec 2018 23:06:05 +0000 (00:06 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Wed, 12 Dec 2018 23:42:03 +0000 (00:42 +0100)
examples/step-42/step-42.cc
examples/step-60/step-60.cc

index 9f261181075f3ed69528f6cd3a614ec3794b3e4c..2006200602e52744ade671342ffb291186fc5f7f 100644 (file)
@@ -509,8 +509,8 @@ namespace Step42
     template <int dim>
     double BitmapFile<dim>::get_value(const double x, const double y) const
     {
-      const int ix = std::min(std::max((int)(x / hx), 0), nx - 2);
-      const int iy = std::min(std::max((int)(y / hy), 0), ny - 2);
+      const int ix = std::min(std::max(static_cast<int>(x / hx), 0), nx - 2);
+      const int iy = std::min(std::max(static_cast<int>(y / hy), 0), ny - 2);
 
       const double xi  = std::min(std::max((x - ix * hx) / hx, 1.), 0.);
       const double eta = std::min(std::max((y - iy * hy) / hy, 1.), 0.);
index ff958d9694dfc1e2442f3329f174b00718b58763..6e74b01e8d49fba1407cd35f0c3f2a285b152fd2 100644 (file)
@@ -927,12 +927,12 @@ namespace Step60
       TimerOutput::Scope timer_section(monitor, "Assemble system");
 
       // Embedding stiffness matrix $K$, and the right hand side $G$.
-      MatrixTools::create_laplace_matrix(*space_dh,
-                                         QGauss<spacedim>(2 * space_fe->degree +
-                                                          1),
-                                         stiffness_matrix,
-                                         (const Function<spacedim> *)nullptr,
-                                         constraints);
+      MatrixTools::create_laplace_matrix(
+        *space_dh,
+        QGauss<spacedim>(2 * space_fe->degree + 1),
+        stiffness_matrix,
+        static_cast<const Function<spacedim> *>(nullptr),
+        constraints);
 
       VectorTools::create_right_hand_side(*embedded_mapping,
                                           *embedded_dh,

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.