CAM: Fix multiplication result converted to larger type

This commit is contained in:
Chris Hennes
2025-07-21 22:03:14 -05:00
parent 35122b0e92
commit 764542078f
2 changed files with 3 additions and 2 deletions

View File

@@ -748,7 +748,7 @@ cSimTool::cSimTool(const TopoDS_Shape& toolShape, float res)
for (int x = 0; x < radValue; x++) {
// find the face of the tool by checking z points across the
// radius to see if the point is inside the shape
pnt.x = x * res;
pnt.x = static_cast<double>(x) * res;
bool inside = isInside(toolShape, pnt, res);
// move down until the point is outside the shape

View File

@@ -55,7 +55,8 @@ TextureLoader::TextureLoader(std::string imgFolder,
int textureSize)
: mImageFolder(imgFolder)
{
int buffsize = textureSize * textureSize * sizeof(unsigned int);
size_t buffsize =
static_cast<size_t>(textureSize) * static_cast<size_t>(textureSize) * sizeof(unsigned int);
mRawData = (unsigned int*)malloc(buffsize);
if (mRawData == nullptr) {
return;