From 87dcee0c0c33ab2f2a8d22e0d0b53f0289ef7a46 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Fri, 22 Apr 2016 10:59:15 +0200 Subject: 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. --- extern/bullet2/src/BulletDynamics/Featherstone/btMultiBody.cpp | 2 ++ extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.cpp | 9 +++++---- extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h | 4 ++-- extern/carve/lib/geom2d.cpp | 4 ++++ extern/carve/lib/geom3d.cpp | 2 ++ extern/carve/lib/intersect.cpp | 10 +++++++--- extern/carve/lib/intersect_classify_edge.cpp | 5 ++++- extern/carve/lib/intersect_face_division.cpp | 2 ++ extern/carve/lib/math.cpp | 6 ++++++ extern/carve/lib/mesh.cpp | 2 -- extern/lzma/LzmaEnc.c | 3 +-- 11 files changed, 35 insertions(+), 14 deletions(-) (limited to 'extern') diff --git a/extern/bullet2/src/BulletDynamics/Featherstone/btMultiBody.cpp b/extern/bullet2/src/BulletDynamics/Featherstone/btMultiBody.cpp index e49cf30d044..aea8c683732 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 293a393e55e..d96f85ec630 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 759509a1d86..1b9d02d79f9 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 3b608238bb2..0e8f3a9377c 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 &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 &out) { @@ -253,6 +256,7 @@ namespace carve { } return count; } +#endif bool pickContainedPoint(const std::vector &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 e67ace51c8b..94085034f10 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 &a, const std::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 e8e5d329c34..d780e08d224 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 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 4f7111a83bd..23cfa21b643 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 04c8bc5a79f..6554ef500ed 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::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 9f8d45de9ba..3b7f95193c1 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 &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 34b04b9ac66..fe66927a707 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 *polyhedronFromMesh(const mesh::MeshSet<3> *mesh, int manifold_id) { - typedef poly::Polyhedron poly_t; typedef poly::Polyhedron::vertex_t vertex_t; typedef poly::Polyhedron::edge_t edge_t; typedef poly::Polyhedron::face_t face_t; diff --git a/extern/lzma/LzmaEnc.c b/extern/lzma/LzmaEnc.c index 9196c43f64b..8c5636fc89e 100644 --- a/extern/lzma/LzmaEnc.c +++ b/extern/lzma/LzmaEnc.c @@ -1919,11 +1919,10 @@ static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) { UInt32 beforeSize = kNumOpts; - Bool btMode; if (!RangeEnc_Alloc(&p->rc, alloc)) return SZ_ERROR_MEM; - btMode = (p->matchFinderBase.btMode != 0); #ifdef COMPRESS_MF_MT + Bool btMode = (p->matchFinderBase.btMode != 0);; p->mtMode = (p->multiThread && !p->fastMode && btMode); #endif -- cgit v1.2.3