[cig-commits] commit 1955 by bangerth to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Mon Oct 14 21:07:06 PDT 2013


Revision 1955

Reindent. Use braces to clarify which if and else belongs to.

U   trunk/aspect/source/postprocess/visualization.cc


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=1955&peg=1955

Diff:
Modified: trunk/aspect/source/postprocess/visualization.cc
===================================================================
--- trunk/aspect/source/postprocess/visualization.cc	2013-10-14 16:39:36 UTC (rev 1954)
+++ trunk/aspect/source/postprocess/visualization.cc	2013-10-15 04:06:53 UTC (rev 1955)
@@ -451,9 +451,9 @@
         if (tmp_file_desc == -1)
           {
             std::cerr << "***** WARNING: could not create temporary file, will "
-                        "output directly to final location. This may negatively "
-                        "affect performance."
-                        " (On processor "
+                      "output directly to final location. This may negatively "
+                      "affect performance."
+                      " (On processor "
                       << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) << ".)"
                       << std::endl;
 
@@ -464,7 +464,7 @@
       // open the file. if we can't open it, abort if this is the "real"
       // file. re-try with the "real" file if we had tried to write to
       // a temporary file
-      re_try_with_non_tmp_file:
+    re_try_with_non_tmp_file:
       std::cout << "********************** Writing to " << tmp_filename << std::endl;
       std::ofstream out (tmp_filename.c_str());
       if (!out)
@@ -473,11 +473,11 @@
             AssertThrow (false, ExcMessage(std::string("Trying to write to file <") +
                                            *filename +
                                            " but the file can't be opened!"))
-          else
-            {
-              tmp_filename = *filename;
-              goto re_try_with_non_tmp_file;
-            }
+            else
+              {
+                tmp_filename = *filename;
+                goto re_try_with_non_tmp_file;
+              }
         }
 
       // now write and then move the tmp file to its final destination
@@ -490,29 +490,31 @@
 
           bool first_attempt = true;
 
-          re_try:
+        re_try:
           int error = system(command.c_str());
 
           // if the move failed, and this is the first time, sleep for a second in
           // hopes that it was just an NFS timeout, then try again. if it fails the
           // second time around, try writing to the final file directly.
           if (error != 0)
-            if (first_attempt == true)
-              {
-                first_attempt = false;
-                sleep (1);
-                goto re_try;
-              }
-            else
             {
-              std::cerr << "***** WARNING: could not move " << tmp_filename
-                        << " to " << *filename << ". Trying again to write directly to "
-                        << *filename
-                        << ". (On processor "
-                        << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) << ".)"
-                        << std::endl;
-              tmp_filename = *filename;
-              goto re_try_with_non_tmp_file;
+              if (first_attempt == true)
+                {
+                  first_attempt = false;
+                  sleep (1);
+                  goto re_try;
+                }
+              else
+                {
+                  std::cerr << "***** WARNING: could not move " << tmp_filename
+                            << " to " << *filename << ". Trying again to write directly to "
+                            << *filename
+                            << ". (On processor "
+                            << Utilities::MPI::this_mpi_process (MPI_COMM_WORLD) << ".)"
+                            << std::endl;
+                  tmp_filename = *filename;
+                  goto re_try_with_non_tmp_file;
+                }
             }
         }
 


More information about the CIG-COMMITS mailing list