Part: LGTM: Multiplication result may overflow 'int' before it is converted to 'unsigned int'.

This commit is contained in:
wmayer
2022-05-11 10:03:53 +02:00
parent 132fdeade5
commit 8c984359dd

View File

@@ -4369,8 +4369,10 @@ unsigned int GeomBezierSurface::getMemSize (void) const
{
unsigned int size = sizeof(Geom_BezierSurface);
if (!mySurface.IsNull()) {
size += mySurface->NbUPoles() * mySurface->NbVPoles() * sizeof(gp_Pnt);
size += mySurface->NbUPoles() * mySurface->NbVPoles() * sizeof(Standard_Real);
unsigned int poles = mySurface->NbUPoles();
poles *= mySurface->NbVPoles();
size += poles * sizeof(gp_Pnt);
size += poles * sizeof(Standard_Real);
}
return size;
}
@@ -4448,8 +4450,10 @@ unsigned int GeomBSplineSurface::getMemSize (void) const
size += mySurface->NbUKnots() * sizeof(Standard_Integer);
size += mySurface->NbVKnots() * sizeof(Standard_Real);
size += mySurface->NbVKnots() * sizeof(Standard_Integer);
size += mySurface->NbUPoles() * mySurface->NbVPoles() * sizeof(gp_Pnt);
size += mySurface->NbUPoles() * mySurface->NbVPoles() * sizeof(Standard_Real);
unsigned int poles = mySurface->NbUPoles();
poles *= mySurface->NbVPoles();
size += poles * sizeof(gp_Pnt);
size += poles * sizeof(Standard_Real);
}
return size;
}