From 01df4311987f44b4b711f0e42c219bff52e96af0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 29 Feb 2016 10:58:43 +0100 Subject: [PATCH] Silence sign comparison warning. --- opm/core/simulator/SimulatorState.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/core/simulator/SimulatorState.cpp b/opm/core/simulator/SimulatorState.cpp index c1763b9d..180dc141 100644 --- a/opm/core/simulator/SimulatorState.cpp +++ b/opm/core/simulator/SimulatorState.cpp @@ -85,7 +85,7 @@ void SimulatorState::setCellDataComponent( const std::string& name , size_t comp const auto iter = std::find( cellDataNames_.begin() , cellDataNames_.end() , name); int id = iter - cellDataNames_.begin(); auto& data = cellData_[id]; - if (component >= num_phases_) + if (component >= size_t(num_phases_)) throw std::invalid_argument("Invalid component"); if (cells.size() != values.size()) @@ -97,7 +97,7 @@ void SimulatorState::setCellDataComponent( const std::string& name , size_t comp total. This restriction should be lifted by allowing a per field number of components. */ - if (data.size() != num_phases_ * num_cells_) + if (data.size() != size_t(num_phases_ * num_cells_)) throw std::invalid_argument("Can currently only be used on fields with num_components == num_phases (i.e. saturation...) "); for (size_t i = 0; i < cells.size(); i++) {