Fix compiler warnings related to converting time_t to double

This commit is contained in:
Magne Sjaastad 2018-01-19 16:55:16 +01:00
parent 5c1f5326a0
commit 245d10c5c1

View File

@ -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);