diff --git a/.gitignore b/.gitignore index 198319b97e9..3a9da2ae4cf 100644 --- a/.gitignore +++ b/.gitignore @@ -45,6 +45,11 @@ Apollonius_graph_2/demo/Apollonius_graph_2/*.exe Apollonius_graph_2/demo/Apollonius_graph_2/*.vcproj Apollonius_graph_2/demo/Apollonius_graph_2/Makefile Apollonius_graph_2/demo/Apollonius_graph_2/apollonius_graph_2 +BGL/examples/BGL_arrangement_2/CMakeLists.txt +BGL/examples/BGL_arrangement_2/Makefile +BGL/examples/BGL_arrangement_2/cgal_test_with_cmake +BGL/examples/BGL_arrangement_2/dual +BGL/examples/BGL_arrangement_2/primal Boolean_set_operations_2/demo/Boolean_set_operations_2/*.exe Boolean_set_operations_2/demo/Boolean_set_operations_2/*.sln Boolean_set_operations_2/demo/Boolean_set_operations_2/*.vcproj diff --git a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt index 37645afcb5b..8fe44074397 100644 --- a/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt +++ b/Arithmetic_kernel/test/Arithmetic_kernel/CMakeLists.txt @@ -36,7 +36,7 @@ if ( CGAL_FOUND ) "MPFI tests need GMP>=4.2, some of the tests will not be compiled" ) else( _IS_GMP_VERSION_TO_LOW ) include( ${MPFI_USE_FILE} ) - create_single_source_cgal_program( "GMP_arithmetic_kernel.cpp" ) + create_single_source_cgal_program( "GMP_arithmetic_kernel.cpp" ) endif( _IS_GMP_VERSION_TO_LOW ) else( MPFI_FOUND ) message( STATUS @@ -46,7 +46,6 @@ if ( CGAL_FOUND ) create_single_source_cgal_program( "Arithmetic_kernel.cpp" ) create_single_source_cgal_program( "LEDA_arithmetic_kernel.cpp" ) create_single_source_cgal_program( "CORE_arithmetic_kernel.cpp" ) - create_single_source_cgal_program( "GMP_arithmetic_kernel.cpp" ) create_single_source_cgal_program( "Get_arithmetic_kernel.cpp" ) else() diff --git a/BGL/examples/BGL_arrangement_2/dual.cpp b/BGL/examples/BGL_arrangement_2/dual.cpp index d66d0617bf1..dbd473bbfe8 100644 --- a/BGL/examples/BGL_arrangement_2/dual.cpp +++ b/BGL/examples/BGL_arrangement_2/dual.cpp @@ -10,7 +10,7 @@ #include #include -#include +#include #include "arr_print.h" diff --git a/BGL/examples/BGL_arrangement_2/primal.cpp b/BGL/examples/BGL_arrangement_2/primal.cpp index 5dd67bbf956..74aa9cfeb67 100644 --- a/BGL/examples/BGL_arrangement_2/primal.cpp +++ b/BGL/examples/BGL_arrangement_2/primal.cpp @@ -9,7 +9,7 @@ #include #include -#include +#include typedef CGAL::Cartesian Kernel; typedef CGAL::Arr_segment_traits_2 Traits_2; diff --git a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_polygon_validation.cpp b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_polygon_validation.cpp index 0fa6f3c7422..e3217b7e954 100644 --- a/Boolean_set_operations_2/test/Boolean_set_operations_2/test_polygon_validation.cpp +++ b/Boolean_set_operations_2/test/Boolean_set_operations_2/test_polygon_validation.cpp @@ -1,10 +1,7 @@ /*test file for polygon validation. Intended for testing the global functions defined at Gps_polygon_validation.h*/ - -#ifndef CGAL_BSO_RATIONAL_NT_H -#define CGAL_BSO_RATIONAL_NT_H - #include +#include #ifdef CGAL_USE_GMP // GMP is installed. Use the GMP rational number-type. @@ -16,8 +13,6 @@ #include typedef CGAL::Quotient Number_type; #endif -#endif - #include @@ -88,8 +83,26 @@ bool testValidationForFile(const char * infilename, std::ofstream & outfile , return res; } +void +special_warnings(const char *, + const char* expr, + const char* file, + int line, + const char* msg ) +{ + std::cerr << " // CGAL: check violation! THIS MESSAGE IS PROBABLY WANTED." << std::endl + << " // Expression : " << expr << std::endl + << " // File : " << file << std::endl + << " // Line : " << line << std::endl + << " // Explanation: " << msg << std::endl + << " // Refer to the bug-reporting instructions at http://www.cgal.org/bug_report.html" + << std::endl; +} + int main (int argc, char * argv[]) { + std::cerr << "Modify the w-a-r-n-i-n-g-s handler...\n"; + CGAL::set_warning_handler(special_warnings); std::string testfilePrefix = "data/validation/val_test"; std::string testfileSuffix = ".dat"; const char* outputfilename = "data/validation/validation_test_output.txt"; diff --git a/Convex_hull_d/include/CGAL/Delaunay_d.h b/Convex_hull_d/include/CGAL/Delaunay_d.h index 04148bfb363..027208039b5 100644 --- a/Convex_hull_d/include/CGAL/Delaunay_d.h +++ b/Convex_hull_d/include/CGAL/Delaunay_d.h @@ -210,10 +210,11 @@ public: bool cocirc = DT->is_S_cocircular(); // Note [Sylvain,2007-03-08] : I added some parentheses to fix a warning, // I hope I got the logic right. + // Note: I have add a new pair of parentheses. Laurent Rineau, 2010/08/20 while ( base() != DT->simplices_end() && - !( ( cocirc && DT->is_bounded_simplex(base()) ) || - ( !cocirc && DT->is_unbounded_simplex(base()) ) && - DT->type_of(base()) == tf ) ) { + !( ( ( cocirc && DT->is_bounded_simplex(base()) ) || + ( !cocirc && DT->is_unbounded_simplex(base()) ) ) + && DT->type_of(base()) == tf ) ) { Base_iterator::operator++(); } } @@ -229,10 +230,11 @@ public: Base_iterator::operator++(); // Note [Sylvain,2007-03-08] : I added some parentheses to fix a warning, // I hope I got the logic right. + // Note: I have add a new pair of parentheses. Laurent Rineau, 2010/08/20 } while ( base() != DT->simplices_end() && - !( ( cocirc && DT->is_bounded_simplex(base()) ) || - ( !cocirc && DT->is_unbounded_simplex(base()) ) && - DT->type_of(base()) == tf ) ); + !( ( ( cocirc && DT->is_bounded_simplex(base()) ) || + ( !cocirc && DT->is_unbounded_simplex(base()) ) + ) && DT->type_of(base()) == tf ) ); return *this; } Simplex_iterator operator++(int) diff --git a/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp b/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp index f3df54836d9..e7f2ef0f041 100644 --- a/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp +++ b/GraphicsView/demo/Bounding_volumes/Bounding_volumes.cpp @@ -68,7 +68,7 @@ private: CGAL::Qt::PolygonGraphicsItem * min_parallelogram_gi; QGraphicsEllipseItem *cgi, *egi; - const int P; + const std::size_t P; QGraphicsRectItem *p_center[3]; Iso_rectangle_2 p_center_iso_rectangle[3]; CGAL::Qt::GraphicsViewPolylineInput * pi; @@ -116,7 +116,7 @@ signals: MainWindow::MainWindow() - : P(3), DemosMainWindow() + : DemosMainWindow(), P(3) { setupUi(this); @@ -133,7 +133,7 @@ MainWindow::MainWindow() egi->hide(); scene.addItem(egi); - for(int i =0; i < P; i++){ + for(std::size_t i =0; i < P; i++){ p_center[i] = new QGraphicsRectItem; p_center[i]->setPen(QPen(Qt::cyan, 0, Qt::SolidLine)); p_center[i]->hide(); @@ -405,7 +405,7 @@ MainWindow::on_actionShowConvexHull_toggled(bool checked) void MainWindow::on_actionShowPCenter_toggled(bool checked) { - for(int i =0; i < P; i++){ + for(std::size_t i =0; i < P; i++){ p_center[i]->setVisible(checked); } emit (changed()); @@ -420,7 +420,7 @@ MainWindow::on_actionClear_triggered() convex_hull.clear(); min_rectangle.clear(); min_parallelogram.clear(); - for(int i=0; i < P;i++){ + for(std::size_t i=0; i < P;i++){ p_center[i]->hide(); } emit(changed()); @@ -451,7 +451,7 @@ MainWindow::on_actionInsertRandomPoints_triggered() // wait cursor QApplication::setOverrideCursor(Qt::WaitCursor); - for(int i = 0; i < number_of_points; ++i){ + for(std::size_t i = 0; i < number_of_points; ++i){ Point_2 p = *pg++; mc.insert(p); me.insert(p); diff --git a/GraphicsView/include/CGAL/Qt/GraphicsViewCircularArcInput.h b/GraphicsView/include/CGAL/Qt/GraphicsViewCircularArcInput.h index 3c2fadc265f..bd17155f3aa 100644 --- a/GraphicsView/include/CGAL/Qt/GraphicsViewCircularArcInput.h +++ b/GraphicsView/include/CGAL/Qt/GraphicsViewCircularArcInput.h @@ -77,7 +77,7 @@ private: template GraphicsViewCircularArcInput::GraphicsViewCircularArcInput(QObject *parent, QGraphicsScene* s) - : GraphicsViewInput(parent), scene_(s), count(0) + : GraphicsViewInput(parent), count(0), scene_(s) { qline = new QGraphicsLineItem(); qcarc = new CircularArcGraphicsItem(); diff --git a/Installation/test/Installation/link_to_CGAL_Qt4.cpp b/Installation/test/Installation/link_to_CGAL_Qt4.cpp index df03abfa722..f83cad15705 100644 --- a/Installation/test/Installation/link_to_CGAL_Qt4.cpp +++ b/Installation/test/Installation/link_to_CGAL_Qt4.cpp @@ -6,7 +6,6 @@ typedef QRectF (*mapToSceneFunction)(const QGraphicsView* , const QRect); int main() { - volatile mapToSceneFunction f = CGAL::Qt::mapToScene; - - return (&f != 0) ? 0 : 1; + mapToSceneFunction f = CGAL::Qt::mapToScene; + return (&f > 0) ? 0 : 1; } diff --git a/Jet_fitting_3/include/CGAL/Monge_via_jet_fitting.h b/Jet_fitting_3/include/CGAL/Monge_via_jet_fitting.h index 11d2c95c573..9ae27202cb8 100644 --- a/Jet_fitting_3/include/CGAL/Monge_via_jet_fitting.h +++ b/Jet_fitting_3/include/CGAL/Monge_via_jet_fitting.h @@ -422,7 +422,7 @@ fill_matrix(InputIterator begin, InputIterator end, y = itb->y(); // Z[line_count] = itb->z(); Z.set(line_count,itb->z()); - for (int k=0; k <= d; k++) for (int i=0; i<=k; i++) + for (std::size_t k=0; k <= d; k++) for (std::size_t i=0; i<=k; i++) M.set(line_count, k*(k+1)/2+i, std::pow(x,k-i)*std::pow(y,i) /(fact(i)*fact(k-i)*std::pow(this->preconditionning,k))); line_count++; diff --git a/Min_circle_2/include/CGAL/Min_circle_2.h b/Min_circle_2/include/CGAL/Min_circle_2.h index 16a6721028c..343f3889ce3 100644 --- a/Min_circle_2/include/CGAL/Min_circle_2.h +++ b/Min_circle_2/include/CGAL/Min_circle_2.h @@ -194,8 +194,7 @@ class Min_circle_2 { const Point& support_point( std::size_t i) const { - CGAL_optimisation_precondition( (i >= 0) && - (i < number_of_support_points())); + CGAL_optimisation_precondition(i < number_of_support_points()); return( support_points[ i]); } // circle @@ -260,8 +259,7 @@ class Min_circle_2 { tco.circle.set( ); break; default: - CGAL_optimisation_assertion( ( n_support_points >= 0) && - ( n_support_points <= 3) ); } + CGAL_optimisation_assertion( n_support_points <= 3 ); } } void diff --git a/Min_circle_2/test/Min_circle_2/test_Min_circle.cpp b/Min_circle_2/test/Min_circle_2/test_Min_circle.cpp index b020ad0f099..c41e2b4eb8d 100644 --- a/Min_circle_2/test/Min_circle_2/test_Min_circle.cpp +++ b/Min_circle_2/test/Min_circle_2/test_Min_circle.cpp @@ -66,7 +66,7 @@ cover_Min_circle_2( bool verbose, const Traits&, const RT&) CGAL::Verbose_ostream verr( verbose); // generate `n' points at random - const int n = 20; + const std::size_t n = 20; CGAL::Random random_x, random_y; Point random_points[ n]; std::size_t i; diff --git a/Min_ellipse_2/test/Min_ellipse_2/test_Min_ellipse_2.cpp b/Min_ellipse_2/test/Min_ellipse_2/test_Min_ellipse_2.cpp index db88600fa5d..9ac1d86846d 100644 --- a/Min_ellipse_2/test/Min_ellipse_2/test_Min_ellipse_2.cpp +++ b/Min_ellipse_2/test/Min_ellipse_2/test_Min_ellipse_2.cpp @@ -231,7 +231,7 @@ cover_Min_ellipse_2( bool verbose, const Traits&, const RT&) CGAL::Verbose_ostream verr( verbose); // generate `n' points at random - const int n = 20; + const std::size_t n = 20; CGAL::Random random_x, random_y; Point random_points[ n]; std::size_t i; diff --git a/STL_Extension/include/CGAL/assertions.h b/STL_Extension/include/CGAL/assertions.h index 9eb5be47f25..eff3212383e 100644 --- a/STL_Extension/include/CGAL/assertions.h +++ b/STL_Extension/include/CGAL/assertions.h @@ -56,7 +56,9 @@ inline bool possibly(Uncertain c); // ---------- #ifdef NDEBUG -# define CGAL_NDEBUG +# ifndef CGAL_NDEBUG +# define CGAL_NDEBUG +# endif #endif #ifdef CGAL_NDEBUG