diff --git a/ChangeLog.md b/ChangeLog.md index f482ce1f4e..89177e62c7 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -41,7 +41,7 @@ - *Geometry* - New LpMetric class (model of CMetricSpace) for distance computations in R^n. (David Coeurjolly, [#1388](https://github.com/DGtal-team/DGtal/pull/1388)) - + ## Bug Fixes - *Configuration/General* - Continuous integration AppVeyor fix @@ -50,6 +50,8 @@ (Roland Denis, [#1335](https://github.com/DGtal-team/DGtal/pull/1335)) - Fixing warning of Clang when including GraphicsMagick v1.3.31 (Roland Denis, [#1366](https://github.com/DGtal-team/DGtal/pull/1366)) + - Fix compilation warnings with gcc 8.2.1 + (Boris Mansencal, [#1384](https://github.com/DGtal-team/DGtal/pull/1384)) - Fix compilation with Visual Studio (15.9.5) and some io tests (Boris Mansencal, [#1380](https://github.com/DGtal-team/DGtal/pull/1380)) - Fixing & updating Travis: documentation deployement and DGtalTools job diff --git a/examples/geometry/curves/estimation/exampleCurvature.cpp b/examples/geometry/curves/estimation/exampleCurvature.cpp index d8c55e53af..02d4877ff5 100644 --- a/examples/geometry/curves/estimation/exampleCurvature.cpp +++ b/examples/geometry/curves/estimation/exampleCurvature.cpp @@ -149,7 +149,7 @@ estimatorOnShapeDigitization( const string& name, std::cout << i << " " << estimations.at(i) << std::endl; } } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << "[estimatorOnShapeDigitization]" << " error in finding a bel." << std::endl; diff --git a/examples/topology/ctopo-2.cpp b/examples/topology/ctopo-2.cpp index 19c28e0bdd..b6c5d9ecf7 100644 --- a/examples/topology/ctopo-2.cpp +++ b/examples/topology/ctopo-2.cpp @@ -103,7 +103,7 @@ int main( int /*argc*/, char** /*argv*/ ) new CustomColors( Color( 255, 255, 0 ), Color( 192, 192, 0 ) )); - GradientColorMap cmap_grad( 0, (const int)vectBdrySCell.size() ); + GradientColorMap cmap_grad( 0, (int)vectBdrySCell.size() ); cmap_grad.addColor( Color( 50, 50, 255 ) ); cmap_grad.addColor( Color( 255, 0, 0 ) ); cmap_grad.addColor( Color( 255, 255, 10 ) ); @@ -138,7 +138,7 @@ int main( int /*argc*/, char** /*argv*/ ) std::vector< std::vector > vectContoursBdrySCell; Surfaces::extractAll2DSCellContours( vectContoursBdrySCell, ks, SAdj, set2d ); - GradientColorMap cmap_grad3( 0, (const int)vectContoursBdrySCell.size() ); + GradientColorMap cmap_grad3( 0, (int)vectContoursBdrySCell.size() ); cmap_grad3.addColor( Color( 50, 50, 255 ) ); cmap_grad3.addColor( Color( 255, 0, 0 ) ); cmap_grad3.addColor( Color( 20, 200, 0 ) ); diff --git a/examples/tutorial-examples/FMMErosion.cpp b/examples/tutorial-examples/FMMErosion.cpp index 665172d413..afb54fd056 100644 --- a/examples/tutorial-examples/FMMErosion.cpp +++ b/examples/tutorial-examples/FMMErosion.cpp @@ -94,7 +94,7 @@ int main( int argc, char** argv ) bel = Surfaces::findABel( ks, binaryImage, domain.size() ); trace.info() << "starting bel: " << bel << std::endl; - } catch (DGtal::InputException i) { + } catch (DGtal::InputException& i) { trace.emphase() << "starting bel not found" << std::endl; return 0; } diff --git a/examples/tutorial-examples/freemanChainFromImage.cpp b/examples/tutorial-examples/freemanChainFromImage.cpp index 59b414108b..197bc002e9 100644 --- a/examples/tutorial-examples/freemanChainFromImage.cpp +++ b/examples/tutorial-examples/freemanChainFromImage.cpp @@ -97,7 +97,7 @@ int main() //! [freemanChainFromImage-extraction] - GradientColorMap cmap_grad( 0, (const int)vectContoursBdryPointels.size() ); + GradientColorMap cmap_grad( 0, (int)vectContoursBdryPointels.size() ); cmap_grad.addColor( Color( 50, 50, 255 ) ); cmap_grad.addColor( Color( 255, 0, 0 ) ); cmap_grad.addColor( Color( 255, 255, 10 ) ); diff --git a/src/DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.ih b/src/DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.ih index e85176787d..a1110391f4 100644 --- a/src/DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.ih +++ b/src/DGtal/geometry/surfaces/estimation/IntegralInvariantCovarianceEstimator.ih @@ -197,7 +197,7 @@ init ASSERT( ( myConvolver != 0 ) && "[DGtal::IntegralInvariantCovarianceEstimator:init] Shape of interest must have been initialized with a call to 'attach'." ); - typedef typename RealPoint::Component Scalar; + typedef typename RealPoint::Component ScalarC; // Clear stuff for( unsigned int i = 0; i < myKernelsSet.size(); ++i ) if ( myKernelsSet[ i ] != 0 ) delete myKernelsSet[ i ]; @@ -228,8 +228,8 @@ init /// Computation of shifting masks if( offset == middle ) continue; // no shift for ( Dimension k = 0; k < Space::dimension; ++k ) - shiftPoint[ k ] = (Scalar) (*it_neigh)[ k ]; - shiftPoint *= (Scalar) myH; + shiftPoint[ k ] = (ScalarC) (*it_neigh)[ k ]; + shiftPoint *= (ScalarC) myH; KernelSupport* kernelShifted = new KernelSupport( shiftPoint, eRadius ); EuclideanMinus* current = new EuclideanMinus( *myKernel ); current->minus( *kernelShifted ); diff --git a/src/DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.ih b/src/DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.ih index f7f35377e9..7797e983f2 100644 --- a/src/DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.ih +++ b/src/DGtal/geometry/surfaces/estimation/IntegralInvariantVolumeEstimator.ih @@ -197,7 +197,7 @@ init ASSERT( ( myConvolver != 0 ) && "[DGtal::IntegralInvariantVolumeEstimator:init] Shape of interest must have been initialized with a call to 'attach'." ); - typedef typename RealPoint::Component Scalar; + typedef typename RealPoint::Component ScalarC; // Clear stuff for( unsigned int i = 0; i < myKernelsSet.size(); ++i ) if ( myKernelsSet[ i ] != 0 ) delete myKernelsSet[ i ]; @@ -228,8 +228,8 @@ init /// Computation of shifting masks if( offset == middle ) continue; // no shift for ( Dimension k = 0; k < Space::dimension; ++k ) - shiftPoint[ k ] = (Scalar) (*it_neigh)[ k ]; - shiftPoint *= (Scalar) myH; + shiftPoint[ k ] = (ScalarC) (*it_neigh)[ k ]; + shiftPoint *= (ScalarC) myH; KernelSupport* kernelShifted = new KernelSupport( shiftPoint, eRadius ); EuclideanMinus* current = new EuclideanMinus( myKernel ); current->minus( kernelShifted ); diff --git a/src/DGtal/geometry/volumes/distance/FMM.ih b/src/DGtal/geometry/volumes/distance/FMM.ih index d1fbd2a7f8..0f0d25456d 100644 --- a/src/DGtal/geometry/volumes/distance/FMM.ih +++ b/src/DGtal/geometry/volumes/distance/FMM.ih @@ -189,7 +189,6 @@ DGtal::FMM /// types typedef typename KSpace::Cell Bel; - typedef typename TImplicitFunction::Value Value; typedef std::pair BelValue; typedef std::map Buffer; diff --git a/src/DGtal/helpers/Shortcuts.h b/src/DGtal/helpers/Shortcuts.h index ae6fe3e0cf..2cf6beb16a 100644 --- a/src/DGtal/helpers/Shortcuts.h +++ b/src/DGtal/helpers/Shortcuts.h @@ -1070,7 +1070,7 @@ namespace DGtal { try { // Search initial bel bel = Surfaces::findABel( K, *bimage, nb_tries_to_find_a_bel ); - } catch (DGtal::InputException e) { + } catch (DGtal::InputException& e) { trace.error() << "[Shortcuts::makeLightDigitalSurface]" << " ERROR Unable to find bel." << std::endl; return ptrSurface; diff --git a/src/DGtal/helpers/ShortcutsGeometry.h b/src/DGtal/helpers/ShortcutsGeometry.h index 75d8b0eadb..70d9667292 100644 --- a/src/DGtal/helpers/ShortcutsGeometry.h +++ b/src/DGtal/helpers/ShortcutsGeometry.h @@ -545,9 +545,9 @@ namespace DGtal typedef functors::HatPointFunction KernelFunction; typedef VoronoiCovarianceMeasureOnDigitalSurface < SurfaceContainer, Metric, KernelFunction > VCMOnSurface; - typedef functors::VCMNormalVectorFunctor NormalFunctor; + typedef functors::VCMNormalVectorFunctor NormalVFunctor; typedef VCMDigitalSurfaceLocalEstimator - < SurfaceContainer, Metric, KernelFunction, NormalFunctor> VCMNormalEstimator; + < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator; KernelFunction chi_r( 1.0, r ); VCMNormalEstimator estimator; estimator.attach( *surface ); @@ -561,9 +561,9 @@ namespace DGtal typedef functors::BallConstantPointFunction KernelFunction; typedef VoronoiCovarianceMeasureOnDigitalSurface < SurfaceContainer, Metric, KernelFunction > VCMOnSurface; - typedef functors::VCMNormalVectorFunctor NormalFunctor; + typedef functors::VCMNormalVectorFunctor NormalVFunctor; typedef VCMDigitalSurfaceLocalEstimator - < SurfaceContainer, Metric, KernelFunction, NormalFunctor> VCMNormalEstimator; + < SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator; KernelFunction chi_r( 1.0, r ); VCMNormalEstimator estimator; estimator.attach( *surface ); diff --git a/src/DGtal/io/Display2DFactory.ih b/src/DGtal/io/Display2DFactory.ih index e8bcd4e599..3f82a4ad18 100644 --- a/src/DGtal/io/Display2DFactory.ih +++ b/src/DGtal/io/Display2DFactory.ih @@ -568,7 +568,7 @@ void DGtal::Display2DFactory::drawArc(Board2D & aBoard, const DGtal::CircleFrom3 //drawing aBoard.drawArc (cx, cy, radius, alpha1, alpha2, orientation); } - catch ( InfiniteNumberException e ) + catch ( InfiniteNumberException& e ) { aBoard.drawLine( NumberTraits::castToDouble(aPoint1[0]), NumberTraits::castToDouble(aPoint1[1]), @@ -611,7 +611,7 @@ void DGtal::Display2DFactory::drawSector(Board2D & aBoard, const DGtal::CircleFr aBoard.drawLine(lx, ly, cx, cy ); } - catch ( InfiniteNumberException e ) + catch ( InfiniteNumberException& e ) { aBoard.drawLine( NumberTraits::castToDouble(aPoint1[0]), NumberTraits::castToDouble(aPoint1[1]), @@ -661,7 +661,7 @@ void DGtal::Display2DFactory::drawAnnulus(Board2D & aBoard, const DGtal::CircleF double oly = cy + (radius+w)*std::sin(alpha2); aBoard.drawLine(ilx, ily, olx, oly); } - catch ( InfiniteNumberException e ) + catch ( InfiniteNumberException& e ) { aBoard.drawLine( NumberTraits::castToDouble(aPoint1[0]), NumberTraits::castToDouble(aPoint1[1]), @@ -698,7 +698,7 @@ void DGtal::Display2DFactory::draw(Board2D & aBoard, const DGtal::CircleFrom3Poi cf3p.getParameters(cx,cy,radius); aBoard.drawCircle (cx,cy,radius); } - catch ( InfiniteNumberException e ) + catch ( InfiniteNumberException& e ) { aBoard.drawLine( NumberTraits::castToDouble(cf3p.myP[0]), NumberTraits::castToDouble(cf3p.myP[1]), diff --git a/src/DGtal/io/Display3DFactory.ih b/src/DGtal/io/Display3DFactory.ih index 8946dafe1a..ff33226875 100644 --- a/src/DGtal/io/Display3DFactory.ih +++ b/src/DGtal/io/Display3DFactory.ih @@ -51,7 +51,6 @@ DGtal::Display3DFactory::draw(Display3D& display, typedef typename Calculus::ConstIterator ConstIterator; typedef typename Calculus::Cell Cell; typedef typename Calculus::SCell SCell; - typedef typename Calculus::KSpace KSpace; display << DGtal::CustomColors3D(DGtal::Color::Black, DGtal::Color::White); diff --git a/src/DGtal/shapes/Shapes.ih b/src/DGtal/shapes/Shapes.ih index 2c79bbb43d..9e82327633 100644 --- a/src/DGtal/shapes/Shapes.ih +++ b/src/DGtal/shapes/Shapes.ih @@ -255,7 +255,6 @@ DGtal::Shapes::makeSetFromPointPredicate BOOST_STATIC_ASSERT (( concepts::ConceptUtils::SameType< Point, typename PointPredicate::Point >::value )); - typedef typename Domain::ConstIterator ConstIterator; for ( ConstIterator it = aSet.domain().begin(), it_end = aSet.domain().end(); it != it_end; ++it ) if ( aPP( *it ) ) aSet.insert( *it ); diff --git a/src/DGtal/shapes/parametric/StarShaped3D.ih b/src/DGtal/shapes/parametric/StarShaped3D.ih index 396558fd20..23c2cf798b 100644 --- a/src/DGtal/shapes/parametric/StarShaped3D.ih +++ b/src/DGtal/shapes/parametric/StarShaped3D.ih @@ -102,9 +102,6 @@ inline double DGtal::StarShaped3D::meanCurvature( AngularCoordinates t) const { - typedef typename Space::RealPoint RealPoint; - - RealPoint art = rt(t); RealPoint arp = rp(t); RealPoint artt = rtt(t); @@ -143,9 +140,6 @@ inline double DGtal::StarShaped3D::gaussianCurvature( AngularCoordinates t ) const { - - typedef typename Space::RealPoint RealPoint; - RealPoint art = rt(t); RealPoint arp = rp(t); RealPoint artt = rtt(t); diff --git a/src/DGtal/topology/DigitalSurface.ih b/src/DGtal/topology/DigitalSurface.ih index a6d33d3b49..cf8ef8ff83 100644 --- a/src/DGtal/topology/DigitalSurface.ih +++ b/src/DGtal/topology/DigitalSurface.ih @@ -278,8 +278,8 @@ facesAroundVertex( const Vertex & v, bool order_ccw_in_3d ) const FaceRange faces; faces.push_back( facesAroundArc( arcs[ 0 ] )[ 0 ] ); faces.push_back( facesAroundArc( arcs[ 2 ] )[ 0 ] ); - faces.push_back( facesAroundArc( arcs[ 1 ] )[ 0 ] ); //< to change order. - faces.push_back( facesAroundArc( arcs[ 3 ] )[ 0 ] ); //< to change order. + faces.push_back( facesAroundArc( arcs[ 1 ] )[ 0 ] ); // < to change order. + faces.push_back( facesAroundArc( arcs[ 3 ] )[ 0 ] ); // < to change order. const KSpace& K = container().space(); auto orth_dir = K.sOrthDir( v ); auto direct = K.sDirect( v, orth_dir ); // true: ccw, false: ! ccw diff --git a/tests/geometry/curves/estimation/testEstimatorComparator.cpp b/tests/geometry/curves/estimation/testEstimatorComparator.cpp index db405fef84..a9dc6dc9df 100644 --- a/tests/geometry/curves/estimation/testEstimatorComparator.cpp +++ b/tests/geometry/curves/estimation/testEstimatorComparator.cpp @@ -180,7 +180,7 @@ bool testCompareEstimator(const std::string &name, Shape & aShape, double h) ok += (nb == nbok); } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << "[testCompareEstimator]" << " error in finding a bel." << std::endl; diff --git a/tests/geometry/curves/estimation/testLengthEstimators.cpp b/tests/geometry/curves/estimation/testLengthEstimators.cpp index 121eade6f8..389223bd0a 100644 --- a/tests/geometry/curves/estimation/testLengthEstimators.cpp +++ b/tests/geometry/curves/estimation/testLengthEstimators.cpp @@ -121,7 +121,7 @@ bool testLengthEstimatorsOnBall(double radius, double h) { bel = Surfaces::findABel( K, dig, 10000 ); } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << " " << " error in finding a bel." << std::endl; @@ -277,7 +277,7 @@ bool testDisplay(double radius, double h) board.saveSVG( "Ranges-Arrows.svg" ); } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << " " << " error in finding a bel." << std::endl; diff --git a/tests/geometry/curves/estimation/testTrueLocalEstimator.cpp b/tests/geometry/curves/estimation/testTrueLocalEstimator.cpp index 2fed3ef23c..a0663dc506 100644 --- a/tests/geometry/curves/estimation/testTrueLocalEstimator.cpp +++ b/tests/geometry/curves/estimation/testTrueLocalEstimator.cpp @@ -181,7 +181,7 @@ testTrueLocalEstimatorOnShapeDigitization( const string & name, << " " << kappa << std::endl; } } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << "[testTrueLocalEstimatorOnShapeDigitization]" << " error in finding a bel." << std::endl; diff --git a/tests/geometry/curves/testStabbingCircleComputer.cpp b/tests/geometry/curves/testStabbingCircleComputer.cpp index b86a45911f..c38d3071e2 100644 --- a/tests/geometry/curves/testStabbingCircleComputer.cpp +++ b/tests/geometry/curves/testStabbingCircleComputer.cpp @@ -121,7 +121,7 @@ ballGenerator(double aCx, double aCy, double aR, bool aFlagIsCW) } return c; } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << " " << " error in finding a bel." << std::endl; diff --git a/tests/geometry/volumes/distance/testFMM.cpp b/tests/geometry/volumes/distance/testFMM.cpp index 9f1bc1c9a1..47c222d7f5 100644 --- a/tests/geometry/volumes/distance/testFMM.cpp +++ b/tests/geometry/volumes/distance/testFMM.cpp @@ -158,7 +158,7 @@ ballGenerator(const int& size, double aCx, double aCy, double aR, GridCurve::track2DBoundaryPoints( points, K, SAdj, dig, bel ); gc.initFromVector(points); } - catch ( InputException e ) + catch ( InputException& e ) { std::cerr << " error in finding a bel." << std::endl; } diff --git a/tests/topology/testDigitalSurface.cpp b/tests/topology/testDigitalSurface.cpp index 58b9b9a18a..42afd34381 100644 --- a/tests/topology/testDigitalSurface.cpp +++ b/tests/topology/testDigitalSurface.cpp @@ -589,7 +589,6 @@ bool testOrderingDigitalSurfaceFacesAroundVertex() { typedef KhalimskySpaceND<3> KSpace; typedef typename KSpace::Space Space; - typedef typename KSpace::Size Size; typedef typename Space::Point Point; typedef HyperRectDomain Domain; typedef typename DigitalSetSelector < Domain, BIG_DS + HIGH_ITER_DS + HIGH_BEL_DS >::Type @@ -602,12 +601,12 @@ bool testOrderingDigitalSurfaceFacesAroundVertex() unsigned int nbok = 0; unsigned int nb = 0; trace.beginBlock ( "Creating surface around one voxel" ); - Point p0; - Point p1 = Point::diagonal( -1 ); - Point p2 = Point::diagonal( 1 ); - Domain domain( p1, p2 ); + Point pt0; + Point pt1 = Point::diagonal( -1 ); + Point pt2 = Point::diagonal( 1 ); + Domain domain( pt1, pt2 ); DigitalSet dig_set( domain ); - dig_set.insert( p0 ); + dig_set.insert( pt0 ); KSpace K; nbok += K.init( domain.lowerBound(), domain.upperBound(), true ) ? 1 : 0; nb++; diff --git a/tests/topology/testVoxelComplex.cpp b/tests/topology/testVoxelComplex.cpp index cc1a4cf1ae..772407c5d5 100644 --- a/tests/topology/testVoxelComplex.cpp +++ b/tests/topology/testVoxelComplex.cpp @@ -540,7 +540,7 @@ TEST_CASE_METHOD(Fixture_complex_fig4, "Get All Critical Cliques of fig4", } } -/* zeroSurance and oneSurface */ +/* zeroSurface and oneSurface */ TEST_CASE_METHOD(Fixture_complex_fig4, "zeroSurface and oneSurface", "[isSurface][function]") { auto &vc = complex_fixture;