From 67dfefc65a989310fe8ec7799a5577be72638827 Mon Sep 17 00:00:00 2001 From: Tobias Reiter Date: Mon, 13 May 2024 16:13:35 -0400 Subject: [PATCH] Fix narrowing conversion error --- include/viennaray/rayTraceKernel.hpp | 8 ++++++-- include/viennaray/rayUtil.hpp | 4 ++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/viennaray/rayTraceKernel.hpp b/include/viennaray/rayTraceKernel.hpp index 2b00a76..0515724 100644 --- a/include/viennaray/rayTraceKernel.hpp +++ b/include/viennaray/rayTraceKernel.hpp @@ -176,8 +176,12 @@ template class rayTraceKernel { const auto &ray = rayHit.ray; std::array origin = { - ray.org_x + ray.dir_x * rndm, ray.org_y + ray.dir_y * rndm, - ray.org_z + ray.dir_z * rndm}; + static_cast(ray.org_x + + ray.dir_x * rndm), + static_cast(ray.org_y + + ray.dir_y * rndm), + static_cast(ray.org_z + + ray.dir_z * rndm)}; std::array direction{0, 0, 0}; for (int i = 0; i < D; ++i) { diff --git a/include/viennaray/rayUtil.hpp b/include/viennaray/rayUtil.hpp index 176db60..f1b0713 100644 --- a/include/viennaray/rayUtil.hpp +++ b/include/viennaray/rayUtil.hpp @@ -81,8 +81,8 @@ namespace rayInternal { using rtcNumericType = float; template -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