]> https://gitweb.dealii.org/ - dealii.git/commitdiff
suppress some warnings by explicit casting 2380/head
authorKarl Ljungkvist <k.ljungkvist@gmail.com>
Sat, 19 Mar 2016 03:29:30 +0000 (22:29 -0500)
committerKarl Ljungkvist <k.ljungkvist@gmail.com>
Sat, 19 Mar 2016 17:21:39 +0000 (12:21 -0500)
include/deal.II/base/graph_coloring.h
include/deal.II/grid/cell_id.h
include/deal.II/grid/tria_accessor.h

index 1f341a28f5288fb0670436d20de5b81512de0913..e97051ebd1c9e4c1adb42736dcc302aca4008b00 100644 (file)
@@ -351,7 +351,7 @@ namespace GraphColoring
                   // iterators.
                   std::vector<unsigned int>::iterator it;
                   it = std::max_element(colors_counter[i].begin(),colors_counter[i].end());
-                  unsigned int min_iterators(-1);
+                  unsigned int min_iterators (static_cast<unsigned int>(-1));
                   unsigned int pos(0);
                   // Find the color of coloring with the least number of colors among
                   // the colors that have not been used yet.
@@ -402,7 +402,7 @@ namespace GraphColoring
                       // iterators.
                       std::vector<unsigned int>::iterator it;
                       it = std::max_element(colors_counter[i].begin(),colors_counter[i].end());
-                      unsigned int min_iterators(-1);
+                      unsigned int min_iterators(static_cast<unsigned int>(-1));
                       unsigned int pos(0);
                       // Find the color of coloring with the least number of colors among
                       // the colors that have not been used yet.
index 2e1e3b1e00df8b0c01427121c4f2f41f579e2725..a40b0923a2390a496a67f8a6fef9680f20d6f06c 100644 (file)
@@ -66,7 +66,7 @@ public:
    * construct an empty CellId.
    */
   CellId()
-    : coarse_cell_id(-1)
+    : coarse_cell_id(static_cast<unsigned int>(-1))
   {}
 
   /**
index c9b435483388f9c26d78bf573eea71e8d18b8b0b..da465338c75c9f04675ff48e41b6d29316187188 100644 (file)
@@ -3098,7 +3098,7 @@ CellAccessor<dim,spacedim>::id() const
   while (ptr.level()>0)
     {
       // determine which child we are
-      unsigned char v=-1;
+      unsigned char v = static_cast<unsigned char>(-1);
       for (unsigned int c=0; c<ptr.parent()->n_children(); ++c)
         {
           if (ptr.parent()->child_index(c)==ptr.index())

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.