From ddab8d28b71f5eae61f7b1e30f706482776f3ea7 Mon Sep 17 00:00:00 2001 From: Juha Reunanen Date: Sat, 12 Nov 2022 20:20:21 +0200 Subject: [PATCH] Problem: warning C4244: 'initializing': conversion from 'double' to 'unsigned int', possible loss of data (#1312) Solution: add explicit typecasting Signed-off-by: Juha Reunanen Signed-off-by: Juha Reunanen --- src/lib/OpenEXR/ImfInputFile.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/lib/OpenEXR/ImfInputFile.cpp b/src/lib/OpenEXR/ImfInputFile.cpp index 04a450c637..848a5e25c3 100644 --- a/src/lib/OpenEXR/ImfInputFile.cpp +++ b/src/lib/OpenEXR/ImfInputFile.cpp @@ -352,12 +352,10 @@ bufferedReadPixels (InputFile::Data* ifd, int scanLine1, int scanLine2) switch ( toSlice.type) { - case UINT: - { - unsigned int fill = toSlice.fillValue; - for (int x = xStart; - x <= levelRange.max.x; - x += toSlice.xSampling) + case UINT: { + unsigned int fill = static_cast(toSlice.fillValue); + for (int x = xStart; x <= levelRange.max.x; + x += toSlice.xSampling) { * reinterpret_cast(toPtr) = fill; toPtr += toSlice.xStride;