Skip to content

Commit

Permalink
BUG: -1 was being returned in a function that returns bool
Browse files Browse the repository at this point in the history
Found by cppcheck.

The nearby comment occurs elsewhere in the codebase, and there it was changed to `return false` so I did the same here.
  • Loading branch information
seanm committed Jan 8, 2025
1 parent dbb5005 commit db0990b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkHexahedronCell.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ HexahedronCell<TCellInterface>::EvaluatePosition(CoordinateType * x,
else if ((itk::Math::abs(pcoords[0]) > ITK_DIVERGED) || (itk::Math::abs(pcoords[1]) > ITK_DIVERGED) ||
(itk::Math::abs(pcoords[2]) > ITK_DIVERGED))
{
return -1;
return false;
}

// if not converged, repeat
Expand Down
2 changes: 1 addition & 1 deletion Modules/Core/Common/include/itkQuadrilateralCell.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ QuadrilateralCell<TCellInterface>::EvaluatePosition(CoordinateType * x,
// Test for bad divergence (S.Hirschberg 11.12.2001)
else if ((itk::Math::abs(pcoords[0]) > ITK_DIVERGED) || (itk::Math::abs(pcoords[1]) > ITK_DIVERGED))
{
return -1;
return false;
}

// if not converged, repeat
Expand Down

0 comments on commit db0990b

Please sign in to comment.