diff --git a/Bounding_volumes/include/CGAL/Min_sphere_d.h b/Bounding_volumes/include/CGAL/Min_sphere_d.h index 4b43821dc1d..8f4d870520c 100644 --- a/Bounding_volumes/include/CGAL/Min_sphere_d.h +++ b/Bounding_volumes/include/CGAL/Min_sphere_d.h @@ -181,7 +181,7 @@ public: int number_of_points() const { - return points.size(); + return static_cast(points.size()); } int number_of_support_points() const diff --git a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h index 97ac19b582a..f7f2955c1b4 100644 --- a/Point_set_processing_3/include/CGAL/jet_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/jet_estimate_normals.h @@ -158,7 +158,7 @@ jet_estimate_normals( // precondition: at least 2 nearest neighbors CGAL_point_set_processing_precondition(k >= 2); - long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Creates KD-tree\n"); InputIterator it; @@ -173,7 +173,7 @@ jet_estimate_normals( } Tree tree(kd_tree_points.begin(), kd_tree_points.end()); - /*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Computes normals\n"); // iterate over input points, compute and output normal @@ -184,7 +184,7 @@ jet_estimate_normals( put(normal_pmap, it, normal); // normal_pmap[it] = normal } - /*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE("End of jet_estimate_normals()\n"); } diff --git a/Point_set_processing_3/include/CGAL/mst_orient_normals.h b/Point_set_processing_3/include/CGAL/mst_orient_normals.h index 45f64a205fb..643783e68c7 100644 --- a/Point_set_processing_3/include/CGAL/mst_orient_normals.h +++ b/Point_set_processing_3/include/CGAL/mst_orient_normals.h @@ -294,7 +294,7 @@ create_riemannian_graph( // Number of input points const std::size_t num_input_points = distance(first, beyond); - long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Creates KD-tree\n"); // Instanciate a KD-tree search. @@ -312,7 +312,7 @@ create_riemannian_graph( // Recover RAM kd_tree_points.clear(); - /*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Creates Riemannian Graph\n"); // Iterates over input points and creates Riemannian Graph: @@ -432,7 +432,7 @@ create_mst_graph( // Number of input points const std::size_t num_input_points = boost::num_vertices(riemannian_graph); - long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Calls boost::prim_minimum_spanning_tree()\n"); // Computes Minimum Spanning Tree. @@ -444,7 +444,7 @@ create_mst_graph( weight_map( riemannian_graph_weight_map ) .root_vertex( boost::vertex(source_point_index, riemannian_graph) )); - /*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Creates MST Graph\n"); // Converts predecessor map to a MST graph: @@ -544,7 +544,7 @@ mst_orient_normals( // Precondition: at least 2 nearest neighbors CGAL_point_set_processing_precondition(k >= 2); - long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Create Index_property_map\n"); // Create a property map Iterator -> index. @@ -579,7 +579,7 @@ mst_orient_normals( riemannian_graph, source_point); - /*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Calls boost::breadth_first_search()\n"); // Traverse the point set along the MST to propagate source_point's orientation @@ -609,7 +609,7 @@ mst_orient_normals( // At this stage, we have typically 0 unoriented normals if k is large enough CGAL_TRACE(" => %u normals are unoriented\n", unoriented_points.size()); - /*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE("End of mst_orient_normals()\n"); return first_unoriented_point; diff --git a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h index 71c6852d94f..1a327e78c04 100644 --- a/Point_set_processing_3/include/CGAL/pca_estimate_normals.h +++ b/Point_set_processing_3/include/CGAL/pca_estimate_normals.h @@ -152,7 +152,7 @@ pca_estimate_normals( // precondition: at least 2 nearest neighbors CGAL_point_set_processing_precondition(k >= 2); - long memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Creates KD-tree\n"); InputIterator it; @@ -167,7 +167,7 @@ pca_estimate_normals( } Tree tree(kd_tree_points.begin(), kd_tree_points.end()); - /*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE(" Computes normals\n"); // iterate over input points, compute and output normal @@ -178,7 +178,7 @@ pca_estimate_normals( put(normal_pmap, it, normal); // normal_pmap[it] = normal } - /*long*/ memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); + memory = CGAL::Memory_sizer().virtual_size(); CGAL_TRACE(" %ld Mb allocated\n", memory>>20); CGAL_TRACE("End of pca_estimate_normals()\n"); } diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.cpp index 2d0eaaa360a..1fee59949a1 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.cpp @@ -132,7 +132,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger // Mark all normals as unoriented first_unoriented_point = points->begin(); - long memory = CGAL::Memory_sizer().virtual_size(); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); std::cerr << "Estimates normal direction: " << task_timer.time() << " seconds, " << (memory>>20) << " Mb allocated" << std::endl; @@ -150,7 +150,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger // Mark all normals as unoriented first_unoriented_point = points->begin(); - long memory = CGAL::Memory_sizer().virtual_size(); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); std::cerr << "Estimates normal direction: " << task_timer.time() << " seconds, " << (memory>>20) << " Mb allocated" << std::endl; @@ -170,7 +170,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger dialog.orientationNbNeighbors()); std::size_t nb_unoriented_normals = std::distance(first_unoriented_point, points->end()); - long memory = CGAL::Memory_sizer().virtual_size(); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); std::cerr << "Orient normals: " << nb_unoriented_normals << " point(s) with an unoriented normal are selected (" << task_timer.time() << " seconds, " << (memory>>20) << " Mb allocated)" diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_average_spacing_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_average_spacing_plugin.cpp index f6b6969289e..1473fd0fa62 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_average_spacing_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_average_spacing_plugin.cpp @@ -88,7 +88,7 @@ void Polyhedron_demo_point_set_average_spacing_plugin::on_actionAverageSpacing_t // Print result Kernel::Sphere_3 bsphere = points->bounding_sphere(); double radius = std::sqrt(bsphere.squared_radius()); - long memory = CGAL::Memory_sizer().virtual_size(); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); std::cerr << "Average spacing = " << average_spacing << " = " << average_spacing/radius << " * point set radius (" << task_timer.time() << " seconds, " diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_outliers_removal_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_outliers_removal_plugin.cpp index 1ac9a3ce236..e827a4776d1 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_outliers_removal_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_outliers_removal_plugin.cpp @@ -95,7 +95,7 @@ void Polyhedron_demo_point_set_outliers_removal_plugin::on_actionOutlierRemoval_ removed_percentage); std::size_t nb_points_to_remove = std::distance(first_point_to_remove, points->end()); - long memory = CGAL::Memory_sizer().virtual_size(); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); std::cerr << "Simplification: " << nb_points_to_remove << " point(s) are selected (" << task_timer.time() << " seconds, " << (memory>>20) << " Mb allocated)" diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_simplification_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_simplification_plugin.cpp index 76104db70bb..b9bae59ccfa 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_simplification_plugin.cpp @@ -112,7 +112,7 @@ void Polyhedron_demo_point_set_simplification_plugin::on_actionSimplify_triggere } std::size_t nb_points_to_remove = std::distance(first_point_to_remove, points->end()); - long memory = CGAL::Memory_sizer().virtual_size(); + std::size_t memory = CGAL::Memory_sizer().virtual_size(); std::cerr << "Simplification: " << nb_points_to_remove << " point(s) are selected for removal (" << task_timer.time() << " seconds, " << (memory>>20) << " Mb allocated)" diff --git a/STL_Extension/test/STL_Extension/test_namespaces.cpp b/STL_Extension/test/STL_Extension/test_namespaces.cpp index bfcc8e0b0b9..8547b0f1e37 100644 --- a/STL_Extension/test/STL_Extension/test_namespaces.cpp +++ b/STL_Extension/test/STL_Extension/test_namespaces.cpp @@ -1,3 +1,9 @@ +#include + +#if defined(BOOST_MSVC) +// avoid: warning C4996: 'CGAL::copy_n': was declared deprecated +# pragma warning(disable:4996) +#endif #include #include #include diff --git a/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/benchmark.cpp b/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/benchmark.cpp index 0f158930746..88c2c845920 100644 --- a/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/benchmark.cpp +++ b/Segment_Delaunay_graph_2/benchmark/Segment_Delaunay_graph_2/benchmark.cpp @@ -32,6 +32,7 @@ # include #endif + typedef CGAL::Simple_cartesian K; typedef K::Point_2 Point_2; diff --git a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h index 350becd697a..a783d6d2eb1 100644 --- a/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h +++ b/Surface_mesh_parameterization/include/CGAL/Parameterization_mesh_feature_extractor.h @@ -180,7 +180,7 @@ private: while (add_border(tag_free,tag_done)) {} // #borders - m_nb_borders = m_skeleton.size(); + m_nb_borders = static_cast(m_skeleton.size()); // put longest border first if (m_nb_borders>1) @@ -249,7 +249,7 @@ private: double max = 0.0; // #borders - int nb = m_skeleton.size(); + int nb = static_cast(m_skeleton.size()); for(int i=0;i(m_values.size()); } // return address of column{index} // (NULL if coefficient does not exist). diff --git a/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h b/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h index 49ed4d36bdc..93684d81ec3 100644 --- a/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h +++ b/Surface_reconstruction_points_3/include/CGAL/Poisson_reconstruction_function.h @@ -819,7 +819,7 @@ private: if(v->type() == Triangulation::INPUT) values.push_back(v->f()); - int size = values.size(); + std::size_t size = values.size(); if(size == 0) { std::cerr << "Contouring: no input points\n"; @@ -827,7 +827,7 @@ private: } std::sort(values.begin(),values.end()); - int index = size/2; + std::size_t index = size/2; // return values[size/2]; return 0.5 * (values[index] + values[index+1]); // avoids singular cases } diff --git a/Surface_reconstruction_points_3/include/CGAL/Reconstruction_triangulation_3.h b/Surface_reconstruction_points_3/include/CGAL/Reconstruction_triangulation_3.h index 843ed208729..08a4f99e02c 100644 --- a/Surface_reconstruction_points_3/include/CGAL/Reconstruction_triangulation_3.h +++ b/Surface_reconstruction_points_3/include/CGAL/Reconstruction_triangulation_3.h @@ -386,7 +386,7 @@ public: Point_with_normal pwn(get(point_pmap,it), get(normal_pmap,it)); points.push_back(pwn); } - int n = points.size(); + std::size_t n = points.size(); initialize_bounding_sphere(); diff --git a/Surface_reconstruction_points_3/include/CGAL/poisson_refine_triangulation.h b/Surface_reconstruction_points_3/include/CGAL/poisson_refine_triangulation.h index 1438dda7679..a32e92650ac 100644 --- a/Surface_reconstruction_points_3/include/CGAL/poisson_refine_triangulation.h +++ b/Surface_reconstruction_points_3/include/CGAL/poisson_refine_triangulation.h @@ -229,7 +229,7 @@ unsigned int poisson_refine_triangulation( typedef Poisson_mesher_level Refiner; - int nb_vertices = tr.number_of_vertices(); // get former #vertices + std::size_t nb_vertices = tr.number_of_vertices(); // get former #vertices // Delaunay refinement Tets_criteria tets_criteria(radius_edge_ratio_bound*radius_edge_ratio_bound, @@ -241,10 +241,10 @@ unsigned int poisson_refine_triangulation( refiner.scan_triangulation(); // Push bad cells to the queue refiner.refine(Null_mesh_visitor()); // Refine triangulation until queue is empty - int nb_vertices_added = tr.number_of_vertices() - nb_vertices; + nb_vertices = tr.number_of_vertices() - nb_vertices; - return (unsigned int) nb_vertices_added; + return static_cast(nb_vertices); } /// \endcond