From 2a970b304517179714965d370d3acc179aaca057 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sun, 12 Mar 2023 13:56:54 +0100 Subject: [PATCH] clang: fix -Wunused-but-set-variable --- .../libE57Format/src/CompressedVectorWriterImpl.cpp | 2 +- src/Mod/Drawing/App/FeatureViewAnnotation.cpp | 2 -- src/Mod/Mesh/App/Core/Simplify.h | 2 -- src/Mod/Mesh/App/Core/Triangulation.cpp | 4 +--- src/Mod/Part/App/edgecluster.cpp | 7 ------- src/Mod/Part/Gui/ViewProviderExt.cpp | 3 +++ src/Mod/PartDesign/Gui/TaskPipeParameters.cpp | 3 --- src/Mod/Path/libarea/Adaptive.cpp | 7 +++++++ src/Mod/Path/libarea/kurve/kurve.cpp | 1 + src/Mod/TechDraw/App/DrawGeomHatch.cpp | 4 ---- src/Mod/TechDraw/Gui/TaskLinkDim.cpp | 4 ++-- 11 files changed, 15 insertions(+), 24 deletions(-) diff --git a/src/3rdParty/libE57Format/src/CompressedVectorWriterImpl.cpp b/src/3rdParty/libE57Format/src/CompressedVectorWriterImpl.cpp index 7f5b30690e..c57da72d63 100644 --- a/src/3rdParty/libE57Format/src/CompressedVectorWriterImpl.cpp +++ b/src/3rdParty/libE57Format/src/CompressedVectorWriterImpl.cpp @@ -342,6 +342,7 @@ namespace e57 /// zero after write, if have too much data) } +#ifdef E57_MAX_VERBOSE ///??? useful? /// Get approximation of number of bytes per record of CompressedVector /// and total of bytes used @@ -351,7 +352,6 @@ namespace e57 totalBitsPerRecord += bytestream->bitsPerRecord(); } -#ifdef E57_MAX_VERBOSE const float totalBytesPerRecord = std::max( totalBitsPerRecord / 8, 0.1F ); //??? trust std::cout << " totalBytesPerRecord=" << totalBytesPerRecord << std::endl; //??? diff --git a/src/Mod/Drawing/App/FeatureViewAnnotation.cpp b/src/Mod/Drawing/App/FeatureViewAnnotation.cpp index ab57e25b21..a0e5095465 100644 --- a/src/Mod/Drawing/App/FeatureViewAnnotation.cpp +++ b/src/Mod/Drawing/App/FeatureViewAnnotation.cpp @@ -68,10 +68,8 @@ App::DocumentObjectExecReturn *FeatureViewAnnotation::execute(void) << " font-size=\"" << Scale.getValue() << "\"" << endl << " fill=\"#" << hr.str() << hg.str() << hb.str() << "\">" << endl; - int index=0; for (vector::const_iterator it = Text.getValues().begin(); it != Text.getValues().end(); ++it) { result << "" << it->c_str() << "" << endl; - index++; } result << "" << endl << "" << endl; diff --git a/src/Mod/Mesh/App/Core/Simplify.h b/src/Mod/Mesh/App/Core/Simplify.h index 05881fab7c..1be04ec744 100644 --- a/src/Mod/Mesh/App/Core/Simplify.h +++ b/src/Mod/Mesh/App/Core/Simplify.h @@ -264,7 +264,6 @@ bool Simplify::flipped(vec3f p, int i0, int i1, std::vector &deleted) { (void)i0; (void)v1; - int bordercount=0; for (int k=0;k2; ) { + for(int v=nv-1; nv>2; ) { /* if we loop, it is probably a non-simple polygon */ if (0 >= (count--)) { //** Triangulate: ERROR - probable bad polygon! @@ -449,8 +449,6 @@ bool EarClippingTriangulator::Triangulate::Process(const std::vector::iterator aVectorIt; for (aVectorIt = m_unsortededges.begin();aVectorIt != m_unsortededges.end();++aVectorIt) { if (IsValidEdge(*aVectorIt)) { Perform(*aVectorIt); - nbEdges++; - } - else - { - nbNonEdges++; } } diff --git a/src/Mod/Part/Gui/ViewProviderExt.cpp b/src/Mod/Part/Gui/ViewProviderExt.cpp index 3eff9506e2..c2953488d6 100644 --- a/src/Mod/Part/Gui/ViewProviderExt.cpp +++ b/src/Mod/Part/Gui/ViewProviderExt.cpp @@ -1275,9 +1275,12 @@ void ViewProviderPartExt::updateVisual() // printing some information Base::Console().Log("ViewProvider update time: %f s\n",Base::TimeInfo::diffTimeF(start_time,Base::TimeInfo())); Base::Console().Log("Shape tria info: Faces:%d Edges:%d Nodes:%d Triangles:%d IdxVec:%d\n",numFaces,numEdges,numNodes,numTriangles,numLines); +# else + (void)numEdges; # endif VisualTouched = false; } + void ViewProviderPartExt::forceUpdate(bool enable) { if(enable) { if(++forceUpdateCount == 1) { diff --git a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp index 57af563c61..9f9ec0028e 100644 --- a/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskPipeParameters.cpp @@ -482,7 +482,6 @@ bool TaskPipeParameters::accept() } std::vector subSets; - int index = 0; for (auto &subSet : pcPipe->Sections.getSubListValues()) { if (!pcActiveBody->hasObject(subSet.first) && !pcActiveBody->getOrigin()->hasObject(subSet.first)) { @@ -495,8 +494,6 @@ bool TaskPipeParameters::accept() else { subSets.push_back(subSet); } - - index++; } pcPipe->Sections.setSubListValues(subSets); diff --git a/src/Mod/Path/libarea/Adaptive.cpp b/src/Mod/Path/libarea/Adaptive.cpp index c1b1c486b3..0986a64d3a 100644 --- a/src/Mod/Path/libarea/Adaptive.cpp +++ b/src/Mod/Path/libarea/Adaptive.cpp @@ -3123,6 +3123,13 @@ void Adaptive2d::ProcessPolyNode(Paths boundPaths, Paths toolBoundPaths) << " iter_per_point:" << (double(total_iterations) / ((double(total_points) + 0.001))) << " total_exceeded:" << total_exceeded << " (" << 100 * double(total_exceeded) / double(total_points) << "%)" << endl; +#else + (void)total_output_points; + (void)over_cut_count; + (void)total_exceeded; + (void)total_points; + (void)total_iterations; + (void)perf_total_len; #endif // warn about invalid paths being detected diff --git a/src/Mod/Path/libarea/kurve/kurve.cpp b/src/Mod/Path/libarea/kurve/kurve.cpp index 21e8cfcab4..2cda6ce297 100644 --- a/src/Mod/Path/libarea/kurve/kurve.cpp +++ b/src/Mod/Path/libarea/kurve/kurve.cpp @@ -1214,6 +1214,7 @@ return; for(int j = 0; j < (int)p0.size(); j++) all.push_back(p0[j]); } + (void)totalPoints; //FILE* d; //d = fopen("\\temp\\test.txt", "w"); // for(int l = 0; l < all.size(); l++) all[l].print(d, "all","\n"); diff --git a/src/Mod/TechDraw/App/DrawGeomHatch.cpp b/src/Mod/TechDraw/App/DrawGeomHatch.cpp index 744a4c1b58..10ac1bf3c9 100644 --- a/src/Mod/TechDraw/App/DrawGeomHatch.cpp +++ b/src/Mod/TechDraw/App/DrawGeomHatch.cpp @@ -371,14 +371,12 @@ std::vector DrawGeomHatch::getTrimmedLines(DrawViewPart* source, } std::vector resultGeoms; - int i = 0; for (auto& e: resultEdges) { TechDraw::BaseGeomPtr base = BaseGeom::baseFactory(e); if (!base) { throw Base::ValueError("DGH::getTrimmedLines - baseFactory failed"); } resultGeoms.push_back(base); - i++; } ls.setEdges(resultEdges); ls.setGeoms(resultGeoms); @@ -531,14 +529,12 @@ std::vector DrawGeomHatch::getFaceOverlay(int fdx) PATLineSpec hl = ls.getPATLineSpec(); std::vector candidates = DrawGeomHatch::makeEdgeOverlay(hl, bBox, ScalePattern.getValue()); std::vector resultGeoms; - int i = 0; for (auto& e: candidates) { TechDraw::BaseGeomPtr base = BaseGeom::baseFactory(e); if (!base) { throw Base::ValueError("DGH::getFaceOverlay - baseFactory failed"); } resultGeoms.push_back(base); - i++; } ls.setEdges(candidates); ls.setGeoms(resultGeoms); diff --git a/src/Mod/TechDraw/Gui/TaskLinkDim.cpp b/src/Mod/TechDraw/Gui/TaskLinkDim.cpp index a176a0937e..7eeb6e4161 100644 --- a/src/Mod/TechDraw/Gui/TaskLinkDim.cpp +++ b/src/Mod/TechDraw/Gui/TaskLinkDim.cpp @@ -93,13 +93,13 @@ void TaskLinkDim::loadAvailDims() std::vector::iterator itView = pageViews.begin(); std::string result; int selRefType = TechDraw::DrawViewDimension::getRefTypeSubElements(m_subs); - int found = 0; + //int found = 0; for (; itView != pageViews.end(); itView++) { if ((*itView)->isDerivedFrom(TechDraw::DrawViewDimension::getClassTypeId())) { TechDraw::DrawViewDimension* dim = static_cast((*itView)); int dimRefType = dim->getRefType(); if (dimRefType == selRefType) { //potential matches - found++; + // found++; if (dim->has3DReferences()) { if (dimReferencesSelection(dim)) { loadToTree(dim, true, guiDoc);