File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11
22#include " BoundingSphere.h"
3+ #include < cstring>
34#include " omp.h"
45
56template <typename HullType> void
@@ -127,8 +128,10 @@ KDTree<HullType>::traverse_breadth_first_parallel(TraversalPredicate pred,
127128#endif
128129
129130 // compute ceiling of Log2
130- Real d = maxThreads - 1 ;
131- const unsigned int targetDepth = (*reinterpret_cast <long long *>(&d) >> 52 ) - 1022 ;
131+ // assuming double and long long have the same size.
132+ double d = maxThreads - 1 ;
133+ long long ll; memcpy ( &ll, &d, sizeof (d));
134+ const unsigned int targetDepth = (ll >> 52 ) - 1022ll ;
132135
133136 traverse_breadth_first (
134137 [&start_nodes, &maxThreads, &targetDepth](unsigned int node_index, unsigned int depth)
@@ -207,4 +210,4 @@ KDTree<HullType>::update()
207210 compute_hull_approx (nd.begin , nd.n , m_hulls[node_index]);
208211 }
209212 );
210- }
213+ }
You can’t perform that action at this time.
0 commit comments