[Bf-blender-cvs] [87dcee0] master: Silence some annoying warnings when doing full build with strict flags

Sergey Sharybin noreply at git.blender.org
Fri Apr 22 11:04:56 CEST 2016


Commit: 87dcee0c0c33ab2f2a8d22e0d0b53f0289ef7a46
Author: Sergey Sharybin
Date:   Fri Apr 22 10:59:15 2016 +0200
Branches: master
https://developer.blender.org/rB87dcee0c0c33ab2f2a8d22e0d0b53f0289ef7a46

Silence some annoying warnings when doing full build with strict flags

This mainly touches extern libraries and few debug-only places in intern.

Some summary:

- External libraries are not strict at all about missing declarations,
  so we can rather safely remove such warning together with other strict
  flags.

- Bullet has some static functions which are not used.
  Those were commented out.

- Carve now has some unused debug-only functions commented out as well.
  While we're on the way of getting rid of Carve, it makes sense to make
  things a bit cleaner for the time being.

- In LZMA we have some parts disabled which gives some set but unused
  variables which is rather correct.

- Elbeem had quite some variables set and never used because their usage
  is inside of debug-only code which is commented out.

Note about patching upstream libraries: surely one might say that we
have to make local patchset against this, but own experience says it
only gives extra work trying to merge such tweaks to a new upstream
version and usually it's just faster to re-apply such fixes again after
bundling new upstream library.

===================================================================

M	build_files/cmake/macros.cmake
M	extern/bullet2/src/BulletDynamics/Featherstone/btMultiBody.cpp
M	extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.cpp
M	extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h
M	extern/carve/lib/geom2d.cpp
M	extern/carve/lib/geom3d.cpp
M	extern/carve/lib/intersect.cpp
M	extern/carve/lib/intersect_classify_edge.cpp
M	extern/carve/lib/intersect_face_division.cpp
M	extern/carve/lib/math.cpp
M	extern/carve/lib/mesh.cpp
M	extern/lzma/LzmaEnc.c
M	intern/elbeem/intern/loop_tools.h
M	intern/elbeem/intern/ntl_ray.cpp
M	intern/elbeem/intern/solver_init.cpp
M	intern/elbeem/intern/solver_main.cpp

===================================================================

diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 85bc400..f26b22a 100644
--- a/build_files/cmake/macros.cmake
+++ b/build_files/cmake/macros.cmake
@@ -968,6 +968,7 @@ macro(remove_strict_flags)
 		remove_cc_flag(
 			"-Wstrict-prototypes"
 			"-Wmissing-prototypes"
+			"-Wmissing-declarations"
 			"-Wmissing-format-attribute"
 			"-Wunused-local-typedefs"
 			"-Wunused-macros"
diff --git a/extern/bullet2/src/BulletDynamics/Featherstone/btMultiBody.cpp b/extern/bullet2/src/BulletDynamics/Featherstone/btMultiBody.cpp
index e49cf30..aea8c68 100644
--- a/extern/bullet2/src/BulletDynamics/Featherstone/btMultiBody.cpp
+++ b/extern/bullet2/src/BulletDynamics/Featherstone/btMultiBody.cpp
@@ -51,6 +51,7 @@ namespace {
         bottom_out = -displacement.cross(top_out) + rotation_matrix * bottom_in;
     }
 
+/*
     void InverseSpatialTransform(const btMatrix3x3 &rotation_matrix,
                                  const btVector3 &displacement,
                                  const btVector3 &top_in,
@@ -80,6 +81,7 @@ namespace {
 		top_out = a_top.cross(b_top);
 		bottom_out = a_bottom.cross(b_top) + a_top.cross(b_bottom);
 	}
+*/
 }
 
 
diff --git a/extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.cpp b/extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.cpp
index 293a393..d96f85e 100644
--- a/extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.cpp
+++ b/extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.cpp
@@ -1127,6 +1127,7 @@ int								nattrb=0;
 int								hasbounds=0;
 int result = sscanf(node,"%d %d %d %d",&nnode,&ndims,&nattrb,&hasbounds);
 result = sscanf(node,"%d %d %d %d",&nnode,&ndims,&nattrb,&hasbounds);
+(void)result;
 node += nextLine(node);
 
 pos.resize(nnode);
@@ -1208,10 +1209,10 @@ if(ele&&ele[0])
 			}
 		}
 	}
-printf("Nodes:  %u\r\n",psb->m_nodes.size());
-printf("Links:  %u\r\n",psb->m_links.size());
-printf("Faces:  %u\r\n",psb->m_faces.size());
-printf("Tetras: %u\r\n",psb->m_tetras.size());
+printf("Nodes:  %d\r\n",psb->m_nodes.size());
+printf("Links:  %d\r\n",psb->m_links.size());
+printf("Faces:  %d\r\n",psb->m_faces.size());
+printf("Tetras: %d\r\n",psb->m_tetras.size());
 return(psb);
 }
 
diff --git a/extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h b/extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h
index 759509a..1b9d02d 100644
--- a/extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h
+++ b/extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h
@@ -422,7 +422,7 @@ static inline btVector3		BaryCoord(	const btVector3& a,
 }
 
 //
-static btScalar				ImplicitSolve(	btSoftBody::ImplicitFn* fn,
+static inline btScalar				ImplicitSolve(	btSoftBody::ImplicitFn* fn,
 										  const btVector3& a,
 										  const btVector3& b,
 										  const btScalar accuracy,
@@ -504,7 +504,7 @@ static inline btScalar		VolumeOf(	const btVector3& x0,
 }
 
 //
-static void					EvaluateMedium(	const btSoftBodyWorldInfo* wfi,
+static inline void					EvaluateMedium(	const btSoftBodyWorldInfo* wfi,
 										   const btVector3& x,
 										   btSoftBody::sMedium& medium)
 {
diff --git a/extern/carve/lib/geom2d.cpp b/extern/carve/lib/geom2d.cpp
index 3b60823..0e8f3a9 100644
--- a/extern/carve/lib/geom2d.cpp
+++ b/extern/carve/lib/geom2d.cpp
@@ -157,6 +157,7 @@ namespace carve {
       return pointInPoly(points, p2_adapt_ident(), p);
     }
 
+#if 0
     static int lineSegmentPolyIntersections(const P2Vector &points,
                                             LineSegment2 line,
                                             std::vector<PolyIntersectionInfo> &out) {
@@ -224,6 +225,7 @@ namespace carve {
       }
       return count;
     }
+#endif
  
     struct FwdSort {
       bool operator()(const PolyIntersectionInfo &a,
@@ -239,6 +241,7 @@ namespace carve {
       }
     };
 
+#if 0
     static int sortedLineSegmentPolyIntersections(const P2Vector &points,
                                                   LineSegment2 line,
                                                   std::vector<PolyIntersectionInfo> &out) {
@@ -253,6 +256,7 @@ namespace carve {
       }
       return count;
     }
+#endif
 
     bool pickContainedPoint(const std::vector<P2> &poly, P2 &result) {
       return pickContainedPoint(poly, p2_adapt_ident(), result);
diff --git a/extern/carve/lib/geom3d.cpp b/extern/carve/lib/geom3d.cpp
index e67ace5..9408503 100644
--- a/extern/carve/lib/geom3d.cpp
+++ b/extern/carve/lib/geom3d.cpp
@@ -28,6 +28,7 @@ namespace carve {
   namespace geom3d {
 
     namespace {
+#if 0
       int is_same(const std::vector<const Vector *> &a,
           const std::vector<const Vector *> &b) {
         if (a.size() != b.size()) return false;
@@ -52,6 +53,7 @@ not_fwd:
 not_rev:
         return 0;
       }
+#endif
     }
 
     bool planeIntersection(const Plane &a, const Plane &b, Ray &r) {
diff --git a/extern/carve/lib/intersect.cpp b/extern/carve/lib/intersect.cpp
index e8e5d32..d780e08 100644
--- a/extern/carve/lib/intersect.cpp
+++ b/extern/carve/lib/intersect.cpp
@@ -236,6 +236,7 @@ namespace {
 
 
 
+#if 0
   void dump_intersections(std::ostream &out, carve::csg::Intersections &csg_intersections) {
     std::vector<dump_data> temp;
 
@@ -284,13 +285,14 @@ namespace {
         vertices.push_back(i_pt->v);
       }
     }
+#endif
 
     carve::point::PointSet points(vertices);
 
     std::string outf("/tmp/intersection-points.ply");
     ::writePLY(outf, &points, true);
-#endif
   }
+#endif
 
 
 
@@ -481,6 +483,7 @@ void carve::csg::CSG::makeVertexIntersections() {
 
 
 
+#if 0
 static carve::mesh::MeshSet<3>::vertex_t *chooseWeldPoint(
     const carve::csg::detail::VSet &equivalent,
     carve::csg::VertexPool &vertex_pool) {
@@ -537,7 +540,7 @@ static const carve::mesh::MeshSet<3>::vertex_t *weld(
   }
   return weld_point;
 }
-
+#endif
 
 
 void carve::csg::CSG::groupIntersections() {
@@ -1219,6 +1222,7 @@ void carve::csg::CSG::makeFaceEdges(carve::csg::EdgeClassification &eclass,
  * 
  * @param fll 
  */
+#if 0
 static void checkFaceLoopIntegrity(carve::csg::FaceLoopList &fll) {
   static carve::TimingName FUNC_NAME("CSG::checkFaceLoopIntegrity()");
   carve::TimingBlock block(FUNC_NAME);
@@ -1245,7 +1249,7 @@ static void checkFaceLoopIntegrity(carve::csg::FaceLoopList &fll) {
     }
   }
 }
-
+#endif
 
 
 /** 
diff --git a/extern/carve/lib/intersect_classify_edge.cpp b/extern/carve/lib/intersect_classify_edge.cpp
index 4f7111a..23cfa21 100644
--- a/extern/carve/lib/intersect_classify_edge.cpp
+++ b/extern/carve/lib/intersect_classify_edge.cpp
@@ -139,6 +139,7 @@ namespace carve {
 
 
 
+#if 0
       static void walkGraphSegment(carve::csg::detail::VVSMap &shared_edge_graph,
                                    const carve::csg::detail::VSet &branch_points,
                                    V2 initial,
@@ -215,7 +216,7 @@ namespace carve {
 #endif
 #endif
       }
-
+#endif
 
 
       static carve::geom3d::Vector perpendicular(const carve::geom3d::Vector &v) {
@@ -383,6 +384,7 @@ namespace carve {
 
 
 
+#if 0
       static void traceIntersectionGraph(const V2Set &shared_edges,
                                          const FLGroupList & /* a_loops_grouped */,
                                          const FLGroupList & /* b_loops_grouped */,
@@ -416,6 +418,7 @@ namespace carve {
           walkGraphSegment(shared_edge_graph, branch_points, V2(v1, v2), a_edge_map, b_edge_map, out);
         }
       }
+#endif
 
       void hashByPerimeter(FLGroupList &grp, PerimMap &perim_map) {
         for (FLGroupList::iterator i = grp.begin(); i != grp.end(); ++i) {
diff --git a/extern/carve/lib/intersect_face_division.cpp b/extern/carve/lib/intersect_face_division.cpp
index 04c8bc5..6554ef5 100644
--- a/extern/carve/lib/intersect_face_division.cpp
+++ b/extern/carve/lib/intersect_face_division.cpp
@@ -1409,6 +1409,7 @@ namespace {
     return s.str().substr(1);
   }
 
+#if 0
   void dumpAsGraph(carve::mesh::MeshSet<3>::face_t *face,
                    const std::vector<carve::mesh::MeshSet<3>::vertex_t *> &base_loop,
                    const carve::csg::V2Set &face_edges,
@@ -1450,6 +1451,7 @@ namespace {
     }
     std::cerr << "};\n";
   }
+#endif
 
   void generateOneFaceLoop(carve::mesh::MeshSet<3>::face_t *face,
                            const carve::csg::detail::Data &data,
diff --git a/extern/carve/lib/math.cpp b/extern/carve/lib/math.cpp
index 9f8d45d..3b7f951 100644
--- a/extern/carve/lib/math.cpp
+++ b/extern/carve/lib/math.cpp
@@ -43,6 +43,7 @@ namespace carve {
     };
 
     namespace {
+#if 0
       void cplx_sqrt(double re, double im,
                      double &re_1, double &im_1,
                      double &re_2, double &im_2) {
@@ -57,7 +58,9 @@ namespace carve {
           im_2 = -im_1;
         }
       }
+#endif
 
+#if 0
     void cplx_cbrt(double re, double im,
                    double &re_1, double &im_1,
                    double &re_2, double &im_2,
@@ -76,6 +79,7 @@ namespace carve {
         im_3 = r * sin(t + M_TWOPI * 2.0 / 3.0);
       }
     }
+#endif
 
       void add_root(std::vector<Root> &roots, double root) {
         for (size_t i = 0; i < roots.size(); ++i) {
@@ -250,6 +254,7 @@ namespace carve {
       e2.normalize();
     }
 
+#if 0
     static void eig3(const Matrix3 &m,
                      double l,
                      carve::geom::vector<3> &e1,
@@ -259,6 +264,7 @@ namespace carve {
       e2.x = 0.0; e2.y = 1.0; e2.z = 0.0;
       e3.x = 0.0; e3.y = 0.0; e3.z = 1.0;
     }
+#endif
 
     void eigSolveSymmetric(const Matrix3 &m,
                            double &l1, carve::geom::vector<3> &e1,
diff --git a/extern/carve/lib/mesh.cpp b/extern/carve/lib/mesh.cpp
index 34b04b9..fe66927 100644
--- a/extern/carve/lib/mesh.cpp
+++ b/extern/carve/lib/mesh.cpp
@@ -774,7 +774,6 @@ namespace carve {
   // connectivity information in the Polyhedron.
   mesh::MeshSet<3> *meshFromPolyhedron(const poly::Polyhedron *poly, int manifold_id) {
     typedef mesh::Vertex<3> vertex_t;
-    typedef mesh::Vertex<3>::vector_t vector_t;
     typedef mesh::Edge<3> edge_t;
     typedef mesh::Face<3> face_t;
     typedef mesh::Mesh<3> mesh_t;
@@ -884,7 +883,6 @@ namespace carve {
 
   // construct a Polyhedron from a MeshSet
   poly::Polyhedron *pol

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list