From 34c746d1d2a6f507a96a137daaec2e47dc9bc0ae Mon Sep 17 00:00:00 2001 From: Pietro Cerutti Date: Fri, 22 Feb 2013 09:06:16 +0000 Subject: - Chase some compiler warnings / errors, especially with clang --- math/carve/files/patch-common_read_ply.cpp | 11 ++++++ math/carve/files/patch-include-carve_kd_node.hpp | 20 +++++++++++ .../files/patch-include-carve_polyhedron_impl.hpp | 42 ++++++++++++++++++++++ 3 files changed, 73 insertions(+) create mode 100644 math/carve/files/patch-common_read_ply.cpp create mode 100644 math/carve/files/patch-include-carve_kd_node.hpp create mode 100644 math/carve/files/patch-include-carve_polyhedron_impl.hpp (limited to 'math') diff --git a/math/carve/files/patch-common_read_ply.cpp b/math/carve/files/patch-common_read_ply.cpp new file mode 100644 index 000000000000..81c291a6e1de --- /dev/null +++ b/math/carve/files/patch-common_read_ply.cpp @@ -0,0 +1,11 @@ +--- common/read_ply.cpp.orig 2013-02-22 09:51:55.000000000 +0100 ++++ common/read_ply.cpp 2013-02-22 09:52:16.000000000 +0100 +@@ -255,7 +255,7 @@ + carve::poly::Polyhedron *readFile(std::istream &in, const carve::math::Matrix &transform) { + carve::input::Input inputs; + if (!readFile(in, inputs, transform)) { +- return false; ++ return NULL; + } + for (std::list::const_iterator i = inputs.input.begin(); i != inputs.input.end(); ++i) { + carve::poly::Polyhedron *poly = inputs.create(*i); diff --git a/math/carve/files/patch-include-carve_kd_node.hpp b/math/carve/files/patch-include-carve_kd_node.hpp new file mode 100644 index 000000000000..4641ceab8410 --- /dev/null +++ b/math/carve/files/patch-include-carve_kd_node.hpp @@ -0,0 +1,20 @@ +--- include/carve/kd_node.hpp.orig 2013-02-22 09:47:07.000000000 +0100 ++++ include/carve/kd_node.hpp 2013-02-22 09:50:00.000000000 +0100 +@@ -238,7 +238,7 @@ + // q_t - the priority queue value type. + // q_t.first: distance from object to query point. + // q_t.second: pointer to object +- typedef std::pair q_t; ++ typedef std::pair q_t; + + // the queue priority should sort from smallest distance to largest, and on equal distance, by object pointer. + struct pcmp { +@@ -266,7 +266,7 @@ + } + } + +- const typename kd_node::data_t *next() { ++ const data_t *next() { + while (1) { + if (pq.size()) { + q_t t = pq.top(); diff --git a/math/carve/files/patch-include-carve_polyhedron_impl.hpp b/math/carve/files/patch-include-carve_polyhedron_impl.hpp new file mode 100644 index 000000000000..ecede7fdc8a2 --- /dev/null +++ b/math/carve/files/patch-include-carve_polyhedron_impl.hpp @@ -0,0 +1,42 @@ +--- include/carve/polyhedron_impl.hpp.orig 2013-02-22 09:41:13.000000000 +0100 ++++ include/carve/polyhedron_impl.hpp 2013-02-22 09:46:30.000000000 +0100 +@@ -88,9 +88,9 @@ + *(*result)++ = f; + + int r = 1; +- for (size_t i = 0; i < f->edges.size(); ++i) { +- const std::vector &edge_faces = connectivity.edge_to_face[edgeToIndex_fast(f->edges[i])]; +- const face_t *f2 = connectedFace(f, f->edges[i]); ++ for (size_t i = 0; i < f->nEdges(); ++i) { ++ const std::vector &edge_faces = connectivity.edge_to_face[edgeToIndex_fast(f->edge(i))]; ++ const face_t *f2 = connectedFace(f, f->edge(i)); + if (f2) { + r += _faceNeighbourhood(f2, depth - 1, (*result)); + } +@@ -116,7 +116,7 @@ + int r = 0; + const std::vector &edge_faces = connectivity.edge_to_face[edgeToIndex_fast(e)]; + for (size_t i = 0; i < edge_faces.size(); ++i) { +- face_t *f = edge_faces[i]; ++ const face_t *f = edge_faces[i]; + if (f && f->manifold_id == m_id) { r += _faceNeighbourhood(f, depth, &result); } + } + return r; +@@ -131,7 +131,7 @@ + int r = 0; + const std::vector &vertex_faces = connectivity.vertex_to_face[vertexToIndex_fast(v)]; + for (size_t i = 0; i < vertex_faces.size(); ++i) { +- face_t *f = vertex_faces[i]; ++ const face_t *f = vertex_faces[i]; + if (f && f->manifold_id == m_id) { r += _faceNeighbourhood(f, depth, &result); } + } + return r; +@@ -142,7 +142,7 @@ + // accessing connectivity information. + template + int Geometry<3>::vertexToEdges(const vertex_t *v, T result) const { +- std::vector &e = connectivity.vertex_to_edge[vertexToIndex_fast(v)]; ++ const std::vector &e = connectivity.vertex_to_edge[vertexToIndex_fast(v)]; + std::copy(e.begin(), e.end(), result); + return e.size(); + } -- cgit v1.2.3