Skip to content

Commit

Permalink
Merge pull request #880 from dcoeurjo/warningFixes
Browse files Browse the repository at this point in the history
various warning fixes
  • Loading branch information
kerautret committed Jul 14, 2014
2 parents 3952748 + 5f3bc5b commit 0aa3fb7
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
6 changes: 4 additions & 2 deletions examples/tutorial-examples/polyhedralizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ int main( int argc, char** argv )
{
if ( ( (++j) % 50 == 0 ) || ( j == nb ) ) trace.progressBar( j, nb );
Surfel v = *it;
int axis = ks.sOrthDir( v );
planeComputer.init( widthNum, widthDen );
// The visitor takes care of all the breadth-first traversal.
Visitor visitor( digSurf, v );
Expand Down Expand Up @@ -411,5 +410,8 @@ int main( int argc, char** argv )
delete *it;
//! [polyhedralizer-freeMemory]

return 0;
if (isOK && isOK2)
return 0;
else
return 1;
}
10 changes: 6 additions & 4 deletions examples/tutorial-examples/volDTGranulo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ int main(int argc, char ** argv)
trace.info() << "Got "<<cpt<<" points."<<std::endl;
viewer2 << DGtal::Viewer3D<>::updateDisplay;
trace.info() << "viewer2 launched..."<<std::endl;
res = application2.exec();
res = res && application2.exec();

//Granulo
Image imageGranulo ( image.domain() );
Expand Down Expand Up @@ -181,8 +181,10 @@ int main(int argc, char ** argv)
trace.info() << "Got "<<cpt<<" points."<<std::endl;
viewer3 << DGtal::Viewer3D<>::updateDisplay;
trace.info() << "viewer3 launched..."<<std::endl;
res = application3.exec();
res = res&& application3.exec();


return 0;
if (res)
return 0;
else
return 1;
}
5 changes: 4 additions & 1 deletion src/DGtal/base/OrderedAlphabet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@ DGtal::OrderedAlphabet::firstLyndonFactorMod
}
len = j >= i ? (size_t) ( j - i )
: (size_t) ( j + modulo - i );
nb = ( (size_t) ( ( j + modulo - s ) % modulo ) ) / len;
if (len == 0)
nb = 0;
else
nb = ( (size_t) ( ( j + modulo - s ) % modulo ) ) / len;
}


Expand Down
2 changes: 1 addition & 1 deletion tests/base/testClock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ bool test_MultipleLoop()
/// Test restart
bool test_RestartClock()
{
double tmp;
double tmp = 0.0;
double tick_total=0., tick_accum=0.;
Clock c_total, c_accum;

Expand Down
2 changes: 1 addition & 1 deletion tests/geometry/volumes/distance/testVoronoiMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ bool testSimpleRandom2D()
Z2i::Point p( rand() % (b[0]) - a[0], rand() % (b[1]) + a[1] );
sites.insert( p );
}
ok = testVoronoiMapFromSites2D<Z2i::DigitalSet>(sites,"random-dense");
ok = ok && testVoronoiMapFromSites2D<Z2i::DigitalSet>(sites,"random-dense");
trace.endBlock();

return ok;
Expand Down
17 changes: 7 additions & 10 deletions tests/shapes/testPolynomial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,23 +164,20 @@ int main( int argc, char** argv )
A = ishape.nearestPoint (A,0.01,200,0.1*step);
double a = ishape.meanCurvature( A );
// double a=ishape.gaussianCurvature(A);
if ( boost::math::isnan( a ))
{
a = 0;
}
else
if ( !boost::math::isnan( a ))
{
if ( a > maxCurv )

if ( a > maxCurv )
{
maxCurv = a;
}
else if ( a < minCurv )
{
else
if ( a < minCurv )
{
minCurv = a;
}
}
}
}

trace.info() << " Min = " << minCurv << std::endl;
trace.info() << " Max = " << maxCurv << std::endl;

Expand Down

0 comments on commit 0aa3fb7

Please sign in to comment.