From 52756eabda6c8ba2ad0ab85e951e00782915395b Mon Sep 17 00:00:00 2001 From: Erik Schnetter Date: Mon, 25 Sep 2006 22:01:00 +0000 Subject: CarpetIOBasic: Save and restore stream state of cout darcs-hash:20060925220104-dae7b-81166be5c72a691ccf5efb7b79d3e01f19bc1184.gz --- Carpet/CarpetIOBasic/src/iobasic.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Carpet/CarpetIOBasic') diff --git a/Carpet/CarpetIOBasic/src/iobasic.cc b/Carpet/CarpetIOBasic/src/iobasic.cc index 161671391..c6179a938 100644 --- a/Carpet/CarpetIOBasic/src/iobasic.cc +++ b/Carpet/CarpetIOBasic/src/iobasic.cc @@ -434,6 +434,14 @@ namespace CarpetIOBasic { // Output in global mode BEGIN_GLOBAL_MODE(cctkGH) { + // Remember cout state + int oldprec; + ios_base::fmtflags oldflags; + if (CCTK_MyProc(cctkGH) == 0) { + oldprec = cout.precision(); + oldflags = cout.flags(); + } + // Print vertical separator if (CCTK_MyProc(cctkGH) == 0) { cout << " |"; @@ -524,6 +532,12 @@ namespace CarpetIOBasic { } // not isscalar + // Restore cout state + if (CCTK_MyProc(cctkGH) == 0) { + cout.precision (oldprec); + cout.setf (oldflags); + } + } END_GLOBAL_MODE; } -- cgit v1.2.3