From 80a11c75c26dbb56b25b8366f905a3f27b5b8ece Mon Sep 17 00:00:00 2001
From: Ioan Sucan <isucan@willowgarage.com>
Date: Sat, 9 Mar 2013 14:29:54 -0800
Subject: [PATCH] fix some warnings

---
 CMakeModules/FCLVersion.cmake             | 2 +-
 include/fcl/broadphase/hierarchy_tree.hxx | 4 ++--
 src/BVH/BVH_model.cpp                     | 1 +
 src/BVH/BVH_utility.cpp                   | 2 +-
 src/broadphase/broadphase_SaP.cpp         | 6 +++---
 src/narrowphase/gjk.cpp                   | 5 ++---
 src/narrowphase/gjk_libccd.cpp            | 5 ++++-
 7 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/CMakeModules/FCLVersion.cmake b/CMakeModules/FCLVersion.cmake
index cf8e0235..5df53618 100644
--- a/CMakeModules/FCLVersion.cmake
+++ b/CMakeModules/FCLVersion.cmake
@@ -1,7 +1,7 @@
 # set the version in a way CMake can use
 set(FCL_MAJOR_VERSION 0)
 set(FCL_MINOR_VERSION 2)
-set(FCL_PATCH_VERSION 7)
+set(FCL_PATCH_VERSION 8)
 set(FCL_VERSION "${FCL_MAJOR_VERSION}.${FCL_MINOR_VERSION}.${FCL_PATCH_VERSION}")
 
 # increment this when we have ABI changes
diff --git a/include/fcl/broadphase/hierarchy_tree.hxx b/include/fcl/broadphase/hierarchy_tree.hxx
index 05e01cde..07b62912 100644
--- a/include/fcl/broadphase/hierarchy_tree.hxx
+++ b/include/fcl/broadphase/hierarchy_tree.hxx
@@ -1032,7 +1032,7 @@ void HierarchyTree<BV>::init_1(NodeType* leaves, int n_leaves_)
   SortByMorton comp;
   comp.nodes = nodes;
   std::sort(ids, ids + n_leaves, comp);
-  root_node = mortonRecurse_0(ids, ids + n_leaves, (1 << coder.bits()-1), coder.bits()-1);
+  root_node = mortonRecurse_0(ids, ids + n_leaves, (1 << (coder.bits()-1)), coder.bits()-1);
   delete [] ids;
 
   refit();
@@ -1076,7 +1076,7 @@ void HierarchyTree<BV>::init_2(NodeType* leaves, int n_leaves_)
   SortByMorton comp;
   comp.nodes = nodes;
   std::sort(ids, ids + n_leaves, comp);
-  root_node = mortonRecurse_1(ids, ids + n_leaves, (1 << coder.bits()-1), coder.bits()-1);
+  root_node = mortonRecurse_1(ids, ids + n_leaves, (1 << (coder.bits()-1)), coder.bits()-1);
   delete [] ids;
 
   refit();
diff --git a/src/BVH/BVH_model.cpp b/src/BVH/BVH_model.cpp
index 4333af68..9d425588 100644
--- a/src/BVH/BVH_model.cpp
+++ b/src/BVH/BVH_model.cpp
@@ -44,6 +44,7 @@ namespace fcl
 
 template<typename BV>
 BVHModel<BV>::BVHModel(const BVHModel<BV>& other) : CollisionGeometry(other),
+                                                    boost::noncopyable(),
                                                     num_tris(other.num_tris),
                                                     num_vertices(other.num_vertices),
                                                     build_state(other.build_state),
diff --git a/src/BVH/BVH_utility.cpp b/src/BVH/BVH_utility.cpp
index 4377ad35..a72eaac2 100644
--- a/src/BVH/BVH_utility.cpp
+++ b/src/BVH/BVH_utility.cpp
@@ -659,7 +659,7 @@ static inline FCL_REAL maximumDistance_pointcloud(Vec3f* ps, Vec3f* ps2, unsigne
   if(!indices) indirect_index = false;
 
   FCL_REAL maxD = 0;
-  for(unsigned int i = 0; i < n; ++i)
+  for(int i = 0; i < n; ++i)
   {
     int index = indirect_index ? indices[i] : i;
 
diff --git a/src/broadphase/broadphase_SaP.cpp b/src/broadphase/broadphase_SaP.cpp
index c22af618..81cb7f86 100644
--- a/src/broadphase/broadphase_SaP.cpp
+++ b/src/broadphase/broadphase_SaP.cpp
@@ -123,7 +123,7 @@ void SaPCollisionManager::registerObjects(const std::vector<CollisionObject*>& o
 
       endpoints[0]->prev[coord] = NULL;
       endpoints[0]->next[coord] = endpoints[1];
-      for(int i = 1; i < endpoints.size() - 1; ++i)
+      for(size_t i = 1; i < endpoints.size() - 1; ++i)
       {
         endpoints[i]->prev[coord] = endpoints[i-1];
         endpoints[i]->next[coord] = endpoints[i+1];
@@ -498,7 +498,7 @@ bool SaPCollisionManager::collide_(CollisionObject* obj, void* cdata, CollisionC
   const AABB& obj_aabb = obj->getAABB();
 
   FCL_REAL min_val = obj_aabb.min_[axis];
-  FCL_REAL max_val = obj_aabb.max_[axis];
+  //  FCL_REAL max_val = obj_aabb.max_[axis];
 
   EndPoint dummy;
   SaPAABB dummy_aabb;
@@ -564,7 +564,7 @@ bool SaPCollisionManager::distance_(CollisionObject* obj, void* cdata, DistanceC
   {
     old_min_distance = min_dist;
     FCL_REAL min_val = aabb.min_[axis];
-    FCL_REAL max_val = aabb.max_[axis];
+    //    FCL_REAL max_val = aabb.max_[axis];
 
     EndPoint dummy; 
     SaPAABB dummy_aabb;
diff --git a/src/narrowphase/gjk.cpp b/src/narrowphase/gjk.cpp
index 8419d010..1df32317 100644
--- a/src/narrowphase/gjk.cpp
+++ b/src/narrowphase/gjk.cpp
@@ -141,7 +141,7 @@ Vec3f getSupport(const ShapeBase* shape, const Vec3f& dir)
       FCL_REAL maxdot = - std::numeric_limits<FCL_REAL>::max();
       Vec3f* curp = convex->points;
       Vec3f bestv;
-      for(size_t i = 0; i < convex->num_points; ++i, curp+=1)
+      for(int i = 0; i < convex->num_points; ++i, curp+=1)
       {
         FCL_REAL dot = dir.dot(*curp);
         if(dot > maxdot)
@@ -402,6 +402,7 @@ GJK::Status GJK::evaluate(const MinkowskiDiff& shape_, const Vec3f& guess)
   {
   case Valid: distance = ray.length(); break;
   case Inside: distance = 0; break;
+  default: break;
   }
   return status;
 }
@@ -509,8 +510,6 @@ bool EPA::getEdgeDist(SimplexF* face, SimplexV* a, SimplexV* b, FCL_REAL& dist)
 
   if(a_dot_nab < 0) // the origin is on the outside part of ab
   {
-    FCL_REAL ba_l2 = ba.sqrLength();
-
     // following is similar to projectOrigin for two points
     // however, as we dont need to compute the parameterization, dont need to compute 0 or 1
     FCL_REAL a_dot_ba = a->w.dot(ba); 
diff --git a/src/narrowphase/gjk_libccd.cpp b/src/narrowphase/gjk_libccd.cpp
index bae4aaa5..2b18391c 100644
--- a/src/narrowphase/gjk_libccd.cpp
+++ b/src/narrowphase/gjk_libccd.cpp
@@ -87,6 +87,7 @@ struct ccd_triangle_t : public ccd_obj_t
   ccd_vec3_t c;
 };
 
+/*
 static void tripleCross(const ccd_vec3_t* a, const ccd_vec3_t* b, 
                         const ccd_vec3_t* c, ccd_vec3_t* d)
 {
@@ -338,6 +339,7 @@ static int doSimplex4Dist(ccd_simplex_t *simplex, ccd_vec3_t *dir, ccd_real_t* d
   return doSimplex3Dist(simplex, dir, dist);
 }
 
+
 static int doSimplexDist(ccd_simplex_t *simplex, ccd_vec3_t *dir, ccd_real_t* dist)
 {
   if(ccdSimplexSize(simplex) == 2)
@@ -360,6 +362,7 @@ static int doSimplexDist(ccd_simplex_t *simplex, ccd_vec3_t *dir, ccd_real_t* di
 }
 
 
+
 static ccd_real_t __ccdGJKDist(const void *obj1, const void *obj2,
                                const ccd_t *ccd, ccd_simplex_t *simplex,
                                ccd_real_t tolerance)
@@ -435,7 +438,7 @@ static ccd_real_t __ccdGJKDist(const void *obj1, const void *obj2,
   // intersection wasn't found
   return min_dist;
 }
-
+*/
 
 /** Basic shape to ccd shape */
 static void shapeToGJK(const ShapeBase& s, const Transform3f& tf, ccd_obj_t* o)
-- 
GitLab