aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetIOBasic
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@gmail.com>2013-01-19 20:43:57 -0500
committerErik Schnetter <schnetter@gmail.com>2013-01-19 20:43:57 -0500
commit63308ace65a81b3501019a5d67ef7414485f5af2 (patch)
treeecf68622bf71e3ba9eb249a478127a8f8306b695 /Carpet/CarpetIOBasic
parent871a76ffd865ede1d7e21d5a9d3ba9abac1b2aa5 (diff)
CarpetIOBasic: Simplify code and avoid compiler warnings (again)
Diffstat (limited to 'Carpet/CarpetIOBasic')
-rw-r--r--Carpet/CarpetIOBasic/src/iobasic.cc16
1 files changed, 5 insertions, 11 deletions
diff --git a/Carpet/CarpetIOBasic/src/iobasic.cc b/Carpet/CarpetIOBasic/src/iobasic.cc
index acc850c4e..28abd6454 100644
--- a/Carpet/CarpetIOBasic/src/iobasic.cc
+++ b/Carpet/CarpetIOBasic/src/iobasic.cc
@@ -430,13 +430,9 @@ namespace CarpetIOBasic {
BEGIN_GLOBAL_MODE(cctkGH) {
// Remember cout state
- int oldprec;
- ios_base::fmtflags oldflags;
- if (CCTK_MyProc(cctkGH) == 0) {
- oldprec = cout.precision();
- oldflags = cout.flags();
- }
-
+ int const oldprec = cout.precision();
+ ios_base::fmtflags const oldflags = cout.flags();
+
// Print vertical separator
if (CCTK_MyProc(cctkGH) == 0) {
cout << " |";
@@ -528,10 +524,8 @@ namespace CarpetIOBasic {
} // not isscalar
// Restore cout state
- if (CCTK_MyProc(cctkGH) == 0) {
- cout.precision (oldprec);
- cout.setf (oldflags);
- }
+ cout.precision (oldprec);
+ cout.setf (oldflags);
} END_GLOBAL_MODE;
}