Commit 68e68954 authored by JasonChmn's avatar JasonChmn Committed by Pierre Fernbach
Browse files

[all] Fix warnings

parent 19da603c
......@@ -47,12 +47,10 @@ struct cubic_hermite_spline : public curve_abc<Time, Numeric, Safe, Point>
///
template<typename In>
cubic_hermite_spline(In PairsBegin, In PairsEnd, const vector_time_t & time_control_points)
: degree_(3)
: size_(std::distance(PairsBegin, PairsEnd)), degree_(3)
{
// Check size of pairs container.
std::size_t const size(std::distance(PairsBegin, PairsEnd));
size_ = size;
if(Safe && size < 1)
if(Safe && size_ < 1)
{
throw std::length_error("can not create cubic_hermite_spline, number of pairs is inferior to 2.");
}
......@@ -65,11 +63,13 @@ struct cubic_hermite_spline : public curve_abc<Time, Numeric, Safe, Point>
setTime(time_control_points);
}
cubic_hermite_spline(const cubic_hermite_spline& other)
: t_min_(other.t_min_), t_max_(other.t_max_), size_(other.size_), degree_(other.degree_),
control_points_(other.control_points_), time_control_points_(other.time_control_points_),
duration_splines_(other.duration_splines_)
: control_points_(other.control_points_), time_control_points_(other.time_control_points_),
duration_splines_(other.duration_splines_), t_min_(other.t_min_), t_max_(other.t_max_),
size_(other.size_), degree_(other.degree_)
{}
/// \brief Destructor.
virtual ~cubic_hermite_spline(){}
......
......@@ -190,7 +190,7 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point>
throw std::invalid_argument("piecewise_curve -> convert_discrete_points_to_polynomial, Error, less than 2 discrete points");
}
typedef piecewise_curve<Time, Numeric, Dim, Safe, Point, T_Point, Polynomial> piecewise_curve_out_t;
Time discretization_step = (T_max-T_min)/(points.size()-1);
Time discretization_step = (T_max-T_min)/Time(points.size()-1);
Time time_actual = T_min;
// Initialization at first points
point_t actual_point = points[0];
......@@ -204,7 +204,7 @@ struct piecewise_curve : public curve_abc<Time, Numeric, Safe, Point>
piecewise_curve_out_t ppc(pol);
time_actual += discretization_step;
// Other points
for (int i=1; i<points.size()-2; i++)
for (std::size_t i=1; i<points.size()-2; i++)
{
coeffs.clear();
actual_point = points[i];
......
......@@ -1407,7 +1407,7 @@ void piecewiseCurveConversionFromDiscretePointsTest(bool& error)
points.push_back(p3);
double T_min = 1.0;
double T_max = 3.0;
double timestep = (T_max-T_min)/(points.size()-1);
double timestep = (T_max-T_min)/double(points.size()-1);
piecewise_polynomial_curve_t ppc = piecewise_polynomial_curve_t::
convert_discrete_points_to_polynomial<polynomial_t>(points,T_min,T_max);
if (!ppc.is_continuous(0))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment