Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-04-22 11:59:15 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-04-22 11:59:15 +0300
commit87dcee0c0c33ab2f2a8d22e0d0b53f0289ef7a46 (patch)
tree9a1558bcb4e624fd1706be9dc460bd5fb0ba50b6
parentd2cb0f955b25857cb4f3fd28ebc4567f997d56b2 (diff)
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.
-rw-r--r--build_files/cmake/macros.cmake1
-rw-r--r--extern/bullet2/src/BulletDynamics/Featherstone/btMultiBody.cpp2
-rw-r--r--extern/bullet2/src/BulletSoftBody/btSoftBodyHelpers.cpp9
-rw-r--r--extern/bullet2/src/BulletSoftBody/btSoftBodyInternals.h4
-rw-r--r--extern/carve/lib/geom2d.cpp4
-rw-r--r--extern/carve/lib/geom3d.cpp2
-rw-r--r--extern/carve/lib/intersect.cpp10
-rw-r--r--extern/carve/lib/intersect_classify_edge.cpp5
-rw-r--r--extern/carve/lib/intersect_face_division.cpp2
-rw-r--r--extern/carve/lib/math.cpp6
-rw-r--r--extern/carve/lib/mesh.cpp2
-rw-r--r--extern/lzma/LzmaEnc.c3
-rw-r--r--intern/elbeem/intern/loop_tools.h3
-rw-r--r--intern/elbeem/intern/ntl_ray.cpp6
-rw-r--r--intern/elbeem/intern/solver_init.cpp6
-rw-r--r--intern/elbeem/intern/solver_main.cpp2
16 files changed, 48 insertions, 19 deletions
diff --git a/build_files/cmake/macros.cmake b/build_files/cmake/macros.cmake
index 85bc4008346..f26b22a9c5f 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 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<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 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<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 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<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 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<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 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<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 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
diff --git a/intern/elbeem/intern/loop_tools.h b/intern/elbeem/intern/loop_tools.h
index f06fa7c2861..661519b0375 100644
--- a/intern/elbeem/intern/loop_tools.h
+++ b/intern/elbeem/intern/loop_tools.h
@@ -22,6 +22,9 @@
int calcCellsFilled=0; \
int calcCellsEmptied=0; \
int calcNumUsedCells=0; \
+ /* This is a generic macro, and now all it's users are using all variables. */ \
+ (void)calcCurrentMass; \
+ (void)calcCellsFilled \
diff --git a/intern/elbeem/intern/ntl_ray.cpp b/intern/elbeem/intern/ntl_ray.cpp
index 1083fcdb68b..618017ae81d 100644
--- a/intern/elbeem/intern/ntl_ray.cpp
+++ b/intern/elbeem/intern/ntl_ray.cpp
@@ -299,7 +299,7 @@ void ntlRay::intersectBackAABB(ntlVec3Gfx mStart, ntlVec3Gfx mEnd, gfxReal &t, n
//! intersect ray with AABB
void ntlRay::intersectCompleteAABB(ntlVec3Gfx mStart, ntlVec3Gfx mEnd, gfxReal &tmin, gfxReal &tmax) const
{
- char inside = true; /* inside box? */
+ // char inside = true; /* inside box? */ /* UNUSED */
char hit = false; /* ray hits box? */
int whichPlane; /* intersection plane */
gfxReal candPlane[NUMDIM]; /* candidate plane */
@@ -315,11 +315,11 @@ void ntlRay::intersectCompleteAABB(ntlVec3Gfx mStart, ntlVec3Gfx mEnd, gfxReal &
if(origin[i] < mStart[i]) {
quadrant[i] = LEFT;
candPlane [i] = mStart[i];
- inside = false;
+ // inside = false;
} else if(origin[i] > mEnd[i]) {
quadrant[i] = RIGHT;
candPlane[i] = mEnd[i];
- inside = false;
+ // inside = false;
} else {
/* intersect with backside */
if(dir[i] > 0) {
diff --git a/intern/elbeem/intern/solver_init.cpp b/intern/elbeem/intern/solver_init.cpp
index 31372f12282..8b962d604cf 100644
--- a/intern/elbeem/intern/solver_init.cpp
+++ b/intern/elbeem/intern/solver_init.cpp
@@ -685,6 +685,8 @@ bool LbmFsgrSolver::initializeSolverMemory()
if(firstMInit) {
mrSetup();
}
+#else
+ (void)firstMInit;
#endif // LBM_INCLUDE_TESTSOLVERS==1
firstMInit=false;
@@ -1351,13 +1353,13 @@ bool LbmFsgrSolver::initializeSolverPostinit() {
} } \
if(ntype&(CFBndFreeslip)) { \
const LbmFloat dp=dot(objvel, vec2L((*pNormals)[n]) ); \
- const LbmVec oldov=objvel; /*DEBUG*/ \
+ /* const LbmVec oldov=objvel; */ /*DEBUG*/ \
objvel = vec2L((*pNormals)[n]) *dp; \
/* if((j==24)&&(n%5==2)) errMsg("FSBT","n"<<n<<" v"<<objvel<<" nn"<<(*pNormals)[n]<<" dp"<<dp<<" oldov"<<oldov ); */ \
} \
else if(ntype&(CFBndPartslip)) { \
const LbmFloat dp=dot(objvel, vec2L((*pNormals)[n]) ); \
- const LbmVec oldov=objvel; /*DEBUG*/ \
+ /* const LbmVec oldov=objvel; */ /*DEBUG*/ \
/* if((j==24)&&(n%5==2)) errMsg("FSBT","n"<<n<<" v"<<objvel<<" nn"<<(*pNormals)[n]<<" dp"<<dp<<" oldov"<<oldov ); */ \
const LbmFloat partv = mObjectPartslips[OId]; \
/*errMsg("PARTSLIP_DEBUG","l="<<l<<" ccel="<<RAC(ccel, dfInv[l] )<<" partv="<<partv<<",id="<<(int)(mnbf>>24)<<" newval="<<newval ); / part slip debug */ \
diff --git a/intern/elbeem/intern/solver_main.cpp b/intern/elbeem/intern/solver_main.cpp
index 46af6740cf1..55a8d3eb4aa 100644
--- a/intern/elbeem/intern/solver_main.cpp
+++ b/intern/elbeem/intern/solver_main.cpp
@@ -777,6 +777,8 @@ LbmFsgrSolver::mainLoop(int lev)
+ RAC(ccel,dET) - RAC(ccel,dEB)
+ RAC(ccel,dWT) - RAC(ccel,dWB);
+ (void)oldRho;
+
// now reconstruction
ux=oldUx, uy=oldUy, uz=oldUz; // no local vars, only for usqr
rho = REFERENCE_PRESSURE;