Skip to content

Commit

Permalink
Change 'a!=a' to std::isnan() to fix Sonar "bug", added infinity checks
Browse files Browse the repository at this point in the history
Signed-off-by: Christina Tempelaar-Lietz <[email protected]>
  • Loading branch information
xlietz committed Oct 8, 2019
1 parent bf1288d commit 2b64316
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions OpenEXR/IlmImfTest/testTiledCompression.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fillPixels4 (Array2D<unsigned int> &pi,
{
ph[y][x].setBits (rand.nexti());
}
while (ph[y][x].isNan());
while (ph[y][x].isNan() || ph[y][x].isInfinity());

union {int i; float f;} u;

Expand All @@ -154,7 +154,7 @@ fillPixels4 (Array2D<unsigned int> &pi,
u.i = rand.nexti();
pf[y][x] = u.f;
}
while (pf[y][x] != pf[y][x]);
while (isnan(pf[y][x]) || isinf(pf[y][x]));
}
}

Expand Down

0 comments on commit 2b64316

Please sign in to comment.