mirror of https://github.com/CGAL/cgal
Fix the errors
"linear_least_squares_fitting_points_2.cpp", line 42: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_points_3.cpp", line 105: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_points_3.cpp", line 74: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_points_3.cpp", line 80: Error: The function "rand" must have a prototype. "linear_least_squares_fitting_points_3.cpp", line 81: Error: The function "rand" must have a prototype. "linear_least_squares_fitting_rectangles_2.cpp", line 131: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_rectangles_2.cpp", line 48: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_rectangles_2.cpp", line 90: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_segments_2.cpp", line 101: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_segments_2.cpp", line 143: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_segments_2.cpp", line 192: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_segments_2.cpp", line 45: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_segments_2.cpp", line 72: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_tetrahedra_3.cpp", line 17: Error: The function "rand" must have a prototype. "linear_least_squares_fitting_triangles_2.cpp", line 57: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_triangles_2.cpp", line 99: Error: The function "exit" must have a prototype. "linear_least_squares_fitting_triangles_3.cpp", line 16: Error: The function "rand" must have a prototype. detected by Sun CC.
This commit is contained in:
parent
c7cae82d3e
commit
4d9cf53ed4
|
|
@ -4,6 +4,7 @@
|
||||||
#include <CGAL/Cartesian.h>
|
#include <CGAL/Cartesian.h>
|
||||||
#include <CGAL/linear_least_squares_fitting_3.h>
|
#include <CGAL/linear_least_squares_fitting_3.h>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <cstdlib> // for std::rand
|
||||||
|
|
||||||
typedef double FT;
|
typedef double FT;
|
||||||
typedef CGAL::Cartesian<FT> K;
|
typedef CGAL::Cartesian<FT> K;
|
||||||
|
|
@ -14,7 +15,7 @@ typedef K::Tetrahedron_3 Tetrahedron;
|
||||||
|
|
||||||
FT random_value()
|
FT random_value()
|
||||||
{
|
{
|
||||||
return (FT)rand() / (FT)RAND_MAX;
|
return (FT)std::rand() / (FT)RAND_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
Point random_point()
|
Point random_point()
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
#include <CGAL/Cartesian.h>
|
#include <CGAL/Cartesian.h>
|
||||||
#include <CGAL/linear_least_squares_fitting_3.h>
|
#include <CGAL/linear_least_squares_fitting_3.h>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <cstdlib> // for std::rand
|
||||||
|
|
||||||
typedef double FT;
|
typedef double FT;
|
||||||
typedef CGAL::Cartesian<FT> K;
|
typedef CGAL::Cartesian<FT> K;
|
||||||
|
|
@ -13,7 +14,7 @@ typedef K::Triangle_3 Triangle;
|
||||||
|
|
||||||
FT random_value()
|
FT random_value()
|
||||||
{
|
{
|
||||||
return (FT)rand() / (FT)RAND_MAX;
|
return (FT)std::rand() / (FT)RAND_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
Point random_point()
|
Point random_point()
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ void test_2D()
|
||||||
if(!line.is_horizontal())
|
if(!line.is_horizontal())
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -82,7 +82,7 @@ void test_2D_point_set(const unsigned int nb_points)
|
||||||
if(!line.is_horizontal())
|
if(!line.is_horizontal())
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -71,14 +71,14 @@ void test_one_point()
|
||||||
if(!parallel(horizontal_plane,plane))
|
if(!parallel(horizontal_plane,plane))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Point random_point_xy()
|
Point random_point_xy()
|
||||||
{
|
{
|
||||||
FT x = (FT)((double)rand() / (double)RAND_MAX);
|
FT x = (FT)((double)std::rand() / (double)RAND_MAX);
|
||||||
FT y = (FT)((double)rand() / (double)RAND_MAX);
|
FT y = (FT)((double)std::rand() / (double)RAND_MAX);
|
||||||
return Point(x,y,0);
|
return Point(x,y,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -102,7 +102,7 @@ void test_point_set(const unsigned int nb_points)
|
||||||
if(!parallel(horizontal_plane,plane))
|
if(!parallel(horizontal_plane,plane))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,7 +45,7 @@ void test_1()
|
||||||
if(!(line.is_horizontal() && std::abs(line.c()/line.b()- -2) <= THRESHOLD))
|
if(!(line.is_horizontal() && std::abs(line.c()/line.b()- -2) <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ void test_2()
|
||||||
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -128,7 +128,7 @@ void test_3()
|
||||||
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ void test_1()
|
||||||
if(!(std::abs(-1.0*line.a()/line.b() - 1) <= THRESHOLD && std::abs(line.c()/line.b()) <= THRESHOLD && 1 - quality <= THRESHOLD))
|
if(!(std::abs(-1.0*line.a()/line.b() - 1) <= THRESHOLD && std::abs(line.c()/line.b()) <= THRESHOLD && 1 - quality <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -69,7 +69,7 @@ void test_2()
|
||||||
if(!(std::abs(-1.0*line.a()/line.b() - 1) <= THRESHOLD && std::abs(line.c()/line.b()) <= THRESHOLD && 1 - quality <= THRESHOLD))
|
if(!(std::abs(-1.0*line.a()/line.b() - 1) <= THRESHOLD && std::abs(line.c()/line.b()) <= THRESHOLD && 1 - quality <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@ void test_3()
|
||||||
if(!(std::abs(-1.0*line.a()/line.b() - 1) <= THRESHOLD && std::abs(line.c()/line.b()) <= THRESHOLD && 1 - quality <= THRESHOLD))
|
if(!(std::abs(-1.0*line.a()/line.b() - 1) <= THRESHOLD && std::abs(line.c()/line.b()) <= THRESHOLD && 1 - quality <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -140,7 +140,7 @@ void test_4()
|
||||||
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -189,7 +189,7 @@ void test_5(const unsigned int nb_points)
|
||||||
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ void test_1()
|
||||||
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -96,7 +96,7 @@ void test_2()
|
||||||
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
if(!(std::abs(-1.0*line.a()/line.b() - -1.0*line1.a()/line1.b()) <= THRESHOLD && std::abs(line.c()/line.b() - line1.c()/line1.b()) <= THRESHOLD && std::abs(quality1 - quality) <= THRESHOLD))
|
||||||
{
|
{
|
||||||
std::cout << "failure" << std::endl;
|
std::cout << "failure" << std::endl;
|
||||||
exit(1); // failure
|
std::exit(1); // failure
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue