Skip to content

Commit

Permalink
Problem: warning C4244: 'initializing': conversion from 'double' to '…
Browse files Browse the repository at this point in the history
…unsigned int', possible loss of data (AcademySoftwareFoundation#1312)

Solution: add explicit typecasting

Signed-off-by: Juha Reunanen <juha.reunanen@tomaattinen.com>

Signed-off-by: Juha Reunanen <juha.reunanen@tomaattinen.com>
  • Loading branch information
reunanen authored and cary-ilm committed Mar 2, 2023
1 parent 0f01bd2 commit c6de4cb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/lib/OpenEXR/ImfInputFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<unsigned int>(toSlice.fillValue);
for (int x = xStart; x <= levelRange.max.x;
x += toSlice.xSampling)
{
* reinterpret_cast<unsigned int*>(toPtr) = fill;
toPtr += toSlice.xStride;
Expand Down

0 comments on commit c6de4cb

Please sign in to comment.