From 4a6e5028695a42309a59960fa42fa016d4f7a286 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Thu, 7 Nov 2013 11:54:23 +0100 Subject: [PATCH] Use integer for counter and cast to enumeration --- opm/core/io/eclipse/BlackoilEclipseOutputWriter.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/opm/core/io/eclipse/BlackoilEclipseOutputWriter.cpp b/opm/core/io/eclipse/BlackoilEclipseOutputWriter.cpp index 1b6e82e9..ab44c162 100644 --- a/opm/core/io/eclipse/BlackoilEclipseOutputWriter.cpp +++ b/opm/core/io/eclipse/BlackoilEclipseOutputWriter.cpp @@ -632,9 +632,11 @@ void BlackoilEclipseOutputWriter::writeInit(const SimulatorTimer &timer) { // mentioned in those keywords const int numWells = eclipseParser_.getWELSPECS().welspecs.size(); for (int whichWell = 0; whichWell != numWells; ++whichWell) { - for (BlackoilPhases::PhaseIndex phase = static_cast(0); - phase != BlackoilPhases::MaxNumPhases; - ++phase) { + for (int phaseCounter = 0; + phaseCounter != BlackoilPhases::MaxNumPhases; + ++phaseCounter) { + const BlackoilPhases::PhaseIndex phase = + static_cast (phaseCounter); for (int typeIndex = 0; typeIndex < sizeof (WELL_TYPES) / sizeof (WELL_TYPES[0]); ++typeIndex) {