V1028 Possible overflow. Consider casting operands, not the result

This commit is contained in:
wmayer
2019-02-17 19:31:02 +01:00
parent f160cc7854
commit ffaf1c9b76
2 changed files with 14 additions and 7 deletions

View File

@@ -819,7 +819,9 @@ void BSplineParameterCorrection::Init()
void BSplineParameterCorrection::SetUKnots(const std::vector<double>& afKnots)
{
if (afKnots.size() != static_cast<std::size_t>(_usUCtrlpoints+_usUOrder))
std::size_t numPoints = static_cast<std::size_t>(_usUCtrlpoints);
std::size_t order = static_cast<std::size_t>(_usUOrder);
if (afKnots.size() != (numPoints + order))
return;
unsigned usUMax = _usUCtrlpoints-_usUOrder+1;
@@ -837,7 +839,9 @@ void BSplineParameterCorrection::SetUKnots(const std::vector<double>& afKnots)
void BSplineParameterCorrection::SetVKnots(const std::vector<double>& afKnots)
{
if (afKnots.size() != static_cast<std::size_t>(_usVCtrlpoints+_usVOrder))
std::size_t numPoints = static_cast<std::size_t>(_usVCtrlpoints);
std::size_t order = static_cast<std::size_t>(_usVOrder);
if (afKnots.size() != (numPoints + order))
return;
unsigned usVMax = _usVCtrlpoints-_usVOrder+1;