Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings corrections #1384

Merged
merged 12 commits into from
Feb 20, 2019
4 changes: 3 additions & 1 deletion ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/geometry/curves/estimation/exampleCurvature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions examples/topology/ctopo-2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int main( int /*argc*/, char** /*argv*/ )
new CustomColors( Color( 255, 255, 0 ),
Color( 192, 192, 0 ) ));

GradientColorMap<int> cmap_grad( 0, (const int)vectBdrySCell.size() );
GradientColorMap<int> 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 ) );
Expand Down Expand Up @@ -138,7 +138,7 @@ int main( int /*argc*/, char** /*argv*/ )
std::vector< std::vector<Z2i::SCell> > vectContoursBdrySCell;
Surfaces<Z2i::KSpace>::extractAll2DSCellContours( vectContoursBdrySCell,
ks, SAdj, set2d );
GradientColorMap<int> cmap_grad3( 0, (const int)vectContoursBdrySCell.size() );
GradientColorMap<int> 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 ) );
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial-examples/FMMErosion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ int main( int argc, char** argv )
bel = Surfaces<KSpace>::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;
}
Expand Down
2 changes: 1 addition & 1 deletion examples/tutorial-examples/freemanChainFromImage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ int main()
//! [freemanChainFromImage-extraction]


GradientColorMap<int> cmap_grad( 0, (const int)vectContoursBdryPointels.size() );
GradientColorMap<int> 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 ) );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down Expand Up @@ -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 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down Expand Up @@ -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 );
Expand Down
1 change: 0 additions & 1 deletion src/DGtal/geometry/volumes/distance/FMM.ih
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ DGtal::FMM<TImage, TSet, TPointPredicate, TPointFunctor>

/// types
typedef typename KSpace::Cell Bel;
typedef typename TImplicitFunction::Value Value;
typedef std::pair<const Bel, Value> BelValue;
typedef std::map<Bel, Value> Buffer;

Expand Down
2 changes: 1 addition & 1 deletion src/DGtal/helpers/Shortcuts.h
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ namespace DGtal
{
try { // Search initial bel
bel = Surfaces<KSpace>::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;
Expand Down
8 changes: 4 additions & 4 deletions src/DGtal/helpers/ShortcutsGeometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,9 +545,9 @@ namespace DGtal
typedef functors::HatPointFunction<Point,Scalar> KernelFunction;
typedef VoronoiCovarianceMeasureOnDigitalSurface
< SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
typedef functors::VCMNormalVectorFunctor<VCMOnSurface> NormalFunctor;
typedef functors::VCMNormalVectorFunctor<VCMOnSurface> NormalVFunctor;
typedef VCMDigitalSurfaceLocalEstimator
< SurfaceContainer, Metric, KernelFunction, NormalFunctor> VCMNormalEstimator;
< SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
KernelFunction chi_r( 1.0, r );
VCMNormalEstimator estimator;
estimator.attach( *surface );
Expand All @@ -561,9 +561,9 @@ namespace DGtal
typedef functors::BallConstantPointFunction<Point,Scalar> KernelFunction;
typedef VoronoiCovarianceMeasureOnDigitalSurface
< SurfaceContainer, Metric, KernelFunction > VCMOnSurface;
typedef functors::VCMNormalVectorFunctor<VCMOnSurface> NormalFunctor;
typedef functors::VCMNormalVectorFunctor<VCMOnSurface> NormalVFunctor;
typedef VCMDigitalSurfaceLocalEstimator
< SurfaceContainer, Metric, KernelFunction, NormalFunctor> VCMNormalEstimator;
< SurfaceContainer, Metric, KernelFunction, NormalVFunctor> VCMNormalEstimator;
KernelFunction chi_r( 1.0, r );
VCMNormalEstimator estimator;
estimator.attach( *surface );
Expand Down
8 changes: 4 additions & 4 deletions src/DGtal/io/Display2DFactory.ih
Original file line number Diff line number Diff line change
Expand Up @@ -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<Coordinate>::castToDouble(aPoint1[0]),
NumberTraits<Coordinate>::castToDouble(aPoint1[1]),
Expand Down Expand Up @@ -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<Coordinate>::castToDouble(aPoint1[0]),
NumberTraits<Coordinate>::castToDouble(aPoint1[1]),
Expand Down Expand Up @@ -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<Coordinate>::castToDouble(aPoint1[0]),
NumberTraits<Coordinate>::castToDouble(aPoint1[1]),
Expand Down Expand Up @@ -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<Coordinate>::castToDouble(cf3p.myP[0]),
NumberTraits<Coordinate>::castToDouble(cf3p.myP[1]),
Expand Down
1 change: 0 additions & 1 deletion src/DGtal/io/Display3DFactory.ih
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ DGtal::Display3DFactory<Space, KSpace>::draw(Display3D<Space, KSpace>& 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);

Expand Down
1 change: 0 additions & 1 deletion src/DGtal/shapes/Shapes.ih
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,6 @@ DGtal::Shapes<TDomain>::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 );
Expand Down
6 changes: 0 additions & 6 deletions src/DGtal/shapes/parametric/StarShaped3D.ih
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,6 @@ inline
double
DGtal::StarShaped3D<TSpace>::meanCurvature( AngularCoordinates t) const
{
typedef typename Space::RealPoint RealPoint;


RealPoint art = rt(t);
RealPoint arp = rp(t);
RealPoint artt = rtt(t);
Expand Down Expand Up @@ -143,9 +140,6 @@ inline
double
DGtal::StarShaped3D<TSpace>::gaussianCurvature( AngularCoordinates t ) const
{

typedef typename Space::RealPoint RealPoint;

RealPoint art = rt(t);
RealPoint arp = rp(t);
RealPoint artt = rtt(t);
Expand Down
4 changes: 2 additions & 2 deletions src/DGtal/topology/DigitalSurface.ih
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions tests/geometry/curves/estimation/testLengthEstimators.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ bool testLengthEstimatorsOnBall(double radius, double h)
{
bel = Surfaces<KSpace>::findABel( K, dig, 10000 );
}
catch ( InputException e )
catch ( InputException& e )
{
std::cerr << " "
<< " error in finding a bel." << std::endl;
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/geometry/curves/testStabbingCircleComputer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion tests/geometry/volumes/distance/testFMM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ ballGenerator(const int& size, double aCx, double aCy, double aR, GridCurve<TKSp
Surfaces<KSpace>::track2DBoundaryPoints( points, K, SAdj, dig, bel );
gc.initFromVector(points);
}
catch ( InputException e )
catch ( InputException& e )
{
std::cerr << " error in finding a bel." << std::endl;
}
Expand Down
11 changes: 5 additions & 6 deletions tests/topology/testDigitalSurface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<Space> Domain;
typedef typename DigitalSetSelector < Domain, BIG_DS + HIGH_ITER_DS + HIGH_BEL_DS >::Type
Expand All @@ -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++;
Expand Down
2 changes: 1 addition & 1 deletion tests/topology/testVoxelComplex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down