From 30cec3e2805d2d7688d49f0f8b64e514fa124820 Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Mon, 18 May 2020 17:57:56 +0200 Subject: [PATCH] Fix comparison between signed and unsigned integer expressions. --- .../ProjectDataModel/RimEclipseResultDefinition.cpp | 3 ++- .../RigGeoMechWellLogExtractor.cpp | 12 ++++++------ Fwk/VizFwk/LibGeometry/cvfBoundingBoxTree.cpp | 2 +- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp index ae07f5f647..df28c79e7a 100644 --- a/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp +++ b/ApplicationCode/ProjectDataModel/RimEclipseResultDefinition.cpp @@ -1946,7 +1946,8 @@ void RimEclipseResultDefinition::updateRangesForExplicitLegends( RimRegularLegen int frmIdx2 = it->first.second; int combIndex = it->second; - if ( frmIdx1 >= fnVector.size() || frmIdx2 >= fnVector.size() ) continue; + int fnVectorSize = fnVector.size(); + if ( frmIdx1 >= fnVectorSize || frmIdx2 >= fnVectorSize ) continue; QString frmName1 = fnVector[frmIdx1]; QString frmName2 = fnVector[frmIdx2]; diff --git a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp index c2da7f247a..6a1b015427 100644 --- a/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp +++ b/ApplicationCode/ReservoirDataModel/RigGeoMechWellLogExtractor.cpp @@ -316,16 +316,16 @@ std::vector { if ( !lasFileValues.empty() ) { - double lasValue = getWellLogIntersectionValue( intersectionIdx, lasFileValues ); - // Only accept las-values for PP_reservoir if the grid result is valid - bool validLasRegion = true; - if (isPPResResult) + double lasValue = getWellLogIntersectionValue( intersectionIdx, lasFileValues ); + // Only accept las-values for PP_reservoir if the grid result is valid + bool validLasRegion = true; + if ( isPPResResult ) { - validLasRegion = intersectionIdx < gridValues.size() && + validLasRegion = intersectionIdx < static_cast( gridValues.size() ) && gridValues[intersectionIdx] != std::numeric_limits::infinity(); } - if ( validLasRegion && lasValue != std::numeric_limits::infinity()) + if ( validLasRegion && lasValue != std::numeric_limits::infinity() ) { unscaledValues[intersectionIdx] = lasValue; finalSourcesPerSegment[intersectionIdx] = RigWbsParameter::LAS_FILE; diff --git a/Fwk/VizFwk/LibGeometry/cvfBoundingBoxTree.cpp b/Fwk/VizFwk/LibGeometry/cvfBoundingBoxTree.cpp index 298bc28786..b58cc32de7 100644 --- a/Fwk/VizFwk/LibGeometry/cvfBoundingBoxTree.cpp +++ b/Fwk/VizFwk/LibGeometry/cvfBoundingBoxTree.cpp @@ -488,7 +488,7 @@ bool AABBTree::buildTree() { bool bThreadRes = bRes; #pragma omp for - for (int i = 0; i < m_previousLevelNodes.size(); ++i) + for (int i = 0; i < static_cast(m_previousLevelNodes.size()); ++i) { bThreadRes = bThreadRes && buildTree(m_previousLevelNodes[i].node, m_previousLevelNodes[i].fromIdx, m_previousLevelNodes[i].toIdx, 4); }