diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2020-05-17 23:26:24 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2020-05-17 23:26:24 +0200 |
| commit | 9c501221de38e0e4462e9852df8f5a621688de68 (patch) | |
| tree | c52d2291a3a6f29a90057b2fcd49e96ac8054767 /src | |
| parent | 0403980832dbaadad73e51da76ac0e71d37eec85 (diff) | |
| download | PROJ-9c501221de38e0e4462e9852df8f5a621688de68.tar.gz PROJ-9c501221de38e0e4462e9852df8f5a621688de68.zip | |
Address warnings raised by recent cppcheck
Diffstat (limited to 'src')
| -rw-r--r-- | src/iso19111/coordinateoperation.cpp | 24 | ||||
| -rw-r--r-- | src/transformations/defmodel.hpp | 9 | ||||
| -rw-r--r-- | src/transformations/defmodel_exceptions.hpp | 6 |
3 files changed, 24 insertions, 15 deletions
diff --git a/src/iso19111/coordinateoperation.cpp b/src/iso19111/coordinateoperation.cpp index 35be415f..9815a22a 100644 --- a/src/iso19111/coordinateoperation.cpp +++ b/src/iso19111/coordinateoperation.cpp @@ -6530,8 +6530,8 @@ struct Transformation::Private { TransformationPtr forwardOperation_{}; - TransformationNNPtr registerInv(const Transformation *thisIn, - TransformationNNPtr invTransform); + static TransformationNNPtr registerInv(const Transformation *thisIn, + TransformationNNPtr invTransform); }; //! @endcond @@ -8068,7 +8068,7 @@ TransformationNNPtr Transformation::inverseAsTransformation() const { double z = parameterValueNumericAsSI(EPSG_CODE_PARAMETER_Z_AXIS_TRANSLATION); auto properties = createPropertiesForInverse(this, false, false); - return d->registerInv( + return Private::registerInv( this, create(properties, l_targetCRS, l_sourceCRS, nullptr, createMethodMapNameEPSGCode( useOperationMethodEPSGCodeIfPresent( @@ -8101,14 +8101,14 @@ TransformationNNPtr Transformation::inverseAsTransformation() const { EPSG_CODE_PARAMETER_FLATTENING_DIFFERENCE); if (methodEPSGCode == EPSG_CODE_METHOD_ABRIDGED_MOLODENSKY) { - return d->registerInv( + return Private::registerInv( this, createAbridgedMolodensky( createPropertiesForInverse(this, false, false), l_targetCRS, l_sourceCRS, negate(x), negate(y), negate(z), negate(da), negate(df), coordinateOperationAccuracies())); } else { - return d->registerInv( + return Private::registerInv( this, createMolodensky(createPropertiesForInverse(this, false, false), l_targetCRS, l_sourceCRS, negate(x), negate(y), @@ -8121,7 +8121,7 @@ TransformationNNPtr Transformation::inverseAsTransformation() const { auto offset = parameterValueMeasure(EPSG_CODE_PARAMETER_LONGITUDE_OFFSET); const common::Angle newOffset(negate(offset.value()), offset.unit()); - return d->registerInv( + return Private::registerInv( this, createLongitudeRotation( createPropertiesForInverse(this, false, false), l_targetCRS, l_sourceCRS, newOffset)); @@ -8138,7 +8138,7 @@ TransformationNNPtr Transformation::inverseAsTransformation() const { const common::Angle newOffsetLong(negate(offsetLong.value()), offsetLong.unit()); - return d->registerInv( + return Private::registerInv( this, createGeographic2DOffsets( createPropertiesForInverse(this, false, false), l_targetCRS, l_sourceCRS, newOffsetLat, newOffsetLong, @@ -8161,7 +8161,7 @@ TransformationNNPtr Transformation::inverseAsTransformation() const { const common::Length newOffsetHeight(negate(offsetHeight.value()), offsetHeight.unit()); - return d->registerInv( + return Private::registerInv( this, createGeographic3DOffsets( createPropertiesForInverse(this, false, false), l_targetCRS, l_sourceCRS, newOffsetLat, newOffsetLong, @@ -8184,7 +8184,7 @@ TransformationNNPtr Transformation::inverseAsTransformation() const { const common::Length newOffsetHeight(negate(offsetHeight.value()), offsetHeight.unit()); - return d->registerInv( + return Private::registerInv( this, createGeographic2DWithHeightOffsets( createPropertiesForInverse(this, false, false), l_targetCRS, l_sourceCRS, newOffsetLat, newOffsetLong, @@ -8198,7 +8198,7 @@ TransformationNNPtr Transformation::inverseAsTransformation() const { const common::Length newOffsetHeight(negate(offsetHeight.value()), offsetHeight.unit()); - return d->registerInv( + return Private::registerInv( this, createVerticalOffset(createPropertiesForInverse(this, false, false), l_targetCRS, l_sourceCRS, newOffsetHeight, @@ -8208,7 +8208,7 @@ TransformationNNPtr Transformation::inverseAsTransformation() const { if (methodEPSGCode == EPSG_CODE_METHOD_CHANGE_VERTICAL_UNIT) { const double convFactor = parameterValueNumericAsSI( EPSG_CODE_PARAMETER_UNIT_CONVERSION_SCALAR); - return d->registerInv( + return Private::registerInv( this, createChangeVerticalUnit( createPropertiesForInverse(this, false, false), l_targetCRS, l_sourceCRS, common::Scale(1.0 / convFactor), @@ -8218,7 +8218,7 @@ TransformationNNPtr Transformation::inverseAsTransformation() const { #ifdef notdef // We don't need that currently, but we might... if (methodEPSGCode == EPSG_CODE_METHOD_HEIGHT_DEPTH_REVERSAL) { - return d->registerInv( + return Private::registerInv( this, createHeightDepthReversal( createPropertiesForInverse(this, false, false), l_targetCRS, diff --git a/src/transformations/defmodel.hpp b/src/transformations/defmodel.hpp index 9b28a7d8..642213b7 100644 --- a/src/transformations/defmodel.hpp +++ b/src/transformations/defmodel.hpp @@ -475,21 +475,25 @@ struct GridPrototype { int width = 0; int height = 0; + // cppcheck-suppress functionStatic bool getLonLatOffset(int /*ix*/, int /*iy*/, double & /*lonOffsetRadian*/, double & /*latOffsetRadian*/) const { throw UnimplementedException("getLonLatOffset unimplemented"); } + // cppcheck-suppress functionStatic bool getZOffset(int /*ix*/, int /*iy*/, double & /*zOffset*/) const { throw UnimplementedException("getZOffset unimplemented"); } + // cppcheck-suppress functionStatic bool getEastingNorthingOffset(int /*ix*/, int /*iy*/, double & /*eastingOffset*/, double & /*northingOffset*/) const { throw UnimplementedException("getEastingNorthingOffset unimplemented"); } + // cppcheck-suppress functionStatic bool getLonLatZOffset(int /*ix*/, int /*iy*/, double & /*lonOffsetRadian*/, double & /*latOffsetRadian*/, double & /*zOffset*/) const { @@ -500,6 +504,7 @@ struct GridPrototype { #endif } + // cppcheck-suppress functionStatic bool getEastingNorthingZOffset(int /*ix*/, int /*iy*/, double & /*eastingOffset*/, double & /*northingOffset*/, @@ -526,6 +531,7 @@ struct GridPrototype { template <class Grid = GridPrototype> struct GridSetPrototype { // The return pointer should remain "stable" over time for a given grid // of a GridSet. + // cppcheck-suppress functionStatic const Grid *gridAt(double /*x */, double /* y */) { throw UnimplementedException("gridAt unimplemented"); } @@ -542,6 +548,7 @@ struct EvaluatorIfacePrototype { throw UnimplementedException("open unimplemented"); } + // cppcheck-suppress functionStatic void geographicToGeocentric(double /* lam */, double /* phi */, double /* height*/, double /* a */, double /* b */, double /*es*/, double & /* X */, @@ -549,6 +556,7 @@ struct EvaluatorIfacePrototype { throw UnimplementedException("geographicToGeocentric unimplemented"); } + // cppcheck-suppress functionStatic void geocentricToGeographic(double /* X */, double /* Y */, double /* Z */, double /* a */, double /* b */, double /*es*/, double & /* lam */, double & /* phi */, @@ -556,6 +564,7 @@ struct EvaluatorIfacePrototype { throw UnimplementedException("geocentricToGeographic unimplemented"); } + // cppcheck-suppress functionStatic bool isGeographicCRS(const std::string & /* crsDef */) { throw UnimplementedException("isGeographicCRS unimplemented"); } diff --git a/src/transformations/defmodel_exceptions.hpp b/src/transformations/defmodel_exceptions.hpp index 8addf60f..4fc40f6f 100644 --- a/src/transformations/defmodel_exceptions.hpp +++ b/src/transformations/defmodel_exceptions.hpp @@ -38,7 +38,7 @@ namespace DEFORMATON_MODEL_NAMESPACE { /** Parsing exception. */ class ParsingException : public std::exception { public: - ParsingException(const std::string &msg) : msg_(msg) {} + explicit ParsingException(const std::string &msg) : msg_(msg) {} const char *what() const noexcept override; private: @@ -51,7 +51,7 @@ const char *ParsingException::what() const noexcept { return msg_.c_str(); } class UnimplementedException : public std::exception { public: - UnimplementedException(const std::string &msg) : msg_(msg) {} + explicit UnimplementedException(const std::string &msg) : msg_(msg) {} const char *what() const noexcept override; private: @@ -67,7 +67,7 @@ const char *UnimplementedException::what() const noexcept { /** Evaluator exception. */ class EvaluatorException : public std::exception { public: - EvaluatorException(const std::string &msg) : msg_(msg) {} + explicit EvaluatorException(const std::string &msg) : msg_(msg) {} const char *what() const noexcept override; private: |
