FreeCAD: Compiler warning fixes

This commit is contained in:
Chris Hennes
2025-03-12 23:16:43 -05:00
committed by Kacper Donat
parent b170b8e27c
commit 21c07cabc5
15 changed files with 32 additions and 24 deletions

View File

@@ -48,7 +48,7 @@ static void print_curve(const CCurve& c)
#if defined SIZEOF_SIZE_T && SIZEOF_SIZE_T == 4
printf("number of vertices = %d\n", nvertices);
#elif defined(_WIN32)
printf("number of vertices = %Iu\n", nvertices);
printf("number of vertices = %zu\n", nvertices);
#else
printf("number of vertices = %lu\n", nvertices);
#endif

View File

@@ -1485,7 +1485,7 @@ void readResults(std::ifstream& ifstr,
std::vector<double> scaValues;
std::vector<int> nodes;
int countNodes = 0;
int countScaPos;
size_t countScaPos;
// result block could have both vector/matrix and scalar components
// save each scalars entity in his own array
auto scalarPos = identifyScalarEntities(entityTypes);
@@ -1542,7 +1542,7 @@ void readResults(std::ifstream& ifstr,
}
}
}
catch (const std::out_of_range& ex) {
catch (const std::out_of_range&) {
Base::Console().Warning("Invalid node: %d\n", node);
}
++countNodes;

View File

@@ -194,7 +194,7 @@ unsigned long MeshKernel::AddFacets(const std::vector<MeshFacet>& rclFAry, bool
{
// Build map of edges of the referencing facets we want to append
#ifdef FC_DEBUG
unsigned long countPoints = CountPoints();
[[maybe_unused]] unsigned long countPoints = CountPoints();
#endif
// if the manifold check shouldn't be done then just add all faces

View File

@@ -2300,7 +2300,7 @@ void PropertySheet::getLinksTo(std::vector<App::ObjectIdentifier>& identifiers,
const auto [docObj, depsList] = *it;
for (auto& [depName, paths] : depsList) {
if (!subname) {
identifiers.emplace_back(owner, cellName.toString().c_str());
identifiers.emplace_back(owner, cellName.toString());
break;
}
if (std::any_of(paths.begin(),
@@ -2314,7 +2314,7 @@ void PropertySheet::getLinksTo(std::vector<App::ObjectIdentifier>& identifiers,
return (sobjT.getSubObject() == subObject
&& sobjT.getOldElementName() == subElement);
})) {
identifiers.emplace_back(owner, cellName.toString().c_str());
identifiers.emplace_back(owner, cellName.toString());
}
}
}

View File

@@ -1715,7 +1715,7 @@ TopoDS_Face GeometryUtils::makePerforatedFace(FacePtr bigCheese, const std::vec
try {
faceShape = Part::FaceMakerCheese::makeFace(cheeseIngredients);
}
catch (const Standard_Failure &e) {
catch (const Standard_Failure&) {
Base::Console().Warning("Area - could not make holes in face\n");
return flippedFace;
}

View File

@@ -744,6 +744,8 @@ long int TechDraw::mapGeometryTypeToDimType(long int dimType, DimensionGeometry
return DrawViewDimension::Angle;
case DimensionGeometry::isAngle3Pt:
return DrawViewDimension::Angle3Pt;
default:
break; // For all other cases, return dimType
}
} else if (geometry2d != DimensionGeometry::isViewReference) {
switch (geometry2d) {
@@ -757,6 +759,8 @@ long int TechDraw::mapGeometryTypeToDimType(long int dimType, DimensionGeometry
return DrawViewDimension::Angle;
case DimensionGeometry::isAngle3Pt:
return DrawViewDimension::Angle3Pt;
default:
break; // For all other cases, return dimType
}
}
return dimType;