From c7b386171cfb5ae2251074431b29426b0e9f503f Mon Sep 17 00:00:00 2001
From: Joseph Mirabel <jmirabel@laas.fr>
Date: Fri, 1 Apr 2016 15:23:21 +0200
Subject: [PATCH] Fix gcc warnings

---
 include/hpp/fcl/BV/OBB.h                      |  2 +-
 include/hpp/fcl/BV/OBBRSS.h                   |  2 +-
 include/hpp/fcl/BV/RSS.h                      |  4 +--
 include/hpp/fcl/BV/kIOS.h                     |  4 +--
 include/hpp/fcl/BVH/BVH_internal.h            |  2 +-
 include/hpp/fcl/broadphase/broadphase.h       |  8 +++---
 include/hpp/fcl/ccd/motion.h                  | 10 +++----
 include/hpp/fcl/ccd/motion_base.h             | 12 ++++-----
 include/hpp/fcl/narrowphase/narrowphase.h     |  4 +--
 include/hpp/fcl/shape/geometric_shapes.h      |  2 +-
 .../hpp/fcl/traversal/traversal_node_base.h   |  2 +-
 .../fcl/traversal/traversal_node_bvh_shape.h  |  6 ++---
 src/BV/OBB.cpp                                |  2 +-
 src/BV/kIOS.cpp                               |  2 +-
 .../interpolation/interpolation_linear.cpp    |  2 +-
 src/collision.cpp                             |  2 +-
 src/distance_func_matrix.cpp                  |  2 +-
 src/narrowphase/narrowphase.cpp               | 26 +++++++++----------
 18 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/include/hpp/fcl/BV/OBB.h b/include/hpp/fcl/BV/OBB.h
index 1dcd7160..e7204805 100644
--- a/include/hpp/fcl/BV/OBB.h
+++ b/include/hpp/fcl/BV/OBB.h
@@ -71,7 +71,7 @@ public:
 
   
   /// @brief Check collision between two OBB and return the overlap part. For OBB, the overlap_part return value is NOT used as the overlap part of two obbs usually is not an obb. 
-  bool overlap(const OBB& other, OBB& overlap_part) const
+  bool overlap(const OBB& other, OBB& /*overlap_part*/) const
   {
     return overlap(other);
   }
diff --git a/include/hpp/fcl/BV/OBBRSS.h b/include/hpp/fcl/BV/OBBRSS.h
index 5b3b9532..376413fe 100644
--- a/include/hpp/fcl/BV/OBBRSS.h
+++ b/include/hpp/fcl/BV/OBBRSS.h
@@ -72,7 +72,7 @@ public:
   }
 
   /// @brief Check collision between two OBBRSS and return the overlap part.
-  bool overlap(const OBBRSS& other, OBBRSS& overlap_part) const
+  bool overlap(const OBBRSS& other, OBBRSS& /*overlap_part*/) const
   {
     return overlap(other);
   }
diff --git a/include/hpp/fcl/BV/RSS.h b/include/hpp/fcl/BV/RSS.h
index 4e42bab3..7dc79c3c 100644
--- a/include/hpp/fcl/BV/RSS.h
+++ b/include/hpp/fcl/BV/RSS.h
@@ -67,7 +67,7 @@ public:
   bool overlap(const RSS& other) const;
 
   /// Not implemented
-  bool overlap(const RSS& other, FCL_REAL& sqrDistLowerBound) const
+  bool overlap(const RSS& /*other*/, FCL_REAL& /*sqrDistLowerBound*/) const
   {
     throw std::runtime_error ("Not implemented.");
     return false;
@@ -75,7 +75,7 @@ public:
 
   /// @brief Check collision between two RSS and return the overlap part.
   /// For RSS, we return nothing, as the overlap part of two RSSs usually is not a RSS.
-  bool overlap(const RSS& other, RSS& overlap_part) const
+  bool overlap(const RSS& other, RSS& /*overlap_part*/) const
   {
     return overlap(other);
   }
diff --git a/include/hpp/fcl/BV/kIOS.h b/include/hpp/fcl/BV/kIOS.h
index 8df8b9f1..5bda122c 100644
--- a/include/hpp/fcl/BV/kIOS.h
+++ b/include/hpp/fcl/BV/kIOS.h
@@ -69,7 +69,7 @@ class kIOS
     }
     else /** spheres partially overlapping or disjoint */
     {
-      float dist = std::sqrt(dist2);
+      float dist = (float)std::sqrt(dist2);
       kIOS_Sphere s;
       s.r = dist + s0.r + s1.r;
       if(dist > 0)
@@ -99,7 +99,7 @@ public:
   /// @brief Check collision between two kIOS and return the overlap part.
   /// For kIOS, we return nothing, as the overlappart of two kIOS usually is not an kIOS
   /// @todo Not efficient. It first checks the sphere collisions and then use OBB for further culling.
-  bool overlap(const kIOS& other, kIOS& overlap_part) const
+  bool overlap(const kIOS& other, kIOS& /*overlap_part*/) const
   {
     return overlap(other);
   }
diff --git a/include/hpp/fcl/BVH/BVH_internal.h b/include/hpp/fcl/BVH/BVH_internal.h
index b7fd4147..3bed6580 100644
--- a/include/hpp/fcl/BVH/BVH_internal.h
+++ b/include/hpp/fcl/BVH/BVH_internal.h
@@ -54,7 +54,7 @@ enum BVHBuildState
     BVH_BUILD_STATE_PROCESSED,        /// after tree has been build, ready for cd use
     BVH_BUILD_STATE_UPDATE_BEGUN,     /// after beginUpdateModel(), state for updating geometry primitives
     BVH_BUILD_STATE_UPDATED,          /// after tree has been build for updated geometry, ready for ccd use
-    BVH_BUILD_STATE_REPLACE_BEGUN,    /// after beginReplaceModel(), state for replacing geometry primitives
+    BVH_BUILD_STATE_REPLACE_BEGUN     /// after beginReplaceModel(), state for replacing geometry primitives
   };
 
 /// @brief Error code for BVH 
diff --git a/include/hpp/fcl/broadphase/broadphase.h b/include/hpp/fcl/broadphase/broadphase.h
index 04311be5..de22336e 100644
--- a/include/hpp/fcl/broadphase/broadphase.h
+++ b/include/hpp/fcl/broadphase/broadphase.h
@@ -85,13 +85,13 @@ public:
   virtual void update() = 0;
 
   /// @brief update the manager by explicitly given the object updated
-  virtual void update(CollisionObject* updated_obj)
+  virtual void update(CollisionObject* /*updated_obj*/)
   {
     update();
   }
 
   /// @brief update the manager by explicitly given the set of objects update
-  virtual void update(const std::vector<CollisionObject*>& updated_objs)
+  virtual void update(const std::vector<CollisionObject*>& /*updated_objs*/)
   {
     update();
   }
@@ -184,13 +184,13 @@ public:
   virtual void update() = 0;
 
   /// @brief update the manager by explicitly given the object updated
-  virtual void update(ContinuousCollisionObject* updated_obj)
+  virtual void update(ContinuousCollisionObject* /*updated_obj*/)
   {
     update();
   }
 
   /// @brief update the manager by explicitly given the set of objects update
-  virtual void update(const std::vector<ContinuousCollisionObject*>& updated_objs)
+  virtual void update(const std::vector<ContinuousCollisionObject*>& /*updated_objs*/)
   {
     update();
   }
diff --git a/include/hpp/fcl/ccd/motion.h b/include/hpp/fcl/ccd/motion.h
index c54d3398..7f2af471 100644
--- a/include/hpp/fcl/ccd/motion.h
+++ b/include/hpp/fcl/ccd/motion.h
@@ -88,7 +88,7 @@ public:
     tf_ = tf;
   }
 
-  void getTaylorModel(TMatrix3& tm, TVector3& tv) const
+  void getTaylorModel(TMatrix3& /*tm*/, TVector3& /*tv*/) const
   {
   }
 
@@ -113,14 +113,14 @@ public:
                const Vec3f& Rd0, const Vec3f& Rd1, const Vec3f& Rd2, const Vec3f& Rd3);
 
   // @brief Construct motion from initial and goal transform
-  SplineMotion(const Matrix3f& R1, const Vec3f& T1,
-               const Matrix3f& R2, const Vec3f& T2) : MotionBase()
+  SplineMotion(const Matrix3f& /*R1*/, const Vec3f& /*T1*/,
+               const Matrix3f& /*R2*/, const Vec3f& /*T2*/) : MotionBase()
   {
     // TODO
   }
 
-  SplineMotion(const Transform3f& tf1,
-               const Transform3f& tf2) : MotionBase()
+  SplineMotion(const Transform3f& /*tf1*/,
+               const Transform3f& /*tf2*/) : MotionBase()
   {
     // TODO
   }
diff --git a/include/hpp/fcl/ccd/motion_base.h b/include/hpp/fcl/ccd/motion_base.h
index 500888e6..8f2656e7 100644
--- a/include/hpp/fcl/ccd/motion_base.h
+++ b/include/hpp/fcl/ccd/motion_base.h
@@ -72,11 +72,11 @@ class TBVMotionBoundVisitor : public BVMotionBoundVisitor
 public:
   TBVMotionBoundVisitor(const BV& bv_, const Vec3f& n_) : bv(bv_), n(n_) {}
 
-  virtual FCL_REAL visit(const MotionBase& motion) const { return 0; }
-  virtual FCL_REAL visit(const SplineMotion& motion) const { return 0; }
-  virtual FCL_REAL visit(const ScrewMotion& motion) const { return 0; }
-  virtual FCL_REAL visit(const InterpMotion& motion) const { return 0; }
-  virtual FCL_REAL visit(const TranslationMotion& motion) const { return 0; }
+  virtual FCL_REAL visit(const MotionBase& /*motion*/) const { return 0; }
+  virtual FCL_REAL visit(const SplineMotion& /*motion*/) const { return 0; }
+  virtual FCL_REAL visit(const ScrewMotion& /*motion*/) const { return 0; }
+  virtual FCL_REAL visit(const InterpMotion& /*motion*/) const { return 0; }
+  virtual FCL_REAL visit(const TranslationMotion& /*motion*/) const { return 0; }
 
 protected:
   BV bv;
@@ -102,7 +102,7 @@ public:
   TriangleMotionBoundVisitor(const Vec3f& a_, const Vec3f& b_, const Vec3f& c_, const Vec3f& n_) :
     a(a_), b(b_), c(c_), n(n_) {}
 
-  virtual FCL_REAL visit(const MotionBase& motion) const { return 0; }
+  virtual FCL_REAL visit(const MotionBase& /*motion*/) const { return 0; }
   virtual FCL_REAL visit(const SplineMotion& motion) const;
   virtual FCL_REAL visit(const ScrewMotion& motion) const;
   virtual FCL_REAL visit(const InterpMotion& motion) const;
diff --git a/include/hpp/fcl/narrowphase/narrowphase.h b/include/hpp/fcl/narrowphase/narrowphase.h
index 0db42cdf..eb308a1c 100644
--- a/include/hpp/fcl/narrowphase/narrowphase.h
+++ b/include/hpp/fcl/narrowphase/narrowphase.h
@@ -209,12 +209,12 @@ struct GJKSolver_libccd
   }
 
 
-  void enableCachedGuess(bool if_enable) const
+  void enableCachedGuess(bool /*if_enable*/) const
   {
     // TODO: need change libccd to exploit spatial coherence
   }
 
-  void setCachedGuess(const Vec3f& guess) const
+  void setCachedGuess(const Vec3f& /*guess*/) const
   {
     // TODO: need change libccd to exploit spatial coherence
   }
diff --git a/include/hpp/fcl/shape/geometric_shapes.h b/include/hpp/fcl/shape/geometric_shapes.h
index 7d9322a0..6c8717ad 100644
--- a/include/hpp/fcl/shape/geometric_shapes.h
+++ b/include/hpp/fcl/shape/geometric_shapes.h
@@ -271,7 +271,7 @@ public:
          FCL_REAL* plane_dis_,
          int num_planes_,
          Vec3f* points_,
-         int num_points_,
+         int /*num_points_*/,
          int* polygons_) : ShapeBase()
   {
     plane_normals = plane_normals_;
diff --git a/include/hpp/fcl/traversal/traversal_node_base.h b/include/hpp/fcl/traversal/traversal_node_base.h
index 2208b0ab..edaf35e3 100644
--- a/include/hpp/fcl/traversal/traversal_node_base.h
+++ b/include/hpp/fcl/traversal/traversal_node_base.h
@@ -106,7 +106,7 @@ public:
   virtual bool BVTesting(int b1, int b2, FCL_REAL& sqrDistLowerBound) const = 0;
 
   /// @brief Leaf test between node b1 and b2, if they are both leafs
-  virtual void leafTesting(int b1, int b2, FCL_REAL& sqrDistLowerBound) const
+  virtual void leafTesting(int /*b1*/, int /*b2*/, FCL_REAL& /*sqrDistLowerBound*/) const
   {
     throw std::runtime_error ("Not implemented");
   }
diff --git a/include/hpp/fcl/traversal/traversal_node_bvh_shape.h b/include/hpp/fcl/traversal/traversal_node_bvh_shape.h
index fe61f5f8..119a549b 100644
--- a/include/hpp/fcl/traversal/traversal_node_bvh_shape.h
+++ b/include/hpp/fcl/traversal/traversal_node_bvh_shape.h
@@ -723,7 +723,7 @@ public:
   }
 
   /// @brief BV culling test in one BVTT node
-  FCL_REAL BVTesting(int b1, int b2) const
+  FCL_REAL BVTesting(int b1, int /*b2*/) const
   {
     return model1->getBV(b1).bv.distance(model2_bv);
   }
@@ -803,7 +803,7 @@ public:
   }
 
   /// @brief Distance testing between leaves (one triangle and one shape)
-  void leafTesting(int b1, int b2) const
+  void leafTesting(int b1, int /*b2*/) const
   {
     if(this->enable_statistics) this->num_leaf_tests++;
     
@@ -987,7 +987,7 @@ public:
     
   }
 
-  FCL_REAL BVTesting(int b1, int b2) const
+  FCL_REAL BVTesting(int b1, int /*b2*/) const
   {
     if(this->enable_statistics) this->num_bv_tests++;
     return distance(this->tf1.getRotation(), this->tf1.getTranslation(), this->model2_bv, this->model1->getBV(b1).bv);
diff --git a/src/BV/OBB.cpp b/src/BV/OBB.cpp
index 8fb9e8de..c89883ca 100644
--- a/src/BV/OBB.cpp
+++ b/src/BV/OBB.cpp
@@ -610,7 +610,7 @@ OBB OBB::operator + (const OBB& other) const
 }
 
 
-FCL_REAL OBB::distance(const OBB& other, Vec3f* P, Vec3f* Q) const
+FCL_REAL OBB::distance(const OBB& /*other*/, Vec3f* /*P*/, Vec3f* /*Q*/) const
 {
   std::cerr << "OBB distance not implemented!" << std::endl;
   return 0.0;
diff --git a/src/BV/kIOS.cpp b/src/BV/kIOS.cpp
index 111aecb4..9a1ae33e 100644
--- a/src/BV/kIOS.cpp
+++ b/src/BV/kIOS.cpp
@@ -63,7 +63,7 @@ bool kIOS::overlap(const kIOS& other) const
   return true;
 }
 
-  bool kIOS::overlap(const kIOS& other, FCL_REAL& sqrDistLowerBound) const
+  bool kIOS::overlap(const kIOS& /*other*/, FCL_REAL& /*sqrDistLowerBound*/) const
   {
     throw std::runtime_error ("Not implemented yet.");
   }
diff --git a/src/ccd/interpolation/interpolation_linear.cpp b/src/ccd/interpolation/interpolation_linear.cpp
index 3821531d..a9635dad 100644
--- a/src/ccd/interpolation/interpolation_linear.cpp
+++ b/src/ccd/interpolation/interpolation_linear.cpp
@@ -84,7 +84,7 @@ FCL_REAL InterpolationLinear::getMovementLengthBound(FCL_REAL time) const
   return getValueUpperBound() - getValue(time);
 }
 
-FCL_REAL InterpolationLinear::getVelocityBound(FCL_REAL time) const
+FCL_REAL InterpolationLinear::getVelocityBound(FCL_REAL /*time*/) const
 {
   return (value_1_ - value_0_);
 }
diff --git a/src/collision.cpp b/src/collision.cpp
index d71c1231..6934af5d 100644
--- a/src/collision.cpp
+++ b/src/collision.cpp
@@ -50,7 +50,7 @@ CollisionFunctionMatrix<GJKSolver>& getCollisionFunctionLookTable()
 {
   static CollisionFunctionMatrix<GJKSolver> table;
   return table;
-};
+}
 
 template<typename NarrowPhaseSolver>
 std::size_t collide(const CollisionObject* o1, const CollisionObject* o2,
diff --git a/src/distance_func_matrix.cpp b/src/distance_func_matrix.cpp
index 84a182a1..07d4feb1 100644
--- a/src/distance_func_matrix.cpp
+++ b/src/distance_func_matrix.cpp
@@ -280,7 +280,7 @@ FCL_REAL BVHDistance<OBBRSS>(const CollisionGeometry* o1, const Transform3f& tf1
 
 template<typename T_BVH, typename NarrowPhaseSolver>
 FCL_REAL BVHDistance(const CollisionGeometry* o1, const Transform3f& tf1, const CollisionGeometry* o2, const Transform3f& tf2,
-                     const NarrowPhaseSolver* nsolver,
+                     const NarrowPhaseSolver* /*nsolver*/,
                      const DistanceRequest& request, DistanceResult& result)
 {
   return BVHDistance<T_BVH>(o1, tf1, o2, tf2, request, result);
diff --git a/src/narrowphase/narrowphase.cpp b/src/narrowphase/narrowphase.cpp
index c5c1c4b1..9b4c28fc 100644
--- a/src/narrowphase/narrowphase.cpp
+++ b/src/narrowphase/narrowphase.cpp
@@ -2416,7 +2416,7 @@ bool halfspacePlaneIntersect(const Halfspace& s1, const Transform3f& tf1,
 
 bool planeIntersect(const Plane& s1, const Transform3f& tf1,
                     const Plane& s2, const Transform3f& tf2,
-                    Vec3f* contact_points, FCL_REAL* penetration_depth, Vec3f* normal)
+                    Vec3f* /*contact_points*/, FCL_REAL* /*penetration_depth*/, Vec3f* /*normal*/)
 {
   Plane new_s1 = transform(s1, tf1);
   Plane new_s2 = transform(s2, tf2);
@@ -2583,7 +2583,7 @@ bool GJKSolver_libccd::shapeIntersect<Halfspace, Cone>(const Halfspace& s1, cons
 template<>
 bool GJKSolver_libccd::shapeIntersect<Halfspace, Halfspace>(const Halfspace& s1, const Transform3f& tf1,
                                                             const Halfspace& s2, const Transform3f& tf2,
-                                                            Vec3f* contact_points, FCL_REAL* penetration_depth, Vec3f* normal) const
+                                                            Vec3f* /*contact_points*/, FCL_REAL* /*penetration_depth*/, Vec3f* /*normal*/) const
 {
   Halfspace s;
   Vec3f p, d;
@@ -2595,7 +2595,7 @@ bool GJKSolver_libccd::shapeIntersect<Halfspace, Halfspace>(const Halfspace& s1,
 template<>
 bool GJKSolver_libccd::shapeIntersect<Plane, Halfspace>(const Plane& s1, const Transform3f& tf1,
                                                         const Halfspace& s2, const Transform3f& tf2,
-                                                        Vec3f* contact_points, FCL_REAL* penetration_depth, Vec3f* normal) const
+                                                        Vec3f* /*contact_points*/, FCL_REAL* /*penetration_depth*/, Vec3f* /*normal*/) const
 {
   Plane pl;
   Vec3f p, d;
@@ -2607,7 +2607,7 @@ bool GJKSolver_libccd::shapeIntersect<Plane, Halfspace>(const Plane& s1, const T
 template<>
 bool GJKSolver_libccd::shapeIntersect<Halfspace, Plane>(const Halfspace& s1, const Transform3f& tf1,
                                                         const Plane& s2, const Transform3f& tf2,
-                                                        Vec3f* contact_points, FCL_REAL* penetration_depth, Vec3f* normal) const
+                                                        Vec3f* /*contact_points*/, FCL_REAL* /*penetration_depth*/, Vec3f* /*normal*/) const
 {
   Plane pl;
   Vec3f p, d;
@@ -2792,9 +2792,9 @@ bool GJKSolver_libccd::shapeDistance<Sphere, Sphere>(const Sphere& s1, const Tra
 }
 
 template<>
-bool GJKSolver_libccd::shapeDistance<Capsule, Capsule>(const Capsule& s1, const Transform3f& tf1,
-                                                       const Capsule& s2, const Transform3f& tf2,
-                                                       FCL_REAL* dist, Vec3f* p1, Vec3f* p2) const
+bool GJKSolver_libccd::shapeDistance<Capsule, Capsule>(const Capsule& /*s1*/, const Transform3f& /*tf1*/,
+                                                       const Capsule& /*s2*/, const Transform3f& /*tf2*/,
+                                                       FCL_REAL* /*dist*/, Vec3f* /*p1*/, Vec3f* /*p2*/) const
 {
   abort ();
 }
@@ -2967,7 +2967,7 @@ bool GJKSolver_indep::shapeIntersect<Halfspace, Cone>(const Halfspace& s1, const
 template<>
 bool GJKSolver_indep::shapeIntersect<Halfspace, Halfspace>(const Halfspace& s1, const Transform3f& tf1,
                                                            const Halfspace& s2, const Transform3f& tf2,
-                                                           Vec3f* contact_points, FCL_REAL* penetration_depth, Vec3f* normal) const
+                                                           Vec3f* /*contact_points*/, FCL_REAL* /*penetration_depth*/, Vec3f* /*normal*/) const
 {
   Halfspace s;
   Vec3f p, d;
@@ -2979,7 +2979,7 @@ bool GJKSolver_indep::shapeIntersect<Halfspace, Halfspace>(const Halfspace& s1,
 template<>
 bool GJKSolver_indep::shapeIntersect<Plane, Halfspace>(const Plane& s1, const Transform3f& tf1,
                                                        const Halfspace& s2, const Transform3f& tf2,
-                                                       Vec3f* contact_points, FCL_REAL* penetration_depth, Vec3f* normal) const
+                                                       Vec3f* /*contact_points*/, FCL_REAL* /*penetration_depth*/, Vec3f* /*normal*/) const
 {
   Plane pl;
   Vec3f p, d;
@@ -2991,7 +2991,7 @@ bool GJKSolver_indep::shapeIntersect<Plane, Halfspace>(const Plane& s1, const Tr
 template<>
 bool GJKSolver_indep::shapeIntersect<Halfspace, Plane>(const Halfspace& s1, const Transform3f& tf1,
                                                        const Plane& s2, const Transform3f& tf2,
-                                                       Vec3f* contact_points, FCL_REAL* penetration_depth, Vec3f* normal) const
+                                                       Vec3f* /*contact_points*/, FCL_REAL* /*penetration_depth*/, Vec3f* /*normal*/) const
 {
   Plane pl;
   Vec3f p, d;
@@ -3176,9 +3176,9 @@ bool GJKSolver_indep::shapeDistance<Sphere, Sphere>(const Sphere& s1, const Tran
 }
 
 template<>
-bool GJKSolver_indep::shapeDistance<Capsule, Capsule>(const Capsule& s1, const Transform3f& tf1,
-                                                      const Capsule& s2, const Transform3f& tf2,
-                                                      FCL_REAL* dist, Vec3f* p1, Vec3f* p2) const
+bool GJKSolver_indep::shapeDistance<Capsule, Capsule>(const Capsule& /*s1*/, const Transform3f& /*tf1*/,
+                                                      const Capsule& /*s2*/, const Transform3f& /*tf2*/,
+                                                      FCL_REAL* /*dist*/, Vec3f* /*p1*/, Vec3f* /*p2*/) const
 {
   abort ();
 }
-- 
GitLab