]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Remove 'if (true)' statements. 1091/head
authorDavid Wells <drwells@vt.edu>
Tue, 7 Jul 2015 11:40:41 +0000 (07:40 -0400)
committerDavid Wells <drwells@vt.edu>
Tue, 7 Jul 2015 12:10:31 +0000 (08:10 -0400)
These are redundant and the related comment is no longer correct (there
are, as of the previous commit, no new variables declared in that
scope).

source/base/data_out_base.cc

index adc1b3b2f5083b05ef24f718cd2a94c4ce86410c..20586cf810c18ab8ebbab47d9fd1c62fb0a7938d 100644 (file)
@@ -2840,13 +2840,12 @@ namespace DataOutBase
     if (flags.write_neighbors)
       out << "component \"neighbors\" value \"neighbors\"" << '\n';
 
-    if (true)
-      {
-        out << "attribute \"created\" string \""
-            << Utilities::System::get_date()
-            << ' '
-            << Utilities::System::get_time() << '"' << '\n';
-      }
+    {
+      out << "attribute \"created\" string \""
+          << Utilities::System::get_date()
+          << ' '
+          << Utilities::System::get_time() << '"' << '\n';
+    }
 
     out << "end" << '\n';
     // Write all binary data now
@@ -2899,40 +2898,36 @@ namespace DataOutBase
     const unsigned int n_data_sets = data_names.size();
 
     // write preamble
-    if (true)
-      {
-        // block this to have local
-        // variables destroyed after
-        // use
-        out << "# This file was generated by the deal.II library." << '\n'
-            << "# Date =  " << Utilities::System::get_date() << '\n'
-            << "# Time =  " << Utilities::System::get_time() << '\n'
-            << "#" << '\n'
-            << "# For a description of the GNUPLOT format see the GNUPLOT manual."
-            << '\n'
-            << "#" << '\n'
-            << "# ";
+    {
+      out << "# This file was generated by the deal.II library." << '\n'
+          << "# Date =  " << Utilities::System::get_date() << '\n'
+          << "# Time =  " << Utilities::System::get_time() << '\n'
+          << "#" << '\n'
+          << "# For a description of the GNUPLOT format see the GNUPLOT manual."
+          << '\n'
+          << "#" << '\n'
+          << "# ";
 
-        switch (spacedim)
-          {
-          case 1:
-            out << "<x> ";
-            break;
-          case 2:
-            out << "<x> <y> ";
-            break;
-          case 3:
-            out << "<x> <y> <z> ";
-            break;
+      switch (spacedim)
+        {
+        case 1:
+          out << "<x> ";
+          break;
+        case 2:
+          out << "<x> <y> ";
+          break;
+        case 3:
+          out << "<x> <y> <z> ";
+          break;
 
-          default:
-            Assert (false, ExcNotImplemented());
-          }
+        default:
+          Assert (false, ExcNotImplemented());
+        }
 
-        for (unsigned int i=0; i<data_names.size(); ++i)
-          out << '<' << data_names[i] << "> ";
-        out << '\n';
-      }
+      for (unsigned int i=0; i<data_names.size(); ++i)
+        out << '<' << data_names[i] << "> ";
+      out << '\n';
+    }
 
 
     // loop over all patches
@@ -3129,50 +3124,47 @@ namespace DataOutBase
     (void)n_data_sets;
 
     // write preamble
-    if (true)
-      {
-        // block this to have local
-        // variables destroyed after use
-        out << "/* This file was generated by the deal.II library." << '\n'
-            << "   Date =  " << Utilities::System::get_date() << '\n'
-            << "   Time =  " << Utilities::System::get_time() << '\n'
-            << '\n'
-            << "   For a description of the POVRAY format see the POVRAY manual."
-            << '\n'
-            << "*/ " << '\n';
+    {
+      out << "/* This file was generated by the deal.II library." << '\n'
+          << "   Date =  " << Utilities::System::get_date() << '\n'
+          << "   Time =  " << Utilities::System::get_time() << '\n'
+          << '\n'
+          << "   For a description of the POVRAY format see the POVRAY manual."
+          << '\n'
+          << "*/ " << '\n';
 
-        // include files
-        out << "#include \"colors.inc\" " << '\n'
-            << "#include \"textures.inc\" " << '\n';
+      // include files
+      out << "#include \"colors.inc\" " << '\n'
+          << "#include \"textures.inc\" " << '\n';
 
 
-        // use external include file for textures,
-        // camera and light
-        if (flags.external_data)
-          out << "#include \"data.inc\" " << '\n';
-        else                          // all definitions in data file
-          {
-            // camera
-            out << '\n' << '\n'
-                << "camera {"            << '\n'
-                << "  location <1,4,-7>" << '\n'
-                << "  look_at <0,0,0>"   << '\n'
-                << "  angle 30"          << '\n'
-                << "}"                   << '\n';
-
-            // light
-            out << '\n'
-                << "light_source {"      << '\n'
-                << "  <1,4,-7>"      << '\n'
-                << "  color Grey"        << '\n'
-                << "}"                   << '\n';
-            out << '\n'
-                << "light_source {"      << '\n'
-                << "  <0,20,0>"      << '\n'
-                << "  color White"       << '\n'
-                << "}"                   << '\n';
-          }
-      }
+      // use external include file for textures,
+      // camera and light
+      if (flags.external_data)
+        out << "#include \"data.inc\" " << '\n';
+      else                          // all definitions in data file
+        {
+          // camera
+          out << '\n' << '\n'
+              << "camera {"            << '\n'
+              << "  location <1,4,-7>" << '\n'
+              << "  look_at <0,0,0>"   << '\n'
+              << "  angle 30"          << '\n'
+              << "}"                   << '\n';
+
+          // light
+          out << '\n'
+              << "light_source {"      << '\n'
+              << "  <1,4,-7>"      << '\n'
+              << "  color Grey"        << '\n'
+              << "}"                   << '\n';
+          out << '\n'
+              << "light_source {"      << '\n'
+              << "  <0,20,0>"      << '\n'
+              << "  color White"       << '\n'
+              << "}"                   << '\n';
+        }
+    }
 
     // max. and min. heigth of solution
     Assert(patches.size()>0, ExcInternalError());
@@ -3719,53 +3711,49 @@ namespace DataOutBase
 
 
     // now write preamble
-    if (true)
-      {
-        // block this to have local
-        // variables destroyed after
-        // use
-        out << "%!PS-Adobe-2.0 EPSF-1.2" << '\n'
-            << "%%Title: deal.II Output" << '\n'
-            << "%%Creator: the deal.II library" << '\n'
-            << "%%Creation Date: "
-            << Utilities::System::get_date()
-            << " - "
-            << Utilities::System::get_time() << '\n'
-            << "%%BoundingBox: "
-            // lower left corner
-            << "0 0 "
-            // upper right corner
-            << static_cast<unsigned int>( (x_max-x_min) * scale + 0.5)
-            << ' '
-            << static_cast<unsigned int>( (y_max-y_min) * scale + 0.5)
-            << '\n';
+    {
+      out << "%!PS-Adobe-2.0 EPSF-1.2" << '\n'
+          << "%%Title: deal.II Output" << '\n'
+          << "%%Creator: the deal.II library" << '\n'
+          << "%%Creation Date: "
+          << Utilities::System::get_date()
+          << " - "
+          << Utilities::System::get_time() << '\n'
+          << "%%BoundingBox: "
+          // lower left corner
+          << "0 0 "
+          // upper right corner
+          << static_cast<unsigned int>( (x_max-x_min) * scale + 0.5)
+          << ' '
+          << static_cast<unsigned int>( (y_max-y_min) * scale + 0.5)
+          << '\n';
 
-        // define some abbreviations to keep
-        // the output small:
-        // m=move turtle to
-        // l=define a line
-        // s=set rgb color
-        // sg=set gray value
-        // lx=close the line and plot the line
-        // lf=close the line and fill the interior
-        out << "/m {moveto} bind def"      << '\n'
-            << "/l {lineto} bind def"      << '\n'
-            << "/s {setrgbcolor} bind def" << '\n'
-            << "/sg {setgray} bind def"    << '\n'
-            << "/lx {lineto closepath stroke} bind def" << '\n'
-            << "/lf {lineto closepath fill} bind def"   << '\n';
-
-        out << "%%EndProlog" << '\n'
-            << '\n';
-        // set fine lines
-        out << flags.line_width << " setlinewidth" << '\n';
-        // allow only five digits
-        // for output (instead of the
-        // default six); this should suffice
-        // even for fine grids, but reduces
-        // the file size significantly
-        out << std::setprecision (5);
-      }
+      // define some abbreviations to keep
+      // the output small:
+      // m=move turtle to
+      // l=define a line
+      // s=set rgb color
+      // sg=set gray value
+      // lx=close the line and plot the line
+      // lf=close the line and fill the interior
+      out << "/m {moveto} bind def"      << '\n'
+          << "/l {lineto} bind def"      << '\n'
+          << "/s {setrgbcolor} bind def" << '\n'
+          << "/sg {setgray} bind def"    << '\n'
+          << "/lx {lineto closepath stroke} bind def" << '\n'
+          << "/lf {lineto closepath fill} bind def"   << '\n';
+
+      out << "%%EndProlog" << '\n'
+          << '\n';
+      // set fine lines
+      out << flags.line_width << " setlinewidth" << '\n';
+      // allow only five digits
+      // for output (instead of the
+      // default six); this should suffice
+      // even for fine grids, but reduces
+      // the file size significantly
+      out << std::setprecision (5);
+    }
 
     // check if min and max
     // values for the color are

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.