From: Artem Zhidkov Date: Tue, 12 May 2020 06:06:12 +0000 (+0300) Subject: Fix obvious warnings X-Git-Tag: V9_5_0b1~18 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cc80560fbb3093d61eae4cda0d7ce35337490b8e;p=modules%2Fshaper.git Fix obvious warnings --- diff --git a/src/CollectionPlugin/CollectionPlugin_Group.cpp b/src/CollectionPlugin/CollectionPlugin_Group.cpp index 4252a1f80..2a083360e 100644 --- a/src/CollectionPlugin/CollectionPlugin_Group.cpp +++ b/src/CollectionPlugin/CollectionPlugin_Group.cpp @@ -137,7 +137,7 @@ bool CollectionPlugin_Group::customAction(const std::string& theActionId) } aFathers[anAttr->contextObject()] = anObj; if (aFatherGroup.find(anObj) == aFatherGroup.end()) { - int aSize = aFatherGroup.size(); + int aSize = (int)aFatherGroup.size(); aFatherGroup[anObj] = aSize; // the first is zero } } diff --git a/src/Config/Config_XMLReader.cpp b/src/Config/Config_XMLReader.cpp index d6691f998..8f15e0f25 100644 --- a/src/Config/Config_XMLReader.cpp +++ b/src/Config/Config_XMLReader.cpp @@ -161,7 +161,7 @@ std::string Config_XMLReader::findConfigFile(const std::string theFileName, cons void Config_XMLReader::readAll() { if (isFromMemory) { - myXmlDoc = xmlParseMemory(myRootFileName.c_str(), myRootFileName.length()); + myXmlDoc = xmlParseMemory(myRootFileName.c_str(), (int)myRootFileName.length()); xmlNodePtr aRoot = xmlDocGetRootElement(myXmlDoc); readRecursively(aRoot); return; diff --git a/src/FeaturesAPI/FeaturesAPI_MultiRotation.cpp b/src/FeaturesAPI/FeaturesAPI_MultiRotation.cpp index 2263fda4a..86558686c 100644 --- a/src/FeaturesAPI/FeaturesAPI_MultiRotation.cpp +++ b/src/FeaturesAPI/FeaturesAPI_MultiRotation.cpp @@ -161,7 +161,7 @@ MultiRotationPtr addMultiRotation(const std::shared_ptr& theP aStepValAsStr << aStepVal; ModelHighAPI_Integer aNumber = aStepStr == aStepValAsStr.str() - ? ModelHighAPI_Integer(aStepVal) + ? ModelHighAPI_Integer((int)aStepVal) : ModelHighAPI_Integer(aStepStr); aResult.reset(new FeaturesAPI_MultiRotation(aFeature, theMainObjects, theAxis, aNumber)); } diff --git a/src/GeomAlgoAPI/GeomAlgoAPI.i b/src/GeomAlgoAPI/GeomAlgoAPI.i index fc09e5669..04a925704 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI.i +++ b/src/GeomAlgoAPI/GeomAlgoAPI.i @@ -71,6 +71,7 @@ %include "GeomAlgoAPI_MakeShapeCustom.h" %include "GeomAlgoAPI_MakeShapeList.h" %include "GeomAlgoAPI_MakeSweep.h" +%include "GeomAlgoAPI_Transform.h" %include "GeomAlgoAPI_Translation.h" %include "GeomAlgoAPI_Placement.h" %include "GeomAlgoAPI_PointBuilder.h" @@ -86,7 +87,6 @@ %include "GeomAlgoAPI_IGESImport.h" %include "GeomAlgoAPI_STEPImport.h" %include "GeomAlgoAPI_Tools.h" -%include "GeomAlgoAPI_Transform.h" %include "GeomAlgoAPI_PaveFiller.h" %include "GeomAlgoAPI_Intersection.h" %include "GeomAlgoAPI_Pipe.h" diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h index 5b4d9edff..145abb5d6 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_ShapeAPI.h @@ -28,6 +28,10 @@ #include +#ifdef WIN32 +#pragma warning(disable : 4290) +#endif + namespace GeomAlgoAPI_ShapeAPI { /**\class GeomAlgoAPI_ShapeAPI diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_swig.h b/src/GeomAlgoAPI/GeomAlgoAPI_swig.h index c40d9211f..f35a402f0 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_swig.h +++ b/src/GeomAlgoAPI/GeomAlgoAPI_swig.h @@ -34,6 +34,7 @@ #include "GeomAlgoAPI_MakeShapeCustom.h" #include "GeomAlgoAPI_MakeShapeList.h" #include "GeomAlgoAPI_MakeSweep.h" + #include "GeomAlgoAPI_Transform.h" #include "GeomAlgoAPI_Translation.h" #include "GeomAlgoAPI_Placement.h" #include "GeomAlgoAPI_PointBuilder.h" @@ -49,7 +50,6 @@ #include "GeomAlgoAPI_IGESImport.h" #include "GeomAlgoAPI_STEPImport.h" #include "GeomAlgoAPI_Tools.h" - #include "GeomAlgoAPI_Transform.h" #include "GeomAlgoAPI_PaveFiller.h" #include "GeomAlgoAPI_Intersection.h" #include "GeomAlgoAPI_Pipe.h" diff --git a/src/ModelAPI/ModelAPI.i b/src/ModelAPI/ModelAPI.i index ca786a2a6..de2ef3085 100644 --- a/src/ModelAPI/ModelAPI.i +++ b/src/ModelAPI/ModelAPI.i @@ -97,7 +97,6 @@ %shared_ptr(ModelAPI_ResultField) %shared_ptr(ModelAPI_ResultParameter) %shared_ptr(ModelAPI_ResultCompSolid) -%shared_ptr(ModelAPI_ObjectUpdatedMessage) %typecheck(SWIG_TYPECHECK_POINTER) const ModelAPI_AttributeTables::Value { $1 = (PyFloat_Check($input) || PyLong_Check($input) || PyUnicode_Check($input) || PyBool_Check($input)) ? 1 : 0; diff --git a/src/ModuleBase/ModuleBase_ResultPrs.cpp b/src/ModuleBase/ModuleBase_ResultPrs.cpp index d6ad4c336..7d15974a3 100644 --- a/src/ModuleBase/ModuleBase_ResultPrs.cpp +++ b/src/ModuleBase/ModuleBase_ResultPrs.cpp @@ -413,7 +413,7 @@ void ModuleBase_ResultPrs::ComputeSelection(const Handle(SelectMgr_Selection)& a Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value(); Handle(SelectBasics_EntityOwner) aBasicsOwner = anEntity->BaseSensitive()->OwnerId(); if (!aBasicsOwner.IsNull()) - aBasicsOwner->Set(aBasicsOwner->Priority() + myAdditionalSelectionPriority); + aBasicsOwner->SetPriority(aBasicsOwner->Priority() + myAdditionalSelectionPriority); } } } @@ -441,10 +441,8 @@ bool ModuleBase_ResultPrs::appendVertexSelection(const Handle(SelectMgr_Selectio anIt.More(); anIt.Next()) { Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value(); - Handle(SelectMgr_EntityOwner) anOwner = - Handle(SelectMgr_EntityOwner) - ::DownCast(anEntity->BaseSensitive()->OwnerId()); - anOwner->Set(this); + Handle(SelectMgr_EntityOwner) anOwner = anEntity->BaseSensitive()->OwnerId(); + anOwner->SetSelectable(this); } return true; diff --git a/src/PartSet/PartSet_FieldStepPrs.cpp b/src/PartSet/PartSet_FieldStepPrs.cpp index eb28e2872..4d3ed48ee 100644 --- a/src/PartSet/PartSet_FieldStepPrs.cpp +++ b/src/PartSet/PartSet_FieldStepPrs.cpp @@ -38,6 +38,7 @@ #include #include #include +#include IMPLEMENT_STANDARD_RTTIEXT(PartSet_FieldStepPrs, ViewerData_AISShape); @@ -221,8 +222,6 @@ void PartSet_FieldStepPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t TopoDS_Shape aShape = aShapePtr->impl(); gp_Pnt aCenter; if (computeMassCenter(aShape, aCenter)) { - Graphic3d_Vertex aVertex(aCenter.X(), aCenter.Y(), aCenter.Z()); - Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d(); anAspectText3d->SetStyle(Aspect_TOST_ANNOTATION); anAspectText3d->SetColor(aLabelColor); @@ -230,7 +229,10 @@ void PartSet_FieldStepPrs::Compute(const Handle(PrsMgr_PresentationManager3d)& t int aT = aResMgr->integerValue("Viewer", "scalar_bar_text_height", 14); QString aString = aValues.at(i); - aGroup->Text(aString.toUtf8().constData(), aVertex, aT); + Handle(Graphic3d_Text) aText = new Graphic3d_Text(aT); + aText->SetText(aString.toUtf8().constData()); + aText->SetPosition(aCenter); + aGroup->AddText(aText); } } } diff --git a/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp b/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp index 2d8f18c9c..1d19616fb 100644 --- a/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp +++ b/src/SketcherPrs/SketcherPrs_SensitivePoint.cpp @@ -60,8 +60,7 @@ Standard_Boolean SketcherPrs_SensitivePoint::Matches(SelectBasics_SelectingVolum gp_Pnt SketcherPrs_SensitivePoint::Point() const { - const Handle(SelectMgr_EntityOwner)& anOwner = - Handle(SelectMgr_EntityOwner)::DownCast(OwnerId()); + const Handle(SelectMgr_EntityOwner)& anOwner = OwnerId(); const Handle(SketcherPrs_SymbolPrs)& aSymbPrs = Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable()); return aSymbPrs->pointsArray()->Vertice(myId); @@ -76,8 +75,7 @@ Handle(Select3D_SensitiveEntity) SketcherPrs_SensitivePoint::GetConnected() gp_Pnt SketcherPrs_SensitivePoint::CenterOfGeometry() const { #ifdef DEBUG_SENSITIVE_TO_BE_CORRECTED - const Handle(SelectMgr_EntityOwner)& anOwner = - Handle(SelectMgr_EntityOwner)::DownCast(OwnerId()); + const Handle(SelectMgr_EntityOwner)& anOwner = OwnerId(); const Handle(SketcherPrs_SymbolPrs)& aSymbPrs = Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable()); if (aSymbPrs->pointsArray()->VertexNumber() < myId) @@ -89,8 +87,7 @@ gp_Pnt SketcherPrs_SensitivePoint::CenterOfGeometry() const Select3D_BndBox3d SketcherPrs_SensitivePoint::BoundingBox() { #ifdef DEBUG_SENSITIVE_TO_BE_CORRECTED - const Handle(SelectMgr_EntityOwner)& anOwner = - Handle(SelectMgr_EntityOwner)::DownCast(OwnerId()); + const Handle(SelectMgr_EntityOwner)& anOwner = OwnerId(); const Handle(SketcherPrs_SymbolPrs)& aSymbPrs = Handle(SketcherPrs_SymbolPrs)::DownCast(anOwner->Selectable()); if (aSymbPrs->pointsArray()->VertexNumber() < myId) diff --git a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp index b35b7acfa..465633f92 100644 --- a/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp +++ b/src/SketcherPrs/SketcherPrs_SymbolPrs.cpp @@ -185,7 +185,8 @@ Handle(Image_AlienPixMap) SketcherPrs_SymbolPrs::icon() aSizedMap->InitTrash(aPixMap->Format(), aWidth, aHeigh); for (Standard_Size i = 0; i < aWidth; i++) { for (Standard_Size j = 0; j < aHeigh; j++) { - aSizedMap->SetPixelColor(int(i), int(j), aPixMap->PixelColor(i / aRatio, j / aRatio)); + aSizedMap->SetPixelColor(int(i), int(j), + aPixMap->PixelColor(int(i / aRatio), int(j / aRatio))); } } aPixMap = aSizedMap; diff --git a/src/XAO/XAO_BooleanStep.cxx b/src/XAO/XAO_BooleanStep.cxx index d32680ec1..46b75ae69 100644 --- a/src/XAO/XAO_BooleanStep.cxx +++ b/src/XAO/XAO_BooleanStep.cxx @@ -116,7 +116,7 @@ void BooleanStep::setElement(const int& element, const std::vector& elemen throw (XAO_Exception) { checkElementIndex(element); - checkNbComponents(elements.size()); + checkNbComponents((int)elements.size()); for (int i = 0; i < m_nbComponents; ++i) m_values[element][i] = elements[i]; @@ -126,7 +126,7 @@ void BooleanStep::setComponent(const int& component, const std::vector& co throw (XAO_Exception) { checkComponentIndex(component); - checkNbElements(components.size()); + checkNbElements((int)components.size()); for (int i = 0; i < m_nbElements; ++i) m_values[i][component] = components[i]; diff --git a/src/XAO/XAO_DoubleStep.cxx b/src/XAO/XAO_DoubleStep.cxx index d3205efba..787155320 100644 --- a/src/XAO/XAO_DoubleStep.cxx +++ b/src/XAO/XAO_DoubleStep.cxx @@ -101,7 +101,7 @@ throw (XAO_Exception) void DoubleStep::setValues(const std::vector& values) throw (XAO_Exception) { - checkNbValues(values.size()); + checkNbValues((int)values.size()); for (int i = 0; i < m_nbElements; ++i) { @@ -116,7 +116,7 @@ void DoubleStep::setElement(const int& element, const std::vector& eleme throw (XAO_Exception) { checkElementIndex(element); - checkNbComponents(elements.size()); + checkNbComponents((int)elements.size()); for (int i = 0; i < m_nbComponents; ++i) m_values[element][i] = elements[i]; @@ -126,7 +126,7 @@ void DoubleStep::setComponent(const int& component, const std::vector& c throw (XAO_Exception) { checkElementIndex(component); - checkNbElements(components.size()); + checkNbElements((int)components.size()); for (int i = 0; i < m_nbElements; ++i) m_values[i][component] = components[i]; diff --git a/src/XAO/XAO_DoubleStep.hxx b/src/XAO/XAO_DoubleStep.hxx index a193598a1..18cb9c073 100644 --- a/src/XAO/XAO_DoubleStep.hxx +++ b/src/XAO/XAO_DoubleStep.hxx @@ -28,6 +28,7 @@ #include "XAO_Step.hxx" #ifdef WIN32 +#pragma warning(disable:4251) // std::vector needs dll-interface #pragma warning(disable:4290) // Warning Exception ... #endif diff --git a/src/XAO/XAO_Exception.hxx b/src/XAO/XAO_Exception.hxx index f926660fe..3c99bb7a5 100644 --- a/src/XAO/XAO_Exception.hxx +++ b/src/XAO/XAO_Exception.hxx @@ -24,6 +24,10 @@ #include "XAO.hxx" #include +#ifdef WIN32 +#pragma warning(disable : 4275) // for std::exception +#endif + namespace XAO { /** diff --git a/src/XAO/XAO_Field.hxx b/src/XAO/XAO_Field.hxx index 0446d5694..22cd0ae09 100644 --- a/src/XAO/XAO_Field.hxx +++ b/src/XAO/XAO_Field.hxx @@ -139,7 +139,7 @@ namespace XAO * Gets the number of the steps. * @return the number of steps. */ - const int countSteps() const { return m_steps.size(); } + const int countSteps() const { return (int)m_steps.size(); } /** * Gets the name of a component. diff --git a/src/XAO/XAO_Group.hxx b/src/XAO/XAO_Group.hxx index 92ca7596b..c0279d2d6 100644 --- a/src/XAO/XAO_Group.hxx +++ b/src/XAO/XAO_Group.hxx @@ -93,7 +93,7 @@ namespace XAO */ const int count() const { - return m_elements.size(); + return (int)m_elements.size(); } /** diff --git a/src/XAO/XAO_IntegerStep.cxx b/src/XAO/XAO_IntegerStep.cxx index 81e2ed53d..67a377034 100644 --- a/src/XAO/XAO_IntegerStep.cxx +++ b/src/XAO/XAO_IntegerStep.cxx @@ -101,7 +101,7 @@ throw (XAO_Exception) void IntegerStep::setValues(const std::vector& values) throw (XAO_Exception) { - checkNbValues(values.size()); + checkNbValues((int)values.size()); for (int i = 0; i < m_nbElements; ++i) { @@ -116,7 +116,7 @@ void IntegerStep::setElement(const int& element, const std::vector& element throw (XAO_Exception) { checkElementIndex(element); - checkNbComponents(elements.size()); + checkNbComponents((int)elements.size()); for (int i = 0; i < m_nbComponents; ++i) m_values[element][i] = elements[i]; @@ -126,7 +126,7 @@ void IntegerStep::setComponent(const int& component, const std::vector& com throw (XAO_Exception) { checkElementIndex(component); - checkNbElements(components.size()); + checkNbElements((int)components.size()); for (int i = 0; i < m_nbElements; ++i) m_values[i][component] = components[i]; diff --git a/src/XAO/XAO_StringStep.cxx b/src/XAO/XAO_StringStep.cxx index 545f493ce..e1a5915ce 100644 --- a/src/XAO/XAO_StringStep.cxx +++ b/src/XAO/XAO_StringStep.cxx @@ -100,7 +100,7 @@ throw (XAO_Exception) void StringStep::setValues(const std::vector& values) throw (XAO_Exception) { - checkNbValues(values.size()); + checkNbValues((int)values.size()); for (int i = 0; i < m_nbElements; ++i) { @@ -115,7 +115,7 @@ void StringStep::setElement(const int& element, const std::vector& throw (XAO_Exception) { checkElementIndex(element); - checkNbComponents(elements.size()); + checkNbComponents((int)elements.size()); for (int i = 0; i < m_nbComponents; ++i) m_values[element][i] = elements[i]; @@ -125,7 +125,7 @@ void StringStep::setComponent(const int& component, const std::vectorgetShapeString(); - xmlNodePtr cdata = xmlNewCDataBlock(doc, BAD_CAST txtShape.c_str(), txtShape.size()); + xmlNodePtr cdata = xmlNewCDataBlock(doc, BAD_CAST txtShape.c_str(), (int)txtShape.size()); xmlAddChild(shape, cdata); } else diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 052bdcdf9..30a297eeb 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -1099,7 +1099,7 @@ void XGUI_Displayer::AddOrRemoveSelectedShapes(Handle(AIS_InteractiveContext) th /// OCCT: to write about the problem that active owners method returns one owner several times QList aSelectedIds; // Remember of selected address in order to avoid duplicates for (; anOwnersIt.More(); anOwnersIt.Next()) { - anOwner = Handle(SelectMgr_EntityOwner)::DownCast (anOwnersIt.Value()); + anOwner = anOwnersIt.Value(); if (aSelectedIds.contains((size_t)anOwner.get())) continue; aSelectedIds.append((size_t)anOwner.get()); diff --git a/src/XGUI/XGUI_MenuGroup.h b/src/XGUI/XGUI_MenuGroup.h index 47459b189..b498a4cca 100644 --- a/src/XGUI/XGUI_MenuGroup.h +++ b/src/XGUI/XGUI_MenuGroup.h @@ -26,6 +26,10 @@ #include #include +#ifdef WIN32 +#pragma warning(disable : 4251) // std::string needs dll-interface +#endif + class Config_FeatureMessage; /** diff --git a/src/XGUI/XGUI_MenuWorkbench.h b/src/XGUI/XGUI_MenuWorkbench.h index 1ed20741b..fdb902398 100644 --- a/src/XGUI/XGUI_MenuWorkbench.h +++ b/src/XGUI/XGUI_MenuWorkbench.h @@ -26,6 +26,10 @@ #include #include +#ifdef WIN32 +#pragma warning(disable : 4251) // std::string needs dll-interface +#endif + class XGUI_MenuGroup; /** diff --git a/src/XGUI/XGUI_Selection.cpp b/src/XGUI/XGUI_Selection.cpp index 800140a52..6f86809b2 100644 --- a/src/XGUI/XGUI_Selection.cpp +++ b/src/XGUI/XGUI_Selection.cpp @@ -453,8 +453,7 @@ void XGUI_Selection::entityOwners(const Handle(AIS_InteractiveObject)& theObject Handle(SelectMgr_SensitiveEntity) anEntity = anIt.Value(); if (anEntity.IsNull()) continue; - Handle(SelectMgr_EntityOwner) anOwner = - Handle(SelectMgr_EntityOwner)::DownCast(anEntity->BaseSensitive()->OwnerId()); + Handle(SelectMgr_EntityOwner) anOwner = anEntity->BaseSensitive()->OwnerId(); if (!anOwner.IsNull()) theOwners.Add(anOwner); } diff --git a/src/XGUI/XGUI_SelectionActivate.cpp b/src/XGUI/XGUI_SelectionActivate.cpp index 111656625..6b3547f8d 100644 --- a/src/XGUI/XGUI_SelectionActivate.cpp +++ b/src/XGUI/XGUI_SelectionActivate.cpp @@ -446,7 +446,7 @@ bool XGUI_SelectionActivate::activate(const Handle(AIS_InteractiveObject)& theIO // loading the interactive object allowing the decomposition if (aTColModes.IsEmpty() || !aHasValidMode) { - aContext->Load(theIO, -1, true); + aContext->Load(theIO); Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(theIO); if (!aTrihedron.IsNull()) { // Workaround for Trihedron. It should be loaded using the next Load method to diff --git a/src/XGUI/XGUI_SelectionMgr.cpp b/src/XGUI/XGUI_SelectionMgr.cpp index d7bebf728..d10d87c0f 100644 --- a/src/XGUI/XGUI_SelectionMgr.cpp +++ b/src/XGUI/XGUI_SelectionMgr.cpp @@ -173,7 +173,7 @@ void XGUI_SelectionMgr::deselectPresentation(const Handle(AIS_InteractiveObject) NCollection_List::Iterator anOwnersIt (aResultOwners); Handle(SelectMgr_EntityOwner) anOwner; for (; anOwnersIt.More(); anOwnersIt.Next()) { - anOwner = Handle(SelectMgr_EntityOwner)::DownCast(anOwnersIt.Value()); + anOwner = anOwnersIt.Value(); if (!anOwner.IsNull()) aContext->AddOrRemoveSelected(anOwner, false); }