aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-03-26 13:17:27 +0100
committerEven Rouault <even.rouault@spatialys.com>2019-03-26 13:17:27 +0100
commit3fe2e50dc8af9e4557f0303786282f1ba68ceff6 (patch)
treebcfb0882af29c302b84efeb2b6af1b60e3121bde /src
parenta199edb807eea4439b98865d5cd33fa7e3fd0706 (diff)
downloadPROJ-3fe2e50dc8af9e4557f0303786282f1ba68ceff6.tar.gz
PROJ-3fe2e50dc8af9e4557f0303786282f1ba68ceff6.zip
factory.cpp: avoid warning about int truncation. Coverity CID 193544
Diffstat (limited to 'src')
-rw-r--r--src/iso19111/factory.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/iso19111/factory.cpp b/src/iso19111/factory.cpp
index 14421022..d6517748 100644
--- a/src/iso19111/factory.cpp
+++ b/src/iso19111/factory.cpp
@@ -1615,7 +1615,8 @@ static double normalizeMeasure(const std::string &uom_code,
assert(seconds.size() == precision - 2);
normalized_value =
(normalized_value < 0 ? -1.0 : 1.0) *
- (int(std::fabs(normalized_value)) + c_locale_stod(minutes) / 60. +
+ (std::floor(std::fabs(normalized_value)) +
+ c_locale_stod(minutes) / 60. +
(c_locale_stod(seconds) / std::pow(10, seconds.size() - 2)) /
3600.);
normalized_uom_code = common::UnitOfMeasure::DEGREE.code();