From 82e8d1a56b65e6b18f0721c1e45507219444f87f Mon Sep 17 00:00:00 2001 From: Joakim Hove Date: Fri, 10 Oct 2014 15:24:26 +0200 Subject: [PATCH] Added static_cast before calling std::to_string() --- opm/parser/eclipse/EclipseState/EclipseState.cpp | 3 +-- opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/opm/parser/eclipse/EclipseState/EclipseState.cpp b/opm/parser/eclipse/EclipseState/EclipseState.cpp index 805aeda05..230de794e 100644 --- a/opm/parser/eclipse/EclipseState/EclipseState.cpp +++ b/opm/parser/eclipse/EclipseState/EclipseState.cpp @@ -300,8 +300,7 @@ namespace Opm { phases.insert(Phase::PhaseEnum::WATER); if (phases.size() < 3) - parserLog->addNote("", -1, - "Only " + std::to_string(phases.size()) + " fluid phases are enabled"); + parserLog->addNote("", -1, "Only " + std::to_string(static_cast(phases.size())) + " fluid phases are enabled"); } diff --git a/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp b/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp index 9cad3ac83..b88dc4d40 100644 --- a/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp +++ b/opm/parser/eclipse/EclipseState/Grid/EclipseGrid.cpp @@ -240,8 +240,8 @@ namespace Opm { if (ZCORNKeyWord->getDataSize() != static_cast(8*nx*ny*nz)) { const std::string msg = "Wrong size of the ZCORN keyword: Expected 8*x*ny*nz = " - + std::to_string(8*nx*ny*nz) + " is " - + std::to_string(ZCORNKeyWord->getDataSize()); + + std::to_string(static_cast(8*nx*ny*nz)) + " is " + + std::to_string(static_cast(ZCORNKeyWord->getDataSize())); parserLog->addError("", -1, msg); throw std::invalid_argument(msg); } @@ -252,8 +252,8 @@ namespace Opm { if (COORDKeyWord->getDataSize() != static_cast(6*(nx + 1)*(ny + 1))) { const std::string msg = "Wrong size of the COORD keyword: Expected 8*(nx + 1)*(ny + 1) = " - + std::to_string(8*(nx + 1)*(ny + 1)) + " is " - + std::to_string(COORDKeyWord->getDataSize()); + + std::to_string(static_cast(8*(nx + 1)*(ny + 1))) + " is " + + std::to_string(static_cast(COORDKeyWord->getDataSize())); parserLog->addError("", -1, msg); throw std::invalid_argument(msg); } @@ -264,8 +264,8 @@ namespace Opm { if (ACTNUMKeyWord->getDataSize() != static_cast(nx*ny*nz)) { const std::string msg = "Wrong size of the ACTNUM keyword: Expected nx*ny*nz = " - + std::to_string(nx*ny*nz) + " is " - + std::to_string(ACTNUMKeyWord->getDataSize()); + + std::to_string(static_cast(nx*ny*nz)) + " is " + + std::to_string(static_cast(ACTNUMKeyWord->getDataSize())); parserLog->addError("", -1, msg); throw std::invalid_argument(msg); }