diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-01-19 20:43:57 -0500 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-01-19 20:43:57 -0500 |
commit | 63308ace65a81b3501019a5d67ef7414485f5af2 (patch) | |
tree | ecf68622bf71e3ba9eb249a478127a8f8306b695 /Carpet | |
parent | 871a76ffd865ede1d7e21d5a9d3ba9abac1b2aa5 (diff) |
CarpetIOBasic: Simplify code and avoid compiler warnings (again)
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/CarpetIOBasic/src/iobasic.cc | 16 |
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; } |