diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/init.cpp | 22 | ||||
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 2 | ||||
| -rw-r--r-- | src/iso19111/io.cpp | 4 |
3 files changed, 13 insertions, 15 deletions
diff --git a/src/init.cpp b/src/init.cpp index 19fcf47b..c1683285 100644 --- a/src/init.cpp +++ b/src/init.cpp @@ -48,25 +48,23 @@ static paralist *string_to_paralist (PJ_CONTEXT *ctx, char *definition) { Convert a string (presumably originating from get_init_string) to a paralist. ***************************************************************************************/ const char *c = definition; - paralist *first = nullptr, *next = nullptr; + paralist *first = nullptr, *last = nullptr; while (*c) { /* Keep a handle to the start of the list, so we have something to return */ - if (nullptr==first) - first = next = pj_mkparam_ws (c, &c); - else - next = next->next = pj_mkparam_ws (c, &c); - if (nullptr==next) { + auto param = pj_mkparam_ws (c, &c); + if (nullptr==param) { pj_dealloc_params (ctx, first, ENOMEM); return nullptr; } + if (nullptr==last) { + first = param; + } + else { + last->next = param; + } + last = param; } - - if( next == nullptr ) - return nullptr; - - /* Terminate list and return */ - next->next = nullptr; return first; } diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index a8c7c902..6eef6de8 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -6238,7 +6238,7 @@ void Conversion::_exportToPROJString( if (!param->proj_name) { continue; } - const auto value = + const auto &value = parameterValueMeasure(param->wkt2_name, param->epsg_code); double valueConverted = 0; if (value == nullMeasure) { diff --git a/src/iso19111/io.cpp b/src/iso19111/io.cpp index 0fc11f6f..e4b159bd 100644 --- a/src/iso19111/io.cpp +++ b/src/iso19111/io.cpp @@ -3526,7 +3526,7 @@ ConversionNNPtr WKTParser::Private::buildProjectionStandard( EPSG_CODE_PARAMETER_LATITUDE_OF_NATURAL_ORIGIN); propertiesParameter.set(Identifier::CODESPACE_KEY, Identifier::EPSG); - } else if (paramMapping) { + } else if (mapping && paramMapping) { for (size_t idx = 0; mapping->params[idx] != nullptr; ++idx) { if (mapping->params[idx] == paramMapping) { foundParameters[idx] = true; @@ -4542,7 +4542,7 @@ class JSONParser { static Measure getMeasure(const json &j); IdentifierNNPtr buildId(const json &j, bool removeInverseOf); - ObjectDomainPtr buildObjectDomain(const json &j); + static ObjectDomainPtr buildObjectDomain(const json &j); PropertyMap buildProperties(const json &j, bool removeInverseOf = false); GeographicCRSNNPtr buildGeographicCRS(const json &j); |
