]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Restore stream flags after use. 4017/head
authorDavid Wells <wellsd2@rpi.edu>
Wed, 1 Mar 2017 17:55:48 +0000 (12:55 -0500)
committerDavid Wells <wellsd2@rpi.edu>
Wed, 1 Mar 2017 17:55:48 +0000 (12:55 -0500)
This was caught by Coverity.

source/base/table_handler.cc
source/lac/trilinos_epetra_vector.cc
source/lac/trilinos_vector_base.cc

index 4f1099b75dfdf0bc97e845c0aa7a32c07fae6a7e..2c7e18d4db0af34205efae2dea1a90b369360522 100644 (file)
@@ -16,6 +16,8 @@
 #include <deal.II/base/table_handler.h>
 #include <deal.II/base/table.h>
 
+#include <boost/io/ios_state.hpp>
+
 #include <sstream>
 #include <iostream>
 #include <iomanip>
@@ -322,6 +324,7 @@ void TableHandler::write_text(std::ostream &out,
                               const TextOutputFormat format) const
 {
   AssertThrow (out, ExcIO());
+  boost::io::ios_flags_saver restore_flags(out);
 
   // first pad the table from below if necessary
   if (auto_fill_mode == true)
index b42db82a2193a6bdb156df392fc070e4bbdfa2f7..a034f0d57943d7deb416a41e783ac87c101c5288 100644 (file)
@@ -20,6 +20,9 @@
 #ifdef DEAL_II_WITH_MPI
 
 #include <deal.II/base/index_set.h>
+
+#include <boost/io/ios_state.hpp>
+
 #include "Epetra_Import.h"
 #include "Epetra_Map.h"
 #include "Epetra_MpiComm.h"
@@ -482,6 +485,7 @@ namespace LinearAlgebra
                        const bool across) const
     {
       AssertThrow(out, ExcIO());
+      boost::io::ios_flags_saver restore_flags(out);
 
       // Get a representation of the vector and loop over all
       // the elements
index 5bfcf9b55a738e2af5269ec5b79236eb7adc1036..523081785c2c0b454f254b9ee7ca6a3b86df9626 100644 (file)
@@ -25,6 +25,8 @@
 DEAL_II_DISABLE_EXTRA_DIAGNOSTICS
 #  include <Epetra_Import.h>
 #  include <Epetra_Export.h>
+
+#  include <boost/io/ios_state.hpp>
 DEAL_II_ENABLE_EXTRA_DIAGNOSTICS
 
 
@@ -487,6 +489,7 @@ namespace TrilinosWrappers
                      const bool         across) const
   {
     AssertThrow (out, ExcIO());
+    boost::io::ios_flags_saver restore_flags(out);
 
     // get a representation of the
     // vector and loop over all

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.