Skip to content

Commit

Permalink
Fix narrowing conversion error
Browse files Browse the repository at this point in the history
  • Loading branch information
tobre1 committed May 13, 2024
1 parent 5e526c1 commit 67dfefc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions include/viennaray/rayTraceKernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,12 @@ template <typename NumericType, int D> class rayTraceKernel {

const auto &ray = rayHit.ray;
std::array<rayInternal::rtcNumericType, 3> origin = {
ray.org_x + ray.dir_x * rndm, ray.org_y + ray.dir_y * rndm,
ray.org_z + ray.dir_z * rndm};
static_cast<rayInternal::rtcNumericType>(ray.org_x +
ray.dir_x * rndm),
static_cast<rayInternal::rtcNumericType>(ray.org_y +
ray.dir_y * rndm),
static_cast<rayInternal::rtcNumericType>(ray.org_z +
ray.dir_z * rndm)};

std::array<rayInternal::rtcNumericType, 3> direction{0, 0, 0};
for (int i = 0; i < D; ++i) {
Expand Down
4 changes: 2 additions & 2 deletions include/viennaray/rayUtil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ namespace rayInternal {
using rtcNumericType = float;

template <int D>
constexpr double DiskFactor = 0.5 * (D == 3 ? 1.7320508 : 1.41421356237) *
(1 + 1e-5);
constexpr double DiskFactor =
0.5 * (D == 3 ? 1.7320508 : 1.41421356237) * (1 + 1e-5);

/* ------------- Vector operation functions ------------- */
template <typename NumericType>
Expand Down

0 comments on commit 67dfefc

Please sign in to comment.