svn commit: r312756 - head/math/carve/files
Pietro Cerutti
gahr at FreeBSD.org
Fri Feb 22 09:06:18 UTC 2013
Author: gahr
Date: Fri Feb 22 09:06:16 2013
New Revision: 312756
URL: http://svnweb.freebsd.org/changeset/ports/312756
Log:
- Chase some compiler warnings / errors, especially with clang
Added:
head/math/carve/files/patch-common_read_ply.cpp (contents, props changed)
head/math/carve/files/patch-include-carve_kd_node.hpp (contents, props changed)
head/math/carve/files/patch-include-carve_polyhedron_impl.hpp (contents, props changed)
Added: head/math/carve/files/patch-common_read_ply.cpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/math/carve/files/patch-common_read_ply.cpp Fri Feb 22 09:06:16 2013 (r312756)
@@ -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<filetype_t>(in, inputs, transform)) {
+- return false;
++ return NULL;
+ }
+ for (std::list<carve::input::Data *>::const_iterator i = inputs.input.begin(); i != inputs.input.end(); ++i) {
+ carve::poly::Polyhedron *poly = inputs.create<carve::poly::Polyhedron>(*i);
Added: head/math/carve/files/patch-include-carve_kd_node.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/math/carve/files/patch-include-carve_kd_node.hpp Fri Feb 22 09:06:16 2013 (r312756)
@@ -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<double, const typename kd_node::data_t *> q_t;
++ typedef std::pair<double, const data_t *> 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();
Added: head/math/carve/files/patch-include-carve_polyhedron_impl.hpp
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/math/carve/files/patch-include-carve_polyhedron_impl.hpp Fri Feb 22 09:06:16 2013 (r312756)
@@ -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<const face_t *> &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<const face_t *> &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<const face_t *> &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<const face_t *> &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<typename T>
+ int Geometry<3>::vertexToEdges(const vertex_t *v, T result) const {
+- std::vector<const edge_t *> &e = connectivity.vertex_to_edge[vertexToIndex_fast(v)];
++ const std::vector<const edge_t *> &e = connectivity.vertex_to_edge[vertexToIndex_fast(v)];
+ std::copy(e.begin(), e.end(), result);
+ return e.size();
+ }
More information about the svn-ports-head
mailing list