From 2eecb4c70ba8da62af2712bb2343f171208523f2 Mon Sep 17 00:00:00 2001 From: Florent Lamiraux <florent@laas.fr> Date: Sun, 2 Aug 2015 11:23:41 +0200 Subject: [PATCH] Fix some compilation warnings. --- src/graph/edge.cc | 8 +++++--- src/graph/graph-component.cc | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/graph/edge.cc b/src/graph/edge.cc index e8e22e76..766a887d 100644 --- a/src/graph/edge.cc +++ b/src/graph/edge.cc @@ -159,7 +159,7 @@ namespace hpp { } bool Edge::build (core::PathPtr_t& path, ConfigurationIn_t q1, - ConfigurationIn_t q2, const core::WeighedDistance& d) + ConfigurationIn_t q2, const core::WeighedDistance&) const { ConstraintSetPtr_t constraints = pathConstraint (); @@ -191,7 +191,8 @@ namespace hpp { hppDout (warning, c->name () << " fails often." << std::endl << ss); } else { hppDout (warning, c->name () << " succeeds at rate " - << (double)(ss.nbSuccess ()) / ss.numberOfObservations () + << (value_type)(ss.nbSuccess ()) / + (value_type) ss.numberOfObservations () << "."); } return false; @@ -388,7 +389,8 @@ namespace hpp { hppDout (warning, cs->name () << " fails often." << std::endl << ss); } else { hppDout (warning, cs->name () << " succeeds at rate " - << (double)(ss.nbSuccess ()) / ss.numberOfObservations () + << (value_type)(ss.nbSuccess ()) / + (value_type) ss.numberOfObservations () << "."); } return false; diff --git a/src/graph/graph-component.cc b/src/graph/graph-component.cc index 0bc453cb..22c44545 100644 --- a/src/graph/graph-component.cc +++ b/src/graph/graph-component.cc @@ -40,7 +40,7 @@ namespace hpp { GraphComponentWkPtr_t GraphComponent::get(std::size_t id) { # ifdef HPP_DEBUG - if (id < 0 || id >= (int)components_.size()) + if (id >= components_.size()) throw std::out_of_range ("ID out of range."); # endif // HPP_DEBUG return components_[id]; -- GitLab