]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a warning. 2009/head
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 22 Dec 2015 15:45:58 +0000 (09:45 -0600)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 22 Dec 2015 15:45:58 +0000 (09:45 -0600)
GeometryInfo<dim>::lines_per_face is zero in 1d and 2d, so the comparison
  e<GeometryInfo<dim>::lines_per_face
is always false (as expected and intended) but the compiler warns about
this. Work around this by using signed integers.

source/grid/grid_tools.cc

index a9481555f8cbd7edf0083cee9697b68f88c448e0..7ddcb3b8c861d8f86cf1afa1eb62c9914eeed1de 100644 (file)
@@ -3268,7 +3268,7 @@ next_cell:
            cell != tria.end(); ++cell)
         for (unsigned int f=0; f<GeometryInfo<dim>::faces_per_cell; ++f)
           if (cell->face(f)->at_boundary())
-            for (unsigned int e=0; e<GeometryInfo<dim>::lines_per_face; ++e)
+            for (signed int e=0; e<static_cast<signed int>(GeometryInfo<dim>::lines_per_face); ++e)
               cell->face(f)->line(e)->set_manifold_id
               (static_cast<types::manifold_id>(cell->face(f)->line(e)->boundary_id()));
 
@@ -3289,7 +3289,7 @@ next_cell:
               {
                 cell->face(f)->set_boundary_id(0);
                 if (dim >= 3)
-                  for (unsigned int e=0; e<GeometryInfo<dim>::lines_per_face; ++e)
+                  for (signed int e=0; e<static_cast<signed int>(GeometryInfo<dim>::lines_per_face); ++e)
                     cell->face(f)->line(e)->set_boundary_id(0);
               }
           }

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.