From a04891ff93a8c1bf6c6259734e2a08c1d9eddd73 Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Thu, 9 Aug 2012 16:06:54 +0000 Subject: [PATCH] WARNFIX: fix some warnings triggered by -Wconversion on g++ --- .../CGAL/Mesh_3/Mesh_global_optimizer.h | 2 +- .../Min_sphere_of_spheres_d_impl.h | 4 ++-- .../CGAL/Modular_arithmetic/Residue_type.h | 2 +- Nef_3/include/CGAL/Nef_3/OGL_helper.h | 4 ++-- .../include/CGAL/IO/write_off_points.h | 4 ++-- .../include/CGAL/Index_property_map.h | 2 +- .../include/CGAL/mst_orient_normals.h | 20 +++++++++---------- .../include/CGAL/random_simplify_point_set.h | 4 ++-- ...olyhedron_demo_mesh_3_plugin_cgal_code.cpp | 8 ++++---- ...hedron_demo_mesh_simplification_plugin.cpp | 6 +++--- ...lyhedron_demo_normal_estimation_plugin.cpp | 2 +- ...demo_point_set_outliers_removal_plugin.cpp | 2 +- ...n_demo_point_set_simplification_plugin.cpp | 6 +++--- ...hedron_demo_remeshing_plugin_cgal_code.cpp | 4 ++-- .../Scene_combinatorial_map_item.cpp | 8 ++++---- .../Polyhedron/Scene_combinatorial_map_item.h | 2 +- .../demo/Polyhedron/Scene_polylines_item.cpp | 2 +- .../demo/Polyhedron/include/CGAL/gl_render.h | 2 +- .../demo/Polyhedron/include/Point_set_3.h | 6 +++--- .../CGAL/Polyhedron_incremental_builder_3.h | 2 +- Stream_support/include/CGAL/IO/io.h | 2 +- .../include/CGAL/Subdivision_mask_3.h | 10 +++++----- 22 files changed, 52 insertions(+), 52 deletions(-) diff --git a/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h b/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h index b358ccc229a..08b7099c843 100644 --- a/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h +++ b/Mesh_3/include/CGAL/Mesh_3/Mesh_global_optimizer.h @@ -501,7 +501,7 @@ check_convergence() const sum_moves_ = sum/big_moves_.size(); #endif - return ( sum/big_moves_.size() < convergence_ratio_ ); + return ( sum/FT(big_moves_.size()) < convergence_ratio_ ); } diff --git a/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_impl.h b/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_impl.h index 3c289e52bfb..39fb971bce9 100644 --- a/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_impl.h +++ b/Min_sphere_of_spheres_d/include/CGAL/Min_sphere_of_spheres_d/Min_sphere_of_spheres_d_impl.h @@ -64,7 +64,7 @@ namespace CGAL_MINIBALL_NAMESPACE { template void Min_sphere_of_spheres_d::update(LP_algorithm) { using namespace Min_sphere_of_spheres_d_impl; - const int n = l.size(); + const int n = (int)l.size(); int i, k = n; do { CGAL_MINIBALL_ASSERT(k>=e && e>=0); @@ -224,7 +224,7 @@ namespace CGAL_MINIBALL_NAMESPACE { template void Min_sphere_of_spheres_d::update(Farthest_first_heuristic) { - const int n = l.size(); + const int n = (int)l.size(); int i = e; CGAL_MINIBALL_ASSERT(e <= n); diff --git a/Modular_arithmetic/include/CGAL/Modular_arithmetic/Residue_type.h b/Modular_arithmetic/include/CGAL/Modular_arithmetic/Residue_type.h index e615d1efbdc..0f6228347f3 100644 --- a/Modular_arithmetic/include/CGAL/Modular_arithmetic/Residue_type.h +++ b/Modular_arithmetic/include/CGAL/Modular_arithmetic/Residue_type.h @@ -228,7 +228,7 @@ public: //! constructor of Residue, from long Residue(long n){ - x_= RES_reduce(n); + x_= RES_reduce((double)n); } //! Access operator for x, \c const diff --git a/Nef_3/include/CGAL/Nef_3/OGL_helper.h b/Nef_3/include/CGAL/Nef_3/OGL_helper.h index 49318e44b05..30f375f5294 100644 --- a/Nef_3/include/CGAL/Nef_3/OGL_helper.h +++ b/Nef_3/include/CGAL/Nef_3/OGL_helper.h @@ -178,10 +178,10 @@ namespace OGL { { return static_cast(normal_); } void new_facet_cycle() - { fc_ends_.push_back(coords_.size()); } + { fc_ends_.push_back((unsigned)coords_.size()); } unsigned number_of_facet_cycles() const - { return fc_ends_.size(); } + { return (unsigned)fc_ends_.size(); } Coord_iterator facet_cycle_begin(unsigned i) { CGAL_assertion(i= 2); // Number of input points - const int num_input_points = distance(first, beyond); + 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); CGAL_TRACE(" Creates KD-tree\n"); @@ -339,7 +339,7 @@ create_riemannian_graph( Riemannian_graph_weight_map riemannian_graph_weight_map = get(boost::edge_weight, riemannian_graph); for (ForwardIterator it = first; it != beyond; it++) { - unsigned int it_index = get(index_pmap,it); + std::size_t it_index = get(index_pmap,it); Vector it_normal_vector = get(normal_pmap,it); // Gather set of (k+1) neighboring points. @@ -350,13 +350,13 @@ create_riemannian_graph( Point_vertex_handle_3 point_wrapper(point.x(), point.y(), point.z(), it); Neighbor_search search(*tree, point_wrapper, k+1); Search_iterator search_iterator = search.begin(); - for(unsigned int i=0;i<(k+1);i++) + for(std::size_t i=0;i<(k+1);i++) { if(search_iterator == search.end()) break; // premature ending ForwardIterator neighbor = search_iterator->first; - unsigned int neighbor_index = get(index_pmap,neighbor); + std::size_t neighbor_index = get(index_pmap,neighbor); if (neighbor_index > it_index) // undirected graph { // Add edge @@ -437,13 +437,13 @@ create_mst_graph( CGAL_point_set_processing_precondition(first != beyond); // Number of input points - const int num_input_points = boost::num_vertices(riemannian_graph); + 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); CGAL_TRACE(" Calls boost::prim_minimum_spanning_tree()\n"); // Computes Minimum Spanning Tree. - unsigned int source_point_index = get(index_pmap, source_point); + std::size_t source_point_index = get(index_pmap, source_point); Riemannian_graph_weight_map riemannian_graph_weight_map = get(boost::edge_weight, riemannian_graph); typedef std::vector PredecessorMap; PredecessorMap predecessor(num_input_points); @@ -469,7 +469,7 @@ create_mst_graph( mst_graph[v].is_oriented = (it == source_point); } // add edges - for (unsigned int i=0; i < predecessor.size(); i++) // add edges + for (std::size_t i=0; i < predecessor.size(); i++) // add edges { if (i != predecessor[i]) { @@ -592,7 +592,7 @@ mst_orient_normals( // Traverse the point set along the MST to propagate source_point's orientation Propagate_normal_orientation orienter; - unsigned int source_point_index = get(index_pmap, source_point); + std::size_t source_point_index = get(index_pmap, source_point); boost::breadth_first_search(mst_graph, boost::vertex(source_point_index, mst_graph), // source visitor(boost::make_bfs_visitor(orienter))); @@ -601,7 +601,7 @@ mst_orient_normals( std::deque oriented_points, unoriented_points; for (ForwardIterator it = first; it != beyond; it++) { - unsigned int it_index = get(index_pmap,it); + std::size_t it_index = get(index_pmap,it); typename MST_graph::vertex_descriptor v = boost::vertex(it_index, mst_graph); if (mst_graph[v].is_oriented) oriented_points.push_back(*it); diff --git a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h index b821bceb2e1..cf996bdfb9d 100644 --- a/Point_set_processing_3/include/CGAL/random_simplify_point_set.h +++ b/Point_set_processing_3/include/CGAL/random_simplify_point_set.h @@ -65,8 +65,8 @@ random_simplify_point_set( std::random_shuffle (first, beyond); // Computes first iterator to remove - int nb_points = std::distance(first, beyond); - int first_index_to_remove = int(double(nb_points) * ((100.0-removed_percentage)/100.0)); + std::size_t nb_points = std::distance(first, beyond); + std::size_t first_index_to_remove = (std::size_t)(double(nb_points) * ((100.0-removed_percentage)/100.0)); ForwardIterator first_point_to_remove = first; std::advance(first_point_to_remove, first_index_to_remove); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_3_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_3_plugin_cgal_code.cpp index b3449906d74..a8ef8ac0050 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_3_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_3_plugin_cgal_code.cpp @@ -40,7 +40,7 @@ typedef Tr::Point Point_3; namespace { void CGALglcolor(QColor c) { - ::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); + ::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); } } @@ -318,9 +318,9 @@ Scene_item* cgal_code_mesh_3(const Polyhedron* pMesh, std::ofstream medit_out("out.mesh"); new_item->c3t3().output_to_medit(medit_out); const Scene_item::Bbox& bbox = new_item->bbox(); - new_item->setPosition((bbox.xmin + bbox.xmax)/2.f, - (bbox.ymin + bbox.ymax)/2.f, - (bbox.zmin + bbox.zmax)/2.f); + new_item->setPosition((float)(bbox.xmin + bbox.xmax)/2.f, + (float)(bbox.ymin + bbox.ymax)/2.f, + (float)(bbox.zmin + bbox.zmax)/2.f); return new_item; } else { diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_simplification_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_simplification_plugin.cpp index 5dce477e069..bdad534c43c 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_mesh_simplification_plugin.cpp @@ -47,12 +47,12 @@ void Polyhedron_demo_mesh_simplification_plugin::on_actionSimplify_triggered() // get option (#edges) bool ok; - const unsigned int nb_edges = + const int nb_edges = QInputDialog::getInteger(mw, tr("Stop condition"), tr("Number of edges:"), - pMesh->size_of_halfedges () / 4, // default value: current #edges / 2 + (int)(pMesh->size_of_halfedges () / 4), // default value: current #edges / 2 3, // min = one triangle - pMesh->size_of_halfedges(), // max #edges + (int)pMesh->size_of_halfedges(), // max #edges 1, // step for the spinbox &ok); diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.cpp index 27c8743c507..d8a92b81fea 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_normal_estimation_plugin.cpp @@ -169,7 +169,7 @@ void Polyhedron_demo_normal_estimation_plugin::on_actionNormalEstimation_trigger CGAL::make_normal_of_point_with_normal_pmap(points->begin()), dialog.orientationNbNeighbors()); - int nb_unoriented_normals = std::distance(first_unoriented_point, points->end()); + std::size_t nb_unoriented_normals = std::distance(first_unoriented_point, points->end()); long 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, " 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 f7141971045..09a1c90fc4b 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 @@ -94,7 +94,7 @@ void Polyhedron_demo_point_set_outliers_removal_plugin::on_actionOutlierRemoval_ nb_neighbors, removed_percentage); - int nb_points_to_remove = std::distance(first_point_to_remove, points->end()); + std::size_t nb_points_to_remove = std::distance(first_point_to_remove, points->end()); long memory = CGAL::Memory_sizer().virtual_size(); std::cerr << "Simplification: " << nb_points_to_remove << " point(s) are selected (" << task_timer.time() << " seconds, " 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 d8a07c7bada..76104db70bb 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_simplification_plugin.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_point_set_simplification_plugin.cpp @@ -57,8 +57,8 @@ class Point_set_demo_point_set_simplification_dialog : public QDialog, private U } QString simplificationMethod() const { return m_simplificationMethod->currentText(); } - float randomSimplificationPercentage() const { return m_randomSimplificationPercentage->value(); } - float gridCellSize() const { return m_gridCellSize->value(); } + double randomSimplificationPercentage() const { return m_randomSimplificationPercentage->value(); } + double gridCellSize() const { return m_gridCellSize->value(); } }; void Polyhedron_demo_point_set_simplification_plugin::on_actionSimplify_triggered() @@ -111,7 +111,7 @@ void Polyhedron_demo_point_set_simplification_plugin::on_actionSimplify_triggere dialog.gridCellSize()*average_spacing); } - int nb_points_to_remove = std::distance(first_point_to_remove, points->end()); + std::size_t nb_points_to_remove = std::distance(first_point_to_remove, points->end()); long memory = CGAL::Memory_sizer().virtual_size(); std::cerr << "Simplification: " << nb_points_to_remove << " point(s) are selected for removal (" << task_timer.time() << " seconds, " diff --git a/Polyhedron/demo/Polyhedron/Polyhedron_demo_remeshing_plugin_cgal_code.cpp b/Polyhedron/demo/Polyhedron/Polyhedron_demo_remeshing_plugin_cgal_code.cpp index 2989eed07e0..6ed777bf8b2 100644 --- a/Polyhedron/demo/Polyhedron/Polyhedron_demo_remeshing_plugin_cgal_code.cpp +++ b/Polyhedron/demo/Polyhedron/Polyhedron_demo_remeshing_plugin_cgal_code.cpp @@ -103,7 +103,7 @@ private: namespace { void CGALglcolor(QColor c) { - ::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); + ::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); } } @@ -311,7 +311,7 @@ Scene_item* cgal_code_remesh(QWidget* parent, triangulation.dimension() < 3 ); n = triangulation.number_of_vertices()) { - const int pos = CGAL::default_random.get_int(0, polyhedron_points.size()); + const int pos = CGAL::default_random.get_int(0, (int)polyhedron_points.size()); triangulation.insert(polyhedron_points[pos]); } } diff --git a/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.cpp b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.cpp index e8fff1c38c4..6df06298286 100644 --- a/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.cpp @@ -88,14 +88,14 @@ void Scene_combinatorial_map_item::export_as_polyhedron(Predicate pred,const QSt struct Select_volume{ static const bool only_one_run=true; static const bool swap_orientation=false; - Select_volume(int i):volume_to_select(i),index(0){} + Select_volume(std::size_t i):volume_to_select(i),index(0){} template bool operator() (Dart_handle){ return ++index==volume_to_select; } private: - int volume_to_select; - int index; + std::size_t volume_to_select; + std::size_t index; }; void Scene_combinatorial_map_item::export_current_volume_as_polyhedron() const { @@ -227,7 +227,7 @@ void Scene_combinatorial_map_item::direct_draw() const { typedef Combinatorial_map_3::Dart_of_orbit_const_range<1> Dart_in_facet_range; Volume_dart_range dart_per_volume_range = combinatorial_map().one_dart_per_cell<3>(); - int index = 0; + std::size_t index = 0; for (Volume_dart_range::const_iterator vit=dart_per_volume_range.begin();vit!=dart_per_volume_range.end();++vit) { if (++index!=volume_to_display && volume_to_display!=0) continue; diff --git a/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h index 0df85992499..00a8b143eb4 100644 --- a/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h +++ b/Polyhedron/demo/Polyhedron/Scene_combinatorial_map_item.h @@ -66,7 +66,7 @@ public: private: Kernel::Vector_3 compute_face_normal(Combinatorial_map_3::Dart_const_handle adart) const; Scene_interface* last_known_scene; - int volume_to_display; + std::size_t volume_to_display; QAction* exportSelectedVolume; void* address_of_A; template void export_as_polyhedron(Predicate,const QString&) const; diff --git a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp index 3667b6dfef7..1c7309435d2 100644 --- a/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp +++ b/Polyhedron/demo/Polyhedron/Scene_polylines_item.cpp @@ -20,7 +20,7 @@ namespace { c = c.darker(dv); #undef darker } - ::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); + ::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); } } diff --git a/Polyhedron/demo/Polyhedron/include/CGAL/gl_render.h b/Polyhedron/demo/Polyhedron/include/CGAL/gl_render.h index 28613bc2a8c..225a8ea71ed 100644 --- a/Polyhedron/demo/Polyhedron/include/CGAL/gl_render.h +++ b/Polyhedron/demo/Polyhedron/include/CGAL/gl_render.h @@ -17,7 +17,7 @@ namespace { c = c.darker(dv); #undef darker } - ::glColor4f(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); + ::glColor4d(c.red()/255.0, c.green()/255.0, c.blue()/255.0, c.alpha()/255.0); } } diff --git a/Polyhedron/demo/Polyhedron/include/Point_set_3.h b/Polyhedron/demo/Polyhedron/include/Point_set_3.h index 69f369cb58f..9bb8139b513 100644 --- a/Polyhedron/demo/Polyhedron/include/Point_set_3.h +++ b/Polyhedron/demo/Polyhedron/include/Point_set_3.h @@ -83,7 +83,7 @@ private: mutable Point m_barycenter; // point set's barycenter mutable FT m_diameter_standard_deviation; // point set's standard deviation - unsigned int m_nb_selected_points; // number of selected points + std::size_t m_nb_selected_points; // number of selected points bool m_radii_are_uptodate; @@ -108,7 +108,7 @@ public: /// @endcond /// Gets the number of selected points. - unsigned int nb_selected_points() const { return m_nb_selected_points; } + std::size_t nb_selected_points() const { return m_nb_selected_points; } /// Mark a point as selected/not selected. void select(UI_point* point, bool is_selected = true) @@ -346,7 +346,7 @@ private: FT sq_radius = 0; for (Point_const_iterator it = begin(); it != end(); it++) sq_radius += sqd(*it, m_barycenter); - sq_radius /= size(); + sq_radius /= FT(size()); m_diameter_standard_deviation = CGAL::sqrt(sq_radius); m_bounding_box_is_valid = true; diff --git a/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h b/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h index 91c771c3a28..9bdf4476936 100644 --- a/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h +++ b/Polyhedron/include/CGAL/Polyhedron_incremental_builder_3.h @@ -570,7 +570,7 @@ begin_surface( std::size_t v, std::size_t f, std::size_t h, int mode) { // not know the number of facets that are holes and we do not // know the genus of the surface. So we add 12 and a factor of // 5 percent. - h = int((v + f - 2 + 12) * 2.1); + h = (std::size_t)((double)(v + f - 2 + 12) * 2.1); } hds.reserve( hds.size_of_vertices() + v, hds.size_of_halfedges() + h, diff --git a/Stream_support/include/CGAL/IO/io.h b/Stream_support/include/CGAL/IO/io.h index 4d2b777f2ed..8b746d093a0 100644 --- a/Stream_support/include/CGAL/IO/io.h +++ b/Stream_support/include/CGAL/IO/io.h @@ -274,7 +274,7 @@ std::istream &operator>>(std::istream &is, Color& col) std::cerr << "Stream must be in ascii or binary mode" << std::endl; break; } - col = Color(r,g,b); + col = Color((unsigned char)r,(unsigned char)g,(unsigned char)b); return is; } diff --git a/Subdivision_method_3/include/CGAL/Subdivision_mask_3.h b/Subdivision_method_3/include/CGAL/Subdivision_mask_3.h index cdb4614cef5..5f59a5e1dc2 100644 --- a/Subdivision_method_3/include/CGAL/Subdivision_mask_3.h +++ b/Subdivision_method_3/include/CGAL/Subdivision_mask_3.h @@ -237,9 +237,9 @@ public: if (n == 6) { pt = Point((10*S[0]+R[0])/16, (10*S[1]+R[1])/16, (10*S[2]+R[2])/16); } else { - FT Cn = (FT) (5.0/8.0 - std::sqrt(3+2*std::cos(6.283/n))/64.0); - FT Sw = n*(1-Cn)/Cn; - FT W = n/Cn; + FT Cn = (FT) (5.0/8.0 - std::sqrt(3+2*std::cos(6.283/(double)n))/64.0); + FT Sw = (double)n*(1-Cn)/Cn; + FT W = (double)n/Cn; pt = Point((Sw*S[0]+R[0])/W, (Sw*S[1]+R[1])/W, (Sw*S[2]+R[2])/W); } } @@ -358,11 +358,11 @@ public: Halfedge_around_vertex_circulator vcir = vertex->vertex_begin(); size_t n = circulator_size(vcir); - FT a = (FT) ((4.0-2.0*std::cos(2.0*CGAL_PI/n))/9.0); + FT a = (FT) ((4.0-2.0*std::cos(2.0*CGAL_PI/(double)n))/9.0); Vector cv = ((FT)(1.0-a)) * (vertex->point() - CGAL::ORIGIN); for (size_t i = 1; i <= n; ++i, --vcir) { - cv = cv + (a/n)*(vcir->opposite()->vertex()->point()-CGAL::ORIGIN); + cv = cv + (a/FT(n))*(vcir->opposite()->vertex()->point()-CGAL::ORIGIN); } pt = CGAL::ORIGIN + cv;