diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_lines.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_lines.cpp index 524e7a03591..c9f99f9e51f 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_lines.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_lines.cpp @@ -36,14 +36,15 @@ int main (int argc, char *argv[]) // // point #2. // : : : : // // point #n. - unsigned int n, k; - int px, py; std::vector points; std::list dual_lines; + unsigned int n; in_file >> n; - points.resize (n); - for (k = 0; k < n; k++) { + points.resize(n); + unsigned int k; + for (k = 0; k < n; ++k) { + int px, py; in_file >> px >> py; points[k] = Point_2 (px, py); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp index 624d02552b8..982092987c3 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/dual_with_data.cpp @@ -21,7 +21,7 @@ int main (int argc, char *argv[]) { // Get the name of the input file from the command line, or use the default // points.dat file if no command-line parameters are given. - const char *filename = (argc > 1) ? argv[1] : "coll_points.dat"; + const char * filename = (argc > 1) ? argv[1] : "coll_points.dat"; // Open the input file. std::ifstream in_file (filename); @@ -32,22 +32,23 @@ int main (int argc, char *argv[]) } // Read the points from the file, and consturct their dual lines. - unsigned int n; - int px, py; std::vector points; - Line_2 dual_line; std::list dual_lines; - unsigned int k; + unsigned int n; in_file >> n; points.resize (n); - for (k = 0; k < n; k++) { + unsigned int k; + for (k = 0; k < n; ++k) { + int px, py; in_file >> px >> py; points[k] = Point_2 (px, py); // The line dual to the point (p_x, p_y) is y = p_x*x - p_y, // or: p_x*x - y - p_y = 0: - dual_line = Line_2 (Number_type(px), Number_type(-1), Number_type(-py)); + Line_2 dual_line = Line_2(Number_type(px), + Number_type(-1), + Number_type(-py)); // Generate the x-monotone curve based on the line and the point index. dual_lines.push_back (X_monotone_curve_2 (dual_line, k)); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp index 115b5a2e5fe..1f0812047f9 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel.cpp @@ -20,11 +20,11 @@ typedef Traits_2::Point_2 Point_2; typedef Traits_2::X_monotone_curve_2 Segment_2; typedef CGAL::Arrangement_2 Arrangement_2; -int main (int argc, char **argv) +int main (int argc, char *argv[]) { // Get the name of the input file from the command line, or use the default // fan_grids.dat file if no command-line parameters are given. - const char *filename = (argc > 1) ? argv[1] : "fan_grids.dat"; + const char * filename = (argc > 1) ? argv[1] : "fan_grids.dat"; // Open the input file. std::ifstream in_file (filename); @@ -41,13 +41,14 @@ int main (int argc, char **argv) // // source and target of segment #2. // : : : : // // source and target of segment #n. - int n; + std::list segments; - int sx, sy, tx, ty; - int i; + unsigned int n; in_file >> n; - for (i = 0; i < n; i++) { + unsigned int i; + for (i = 0; i < n; ++i) { + int sx, sy, tx, ty; in_file >> sx >> sy >> tx >> ty; segments.push_back (Segment_2 (Point_2 (Number_type(sx), Number_type(sy)), Point_2 (Number_type(tx), Number_type(ty)))); diff --git a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp index eac16768b50..fc5dc5aff14 100644 --- a/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp +++ b/Arrangement_on_surface_2/examples/Arrangement_on_surface_2/predefined_kernel_non_intersecting.cpp @@ -20,7 +20,7 @@ int main (int argc, char *argv[]) { // Get the name of the input file from the command line, or use the default // Europe.dat file if no command-line parameters are given. - const char *filename = (argc > 1) ? argv[1] : "Europe.dat"; + const char * filename = (argc > 1) ? argv[1] : "Europe.dat"; // Open the input file. std::ifstream in_file (filename); @@ -38,13 +38,13 @@ int main (int argc, char *argv[]) // // source and target of segment #2. // : : : : // // source and target of segment #n. - int n; std::list segments; - double sx, sy, tx, ty; - int i; + unsigned int n; in_file >> n; - for (i = 0; i < n; i++) { + unsigned int i; + for (i = 0; i < n; ++i) { + double sx, sy, tx, ty; in_file >> sx >> sy >> tx >> ty; segments.push_back (Segment_2 (Point_2 (Number_type(sx), Number_type(sy)), Point_2 (Number_type(tx), Number_type(ty))));