Use unsigned when iterating through vector indices

A vector can of course never contain a negative number of elements, so
naturally size() returns size_t instead of a regular int. This costs us
a warning unless we also change the loop counter (since it is only used
to index that vector).
This commit is contained in:
Roland Kaufmann committed 2013-10-09 15:09:14 +02:00
1 parent fc8b727ee7
commit 13d145fc1d
1 file changed
+2 -1
+2 -1
View File
@@ -87,7 +87,8 @@ namespace Opm
if (iNext == sz) OPM_THROW(std::runtime_error,"Unable to complete undersaturated table.");
}
// Add undersaturated data to current record while maintaining compressibility and viscosibility
for (int j=1; j<undersat_oil_tables_[iNext][0].size(); ++j) {
typedef std::vector<std::vector<std::vector<double> > >::size_type sz_t;
for (sz_t j=1; j<undersat_oil_tables_[iNext][0].size(); ++j) {
double diffPressure = undersat_oil_tables_[iNext][0][j]-undersat_oil_tables_[iNext][0][j-1];
double pressure = undersat_oil_tables_[i][0].back()+diffPressure;
undersat_oil_tables_[i][0].push_back(pressure);