aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2019-04-28 13:00:18 +0200
committerEven Rouault <even.rouault@spatialys.com>2019-04-28 13:00:18 +0200
commitc3c1efedbeae11a09947f2873fe97e50afa87b29 (patch)
tree74ecef1c5da10f3baca49b572771ffcd4598b63a
parent210df01d861f4d75b3e4c698b9394d6d48989169 (diff)
downloadPROJ-c3c1efedbeae11a09947f2873fe97e50afa87b29.tar.gz
PROJ-c3c1efedbeae11a09947f2873fe97e50afa87b29.zip
Fix false-positive -Wnull-dereference GCC 8 warning
-rw-r--r--src/iso19111/coordinateoperation.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp
index 7eab849c..6a05c285 100644
--- a/src/iso19111/coordinateoperation.cpp
+++ b/src/iso19111/coordinateoperation.cpp
@@ -12584,11 +12584,11 @@ getResolvedCRS(const crs::CRSNNPtr &crs,
const auto tmpAuthFactory = io::AuthorityFactory::create(
authFactory->databaseContext(), *ids.front()->codeSpace());
try {
- crs::CRSNNPtr resolvedCrs(
+ auto resolvedCrs(
tmpAuthFactory->createProjectedCRS(ids.front()->code()));
- if (resolvedCrs->_isEquivalentTo(
+ if (resolvedCrs->isEquivalentTo(
crs.get(), util::IComparable::Criterion::EQUIVALENT)) {
- return resolvedCrs;
+ return util::nn_static_pointer_cast<crs::CRS>(resolvedCrs);
}
} catch (const std::exception &) {
}
@@ -12616,12 +12616,13 @@ getResolvedCRS(const crs::CRSNNPtr &crs,
const auto tmpAuthFactory = io::AuthorityFactory::create(
authFactory->databaseContext(), *ids.front()->codeSpace());
try {
- crs::CRSNNPtr resolvedCrs(
+ auto resolvedCrs(
tmpAuthFactory->createCompoundCRS(ids.front()->code()));
- if (resolvedCrs->_isEquivalentTo(
+ if (resolvedCrs->isEquivalentTo(
crs.get(),
util::IComparable::Criterion::EQUIVALENT)) {
- return resolvedCrs;
+ return util::nn_static_pointer_cast<crs::CRS>(
+ resolvedCrs);
}
} catch (const std::exception &) {
}