diff options
author | Andrew Coles <andrew_coles@yahoo.co.uk> | 2009-03-23 21:15:33 +0000 |
---|---|---|
committer | Andrew Coles <andrew_coles@yahoo.co.uk> | 2009-03-23 21:15:33 +0000 |
commit | 64fbd93cd904790e831aa5404698c5aa30f54be4 (patch) | |
tree | db67f63eec0d4e77a7b5b7d45911c99bb6f2ffc7 /unsupported/Eigen/src/BVH | |
parent | 70c0174bf9cb0a7dd22c47e377f9b9efc22ba4c9 (diff) |
As values may be used uninitialised, they have now been given
sensible defaults; or, in other words, if worse comes to worst,
we'll get a guaranteed segfault rather than a heisenburg.
Diffstat (limited to 'unsupported/Eigen/src/BVH')
-rw-r--r-- | unsupported/Eigen/src/BVH/BVAlgorithms.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/unsupported/Eigen/src/BVH/BVAlgorithms.h b/unsupported/Eigen/src/BVH/BVAlgorithms.h index eda052bee..15d53d44a 100644 --- a/unsupported/Eigen/src/BVH/BVAlgorithms.h +++ b/unsupported/Eigen/src/BVH/BVAlgorithms.h @@ -163,8 +163,8 @@ typename Minimizer::Scalar ei_minimize_helper(const BVH &tree, Minimizer &minimi typedef typename BVH::Index Index; typedef std::pair<Scalar, Index> QueueElement; //first element is priority - typename BVH::VolumeIterator vBegin, vEnd; - typename BVH::ObjectIterator oBegin, oEnd; + typename BVH::VolumeIterator vBegin = 0, vEnd = 0; + typename BVH::ObjectIterator oBegin = 0, oEnd = 0; std::priority_queue<QueueElement, std::vector<QueueElement>, std::greater<QueueElement> > todo; //smallest is at the top todo.push(std::make_pair(Scalar(), root)); @@ -230,10 +230,10 @@ typename Minimizer::Scalar BVMinimize(const BVH1 &tree1, const BVH2 &tree2, Mini typedef ei_minimizer_helper2<typename BVH2::Volume, typename BVH2::Object, typename BVH1::Object, Minimizer> Helper2; typedef std::pair<Scalar, std::pair<Index1, Index2> > QueueElement; //first element is priority - typename BVH1::VolumeIterator vBegin1, vEnd1; - typename BVH1::ObjectIterator oBegin1, oEnd1; - typename BVH2::VolumeIterator vBegin2, vEnd2, vCur2; - typename BVH2::ObjectIterator oBegin2, oEnd2, oCur2; + typename BVH1::VolumeIterator vBegin1, vEnd1 = 0; + typename BVH1::ObjectIterator oBegin1 = 0, oEnd1 = 0; + typename BVH2::VolumeIterator vBegin2, vEnd2 = 0, vCur2; + typename BVH2::ObjectIterator oBegin2 = 0, oEnd2 = 0, oCur2; std::priority_queue<QueueElement, std::vector<QueueElement>, std::greater<QueueElement> > todo; //smallest is at the top Scalar minimum = std::numeric_limits<Scalar>::max(); |