Skip to content

Commit 04b3911

Browse files
committed
Fixed gcc warnings when casting to reference types
1 parent 1372ca0 commit 04b3911

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

kernels/bvh/bvh_builder_morton.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ namespace embree
5252
node->setBounds(i,b);
5353
}
5454

55-
BBox3fx result = (BBox3fx&)res;
55+
BBox3fx result = (BBox3fx)res;
5656
#if ROTATE_TREE
5757
if (N == 4)
5858
{
@@ -343,7 +343,7 @@ namespace embree
343343
new (&accel[i]) Object(geomID_,primID);
344344
}
345345

346-
BBox3fx box_o = (BBox3fx&)bounds;
346+
BBox3fx box_o = (BBox3fx)bounds;
347347
#if ROTATE_TREE
348348
if (N == 4)
349349
box_o.lower.a = current.size();
@@ -387,7 +387,7 @@ namespace embree
387387
new (&accel[i]) InstancePrimitive(instance, geomID_);
388388
}
389389

390-
BBox3fx box_o = (BBox3fx&)bounds;
390+
BBox3fx box_o = (BBox3fx)bounds;
391391
#if ROTATE_TREE
392392
if (N == 4)
393393
box_o.lower.a = current.size();
@@ -431,7 +431,7 @@ namespace embree
431431
new (&accel[i]) InstanceArrayPrimitive(geomID_, primID);
432432
}
433433

434-
BBox3fx box_o = (BBox3fx&)bounds;
434+
BBox3fx box_o = (BBox3fx)bounds;
435435
#if ROTATE_TREE
436436
if (N == 4)
437437
box_o.lower.a = current.size();

kernels/geometry/grid_soa.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@ namespace embree
5858
}
5959

6060
/*! returns reference to root */
61-
__forceinline BVH4::NodeRef& root(size_t t = 0) { return (BVH4::NodeRef&)data[rootOffset + t*sizeof(BVH4::NodeRef)]; }
62-
__forceinline const BVH4::NodeRef& root(size_t t = 0) const { return (BVH4::NodeRef&)data[rootOffset + t*sizeof(BVH4::NodeRef)]; }
61+
__forceinline BVH4::NodeRef& root(size_t t = 0) { return *(BVH4::NodeRef*)&data[rootOffset + t*sizeof(BVH4::NodeRef)]; }
62+
__forceinline const BVH4::NodeRef& root(size_t t = 0) const { return *(BVH4::NodeRef*)&data[rootOffset + t*sizeof(BVH4::NodeRef)]; }
6363

6464
/*! returns pointer to BVH array */
6565
__forceinline char* bvhData() { return &data[0]; }

0 commit comments

Comments
 (0)