]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Get rid of compilation warnings. Part III. Eliminate rest of warnings.
authorArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Sun, 17 May 2020 19:09:12 +0000 (22:09 +0300)
committerArtem Zhidkov <Artem.Zhidkov@opencascade.com>
Sun, 17 May 2020 19:09:12 +0000 (22:09 +0300)
src/Config/Config_Keywords.h
src/Config/Config_PropManager.cpp
src/Config/Config_ValidatorMessage.h
src/Config/Config_def.h
src/GeomAPI/GeomAPI_Solid.cpp
src/GeomAlgoAPI/GeomAlgoAPI_CurveBuilder.cpp
src/PartSet/PartSet_OverconstraintListener.cpp
src/PartSet/PartSet_SketcherMgr.h
src/PartSet/PartSet_Tools.cpp
src/Selector/Selector_Algo.cpp
src/SketcherPrs/SketcherPrs_Tools.cpp

index bbba6b2d7ae16ec84a41ab717943ae6e5bec2399..5be23a997a8cb03ab9d4c04c8b75030c191fa77e 100644 (file)
 #ifndef CONFIG_KEYWORDS_H_
 #define CONFIG_KEYWORDS_H_
 
-#if defined __GNUC__ || defined __clang__
-#define MAYBE_UNUSED __attribute__((unused))
-#else
-#define MAYBE_UNUSED
-#endif
+#include <Config_def.h>
 
 /*
  * Hardcoded xml entities of plugin-*.xml
index a88a4024aa2c5dcc0884d78c6d85d7715468489e..af3f1f55ea6e17b26b1bee7c29fbb43b67d924e9 100644 (file)
@@ -209,7 +209,7 @@ double Config_PropManager::stringToDouble(const std::string& theDouble)
   // change locale and convert "," to "." if exists
   std::string aCurLocale = setlocale(LC_NUMERIC, 0);
   setlocale(LC_NUMERIC, "C");
-  int dotpos = (int)aStr.find(',');
+  size_t dotpos = aStr.find(',');
   if (dotpos != std::string::npos)
     aStr.replace(dotpos, 1, ".");
 
index 85c27726af6f45d7cfa3c1076a3c63ef7de50f53..5a640c0264a7e6eff85e8890239cb3c0def115b4 100644 (file)
@@ -27,7 +27,7 @@
 #include <string>
 
 /// Event ID that Validator is loaded (comes with Config_ValidatorMessage)
-static const char * EVENT_VALIDATOR_LOADED = "ValidatorLoaded";
+MAYBE_UNUSED static const char * EVENT_VALIDATOR_LOADED = "ValidatorLoaded";
 
 /*!
  * \class Config_ValidatorMessage
index 0bd02fccd9a4ac98a4f36999ceb92785e4dca5a0..60105dbc93ad5970cbf30c55a6edb13b60338847 100644 (file)
 #endif
 #endif
 
+#if defined __GNUC__ || defined __clang__
+#define MAYBE_UNUSED __attribute__((unused))
+#else
+#define MAYBE_UNUSED
+#endif
+
 #endif //CONFIG_H
index 9fb6d44fddcee97ded92129b24eb83bcfda51b92..ade9c845c8ae0053f9628a299362a9a0d98928f3 100644 (file)
@@ -174,7 +174,6 @@ std::shared_ptr<GeomAPI_Cone> GeomAPI_Solid::getCone() const
   GeomPointPtr anApex;
   GeomDirPtr anAxis;
   double aSemiAngle = 0.0;
-  double aHeight = 0.0;
 
   GeomPlanePtr aCaps[2];
 
@@ -205,7 +204,6 @@ std::shared_ptr<GeomAPI_Cone> GeomAPI_Solid::getCone() const
         else
           anAxis = aCurCone->axis();
         aSemiAngle = aCurCone->semiAngle();
-        aHeight = aCurCone->height();
         isCone = true;
       }
     }
index cb223a83200dd5b5df67d52619946f7434359b7d..ad1850a08f8966cdeea5a27a084a31003bb3938a 100644 (file)
@@ -115,8 +115,8 @@ void reorder(Handle(TColgp_HArray1OfPnt)& thePoints)
     }
     if (aNearest > 0 && aNearest != i + 1) {
       // Keep given order of points to use it in case of equidistant candidates
-      //               .-<---<-.
-      //              /         \
+      //              .--<---<--.
+      //             |           |
       // o  o  o  c  o->o->o->o->n  o  o
       //          |  |           |
       //          i i+1       nearest
index b83637655b3bc934f60ca1f132a2f15b94a42765..2dd82dbc5e83bd48ee0329c4054e71ca4a284b2b 100644 (file)
@@ -109,8 +109,7 @@ void PartSet_OverconstraintListener::getCustomColor(const ObjectPtr& theObject,
   }
 }
 
-void PartSet_OverconstraintListener::processEvent(
-                                                 const std::shared_ptr<Events_Message>& theMessage)
+void PartSet_OverconstraintListener::processEvent(const std::shared_ptr<Events_Message>& theMessage)
 {
   // #2271 open document: if sketch has confilcting elements, solver sends message with the
   // elements by opening the document. Sketch is not active, but an internal container should
@@ -145,13 +144,12 @@ void PartSet_OverconstraintListener::processEvent(
       anEventID == Events_Loop::eventByName(EVENT_SOLVER_REPAIRED)) {
     std::shared_ptr<ModelAPI_SolverFailedMessage> anErrorMsg =
                    std::dynamic_pointer_cast<ModelAPI_SolverFailedMessage>(theMessage);
-    bool anUpdated = false;
     if (anErrorMsg.get()) {
       const std::set<ObjectPtr>& aConflictingObjects = anErrorMsg->objects();
       if (anEventID == Events_Loop::eventByName(EVENT_SOLVER_FAILED))
-        anUpdated = appendConflictingObjects(aConflictingObjects);
+        appendConflictingObjects(aConflictingObjects);
       else
-        anUpdated = repairConflictingObjects(aConflictingObjects);
+        repairConflictingObjects(aConflictingObjects);
     }
   }
   else if (anEventID == Events_Loop::eventByName(EVENT_SKETCH_UNDER_CONSTRAINED) ||
index 3720834188614fa417fd3ab6e03c42a0de302a26..1384483aef9a09676c37819d9e27eaad55b2b77d 100644 (file)
@@ -83,6 +83,8 @@ public:
   PartSet_Fitter(PartSet_SketcherMgr* theSketchMgr):
     mySketchMgr(theSketchMgr) {}
 
+  virtual ~PartSet_Fitter() {}
+
   /// A method which has top be reimplemented to provide alterantive implementation FitAll command
   /// \param theView - a view which has to be fit
   virtual void fitAll(Handle(V3d_View) theView);
index 4934187cd2886af1b3fcfddf0ac77ea429a75006..fc615f4d1e00a6b55014ab567973208d652ac182 100644 (file)
@@ -733,7 +733,6 @@ void PartSet_Tools::sendSubFeaturesEvent(const CompositeFeaturePtr& theComposite
   if (!theComposite.get())
     return;
 
-  static Events_Loop* aLoop = Events_Loop::loop();
   int aNumberOfSubs = theComposite->numberOfSubs();
   for (int i = 0; i < aNumberOfSubs; i++) {
     FeaturePtr aSubFeature = theComposite->subFeature(i);
index a21be5fa5dac83eb8cb6cc3e33aa24765bf4b2d8..ef53c7dcb4de8355c836a768636b30eee869c3d3 100644 (file)
@@ -502,13 +502,15 @@ bool Selector_Algo::findNewVersion(const TopoDS_Shape& theContext, TopoDS_Shape&
         TopoDS_Shape aNextModification = aBaseIter.Shape();
         if (aNextModification.IsNull())
           continue;
-        if (isInContext(theContext, aNextModification))
+        if (isInContext(theContext, aNextModification)) {
           // don't add vertices generated from edges
           if (aNextModification.ShapeType() <= theResult.ShapeType())
             aResultShapes.Add(aNextModification);
-        else if (findNewVersion(theContext, aNextModification))
+        }
+        else if (findNewVersion(theContext, aNextModification)) {
           if (aNextModification.ShapeType() <= theResult.ShapeType())
             aResultShapes.Add(aNextModification);
+        }
       }
     }
     if (aResultShapes.IsEmpty())
index 156e1265954e78e745b83ebd8b2c4cb8f8c02db8..d535a6d7f362c3d27f2d5db3d7a40a5d8996f273 100644 (file)
@@ -222,11 +222,12 @@ std::list<ResultPtr> getFreePoints(const CompositeFeaturePtr& theSketch)
       bool aIsFree = true;
       for(int aKind = 0; aIsFree && aKind < 2; aKind++) { // 0 for feature, 1 for result
         ObjectPtr aReferenced = aCurrent;
-        if (aKind == 1)
+        if (aKind == 1) {
           if (!aCurrent->results().empty())
             aReferenced = aCurrent->firstResult();
           else
             break;
+        }
         const std::set<AttributePtr>& aRefs = aReferenced->data()->refsToMe();
         std::set<AttributePtr>::iterator aRIt = aRefs.begin();
         for (; aRIt != aRefs.end(); ++aRIt) {