From 245d10c5c1049db8038a756b4e7812fdcdcee0fc Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Fri, 19 Jan 2018 16:55:16 +0100 Subject: [PATCH] Fix compiler warnings related to converting time_t to double --- .../ReservoirDataModel/RigTimeHistoryCurveMerger.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ApplicationCode/ReservoirDataModel/RigTimeHistoryCurveMerger.cpp b/ApplicationCode/ReservoirDataModel/RigTimeHistoryCurveMerger.cpp index 37e88709d4..19d7b4634d 100644 --- a/ApplicationCode/ReservoirDataModel/RigTimeHistoryCurveMerger.cpp +++ b/ApplicationCode/ReservoirDataModel/RigTimeHistoryCurveMerger.cpp @@ -196,8 +196,8 @@ double RigTimeHistoryCurveMerger::interpolationValue(const time_t& interpolation bool isSecondValid = RigCurveDataTools::isValidValue(secondValue, removeInterpolatedValues); if (!isSecondValid) return HUGE_VAL; - double firstDiff = interpolationTimeStep - curveTimeSteps.at(firstI); - double secondDiff = curveTimeSteps.at(secondI) - interpolationTimeStep; + double firstDiff = fabs(difftime(interpolationTimeStep, curveTimeSteps.at(firstI))); + double secondDiff = fabs(difftime(curveTimeSteps.at(secondI), interpolationTimeStep)); double firstWeight = secondDiff / (firstDiff + secondDiff); double secondWeight = firstDiff / (firstDiff + secondDiff);