]> OCCT Git - occt.git/commitdiff
Fixed errors CR33033
authoraln <alukin@opencascade.com>
Wed, 29 Jun 2022 21:22:19 +0000 (00:22 +0300)
committeraln <alukin@opencascade.com>
Wed, 29 Jun 2022 21:22:19 +0000 (00:22 +0300)
24 files changed:
src/AdvApp2Var/AdvApp2Var_SysBase.cxx
src/ApproxInt/ApproxInt_Approx.gxx
src/BinMDF/BinMDF_TagSourceDriver.cxx
src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx
src/BinMDataStd/BinMDataStd_IntegerDriver.cxx
src/BinMDataStd/BinMDataStd_RealDriver.cxx
src/BinMDataXtd/BinMDataXtd_GeometryDriver.cxx
src/BinMDataXtd/BinMDataXtd_PositionDriver.cxx
src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx
src/BinMFunction/BinMFunction_FunctionDriver.cxx
src/BinMNaming/BinMNaming_NamedShapeDriver.cxx
src/BinMNaming/BinMNaming_NamingDriver.cxx
src/BinMXCAFDoc/BinMXCAFDoc_CentroidDriver.cxx
src/BinMXCAFDoc/BinMXCAFDoc_ColorDriver.cxx
src/ChFi2d/ChFi2d_FilletAlgo.hxx
src/ChFi3d/ChFi3d_Builder_C1.cxx
src/ChFi3d/ChFi3d_ChBuilder.cxx
src/HLRAlgo/HLRAlgo_PolyInternalData.cxx
src/IntPatch/IntPatch_LineConstructor.cxx
src/IntTools/IntTools_FaceFace.cxx
src/MeshVS/MeshVS_DataSource.cxx
src/MeshVS/MeshVS_MeshPrsBuilder.cxx
src/OSD/OSD_signal.cxx
src/Standard/Standard_Dump.cxx

index 7f32dcb631058946e8b6086c89102371f743049c..b6c74f532c55b68b0112e08432720d76277918c3 100644 (file)
@@ -1948,7 +1948,7 @@ int mcrcomm_(integer *kop,
   /* Local variables */
   intptr_t ideb;
   doublereal dtab[32000];
-  intptr_t itab[160]   /* was [4][40] */;
+  intptr_t itab[160] = {0}     /* was [4][40] */;
   intptr_t ipre;
   integer i__, j, k;
   
@@ -2522,7 +2522,7 @@ int AdvApp2Var_SysBase::mcrlist_(integer *ier) const
   
   /* Local variables */
   char cfmt[1];
-  doublereal dfmt;
+  doublereal dfmt = 0.0; // unused
   integer ifmt, i__, nufmt, ntotal;
   char subrou[7];
   
@@ -2667,7 +2667,7 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
   integer i__1, i__2;
 
   /* Local variables */
-  doublereal dfmt;
+  doublereal dfmt = 0.0; // unused
   integer ifmt, iver;
   char subr[7];
   integer ksys , ibyte, irest, ier;
index b115781ca5b3f76e558f88673cabcc39a7a0088d..8af2bd753faad86fa2a534d70b0e1193ffa98ad3 100644 (file)
@@ -77,7 +77,8 @@ static void ComputeTrsf2d(const Handle(TheWLine)& theline,
   for(Standard_Integer i=1; i<=aNbPnts; i++)
   {
     const IntSurf_PntOn2S POn2S = theline->Point(i);
-    Standard_Real  U,V;
+    Standard_Real U = 0.0;
+    Standard_Real V = 0.0;
     (POn2S.*pfunc)(U,V);
     aUmin = Min(U, aUmin);
     aVmin = Min(V, aVmin);
index ad444faa59f20760398d2f476634b657f3907534..1215a49237a5ad7d147fe6fcb84e453313573b92 100644 (file)
@@ -51,7 +51,7 @@ Standard_Boolean BinMDF_TagSourceDriver::Paste
                                  BinObjMgt_RRelocationTable&  ) const
 {
   Handle(TDF_TagSource) aTag = Handle(TDF_TagSource)::DownCast(theTarget);
-  Standard_Integer aValue;
+  const Standard_Integer aValue = -1;
   Standard_Boolean ok = theSource >> aValue;
   if (ok)
     aTag->Set(aValue);
index e65923e342398ba1cd3e213f7d038fe6489652e3..e2ef76fe4c352056eeefbba0f3d80b190f844cb6 100644 (file)
@@ -73,7 +73,7 @@ Standard_Boolean BinMDataStd_IntPackedMapDriver::Paste
   }
   if(aSize) {
     Handle(TColStd_HPackedMapOfInteger) aHMap = new TColStd_HPackedMapOfInteger ();
-    Standard_Integer aKey;
+    const Standard_Integer aKey = -1;
     for(Standard_Integer i = 0; i< aSize; i++) {
       Standard_Boolean ok = Source >> aKey;
       if (!ok) {
index fe39951d9d510cd9c66094075876e3c331204f1e..cc30275abf0f749d14f4524260235098cd2df1c3 100644 (file)
@@ -54,7 +54,7 @@ Standard_Boolean BinMDataStd_IntegerDriver::Paste
                                  BinObjMgt_RRelocationTable&  theRT) const
 {
   Handle(TDataStd_Integer) anAtt = Handle(TDataStd_Integer)::DownCast(theTarget);
-  Standard_Integer aValue;
+  const Standard_Integer aValue = -1;
   Standard_Boolean ok = theSource >> aValue;
   if (ok)
     anAtt->Set(aValue);
index 480f7dc4826fd536e102bf6d85e3e9fe77c9a022..1ded70a2e843bc4caa0014411a1b35969bc3cb0c 100644 (file)
@@ -54,7 +54,7 @@ Standard_Boolean BinMDataStd_RealDriver::Paste
                                  BinObjMgt_RRelocationTable&  theRelocTable) const
 {
   Handle(TDataStd_Real) anAtt= Handle(TDataStd_Real)::DownCast(theTarget);
-  Standard_Real aValue;
+  Standard_Real aValue = -1.0;
   Standard_Boolean ok = theSource >> aValue;
   if (ok)
     anAtt->Set(aValue);
index 5144b187a6637754da3ad8ca59ccd0ee7205e4c4..cac2ab253d9dde4f24635475d9632fac54b6f69c 100644 (file)
@@ -54,7 +54,7 @@ Standard_Boolean BinMDataXtd_GeometryDriver::Paste
   Handle(TDataXtd_Geometry) aT = 
     Handle(TDataXtd_Geometry)::DownCast (theTarget);
 
-  Standard_Integer aType;
+  const Standard_Integer aType = -1;
   Standard_Boolean ok = theSource >> aType;
   if (ok)
     aT->SetType ((TDataXtd_GeometryEnum) aType);
index cf73dee135c84a3fff62b56d27f11e2c6d64883f..777d2bb4d356d7b7a131d3adccbbbf776add0818 100644 (file)
@@ -55,7 +55,7 @@ Standard_Boolean BinMDataXtd_PositionDriver::Paste
                                  BinObjMgt_RRelocationTable&  ) const
 {
   Handle(TDataXtd_Position) anAtt = Handle(TDataXtd_Position)::DownCast(theTarget);
-  Standard_Real aValue;
+  Standard_Real aValue = 0.0;
   Standard_Boolean ok = theSource >> aValue;
   if (!ok) return ok;
   gp_Pnt aPosition(0., 0., 0.);
index 732625a1ed3143d6d02204ce4fcc38caae5755d0..0d8099a9f79c2faa226e8e9403c2a58a5475a391 100644 (file)
@@ -56,7 +56,7 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste
   Handle(TDataXtd_Presentation) anAttribute = Handle(TDataXtd_Presentation)::DownCast(theTarget);
 
   // Display status
-  Standard_Integer aValue;
+  const Standard_Integer aValue = -1;
   ok = theSource >> aValue;
   if (!ok) return ok;
   anAttribute->SetDisplayed (aValue != 0);
@@ -92,7 +92,7 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste
     anAttribute->UnsetMaterial();
 
   // Transparency
-  Standard_Real aRValue;
+  Standard_Real aRValue = -1.0;
   ok = theSource >> aRValue;
   if ( !ok ) return ok;
   if ( aRValue != -1. )
index 6db923651a08b6b8f5c57f2be2bb9e9f49dfebad..d7703be2c5a54db723cfa74f4d7c9ba106079357 100644 (file)
@@ -62,7 +62,7 @@ Standard_Boolean BinMFunction_FunctionDriver::Paste
   Standard_Boolean ok = theSource >> aGUID;
   if (ok) {
     anAtt->SetDriverGUID(aGUID);  
-    Standard_Integer aValue;
+    const Standard_Integer aValue = -1;
     ok = theSource >> aValue;
     if(ok)
       anAtt->SetFailure(aValue); 
index 1ee3e46d0b92ea1682cfc80554b9a9fae4fc88b8..00922457ebfee441696df9104e053b3e698c69e3 100644 (file)
@@ -117,8 +117,9 @@ static int TranslateFrom  (const BinObjMgt_Persistent&  theSource,
                          TopoDS_Shape&                  theResult,
                          BinTools_ShapeSet*            theShapeSet)
 {
-  Standard_Integer aShapeID, aLocID;
-  Standard_Character aCharOrient;
+  const Standard_Integer aShapeID = -1;
+  const Standard_Integer aLocID = -1;
+  const Standard_Character aCharOrient = '0';
   Standard_Boolean Ok = theSource >> aShapeID; //TShapeID;
   if(!Ok) return 1;
   // Read TShape and Orientation
@@ -176,11 +177,11 @@ Standard_Boolean BinMNaming_NamedShapeDriver::Paste
   theSource >> aNbShapes;
   TDF_Label aLabel = theTarget->Label ();
   TNaming_Builder aBuilder (aLabel);
-  Standard_Integer aVer;
+  const Standard_Integer aVer = -1;
   Standard_Boolean ok = theSource >> aVer;
   if(!ok) return Standard_False;
   aTAtt->SetVersion(aVer); //Version
-  Standard_Character aCharEvol;
+  const Standard_Character aCharEvol = '0';
   ok = theSource >> aCharEvol;
   if(!ok) return Standard_False;
   TNaming_Evolution anEvol  = EvolutionToEnum (aCharEvol); //Evolution
index 8411cfe42a0a8905e182b2de92b8370611f695cd..ceb3a5659f2e6d8be4170f9979cca1695cb0b6da 100644 (file)
@@ -152,7 +152,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
   TNaming_Name& aName = anAtt->ChangeName();
   TCollection_ExtendedString aMsg;
 //1. NameType
-  Standard_Character aValue;
+  const Standard_Character aValue = '0';
   Standard_Boolean ok = theSource >> aValue;
   Standard_Boolean aNewF = Standard_False;
   if (ok) {
@@ -171,7 +171,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
       
 //3. Args
       Standard_Integer aNbArgs=0;
-      Standard_Integer anIndx;
+      const Standard_Integer anIndx = -1;
       Handle(TNaming_NamedShape) aNS;
       ok = theSource >> aNbArgs;
       if (ok) {
index 53fbb560a3fd5c9ce72aba94c626ecf3596175c7..25056a9fccb1fa09f80747c023bea35b93a17a3d 100644 (file)
@@ -48,7 +48,9 @@ Standard_Boolean BinMXCAFDoc_CentroidDriver::Paste(const BinObjMgt_Persistent& t
                                                   BinObjMgt_RRelocationTable& /*theRelocTable*/) const
 {
   Handle(XCAFDoc_Centroid) anAtt = Handle(XCAFDoc_Centroid)::DownCast(theTarget);
-  Standard_Real x, y, z;
+  Standard_Real x = 0.0;
+  Standard_Real y = 0.0;
+  Standard_Real z = 0.0;
   Standard_Boolean isOk = theSource >> x >> y >> z;
   if(isOk) {
     gp_Pnt aPnt(x, y, z);
index b8ffbba0d0716d9c315839ba5fcb8cf1a86f87be..b6a97a9307991e6803d69e40d34a48c1928d8c15 100644 (file)
@@ -48,8 +48,10 @@ Standard_Boolean BinMXCAFDoc_ColorDriver::Paste(const BinObjMgt_Persistent& theS
                                                BinObjMgt_RRelocationTable& /*theRelocTable*/) const 
 {
   Handle(XCAFDoc_Color) anAtt = Handle(XCAFDoc_Color)::DownCast(theTarget);
-  Standard_Real R, G, B;
-  Standard_ShortReal alpha;
+  Standard_Real R = 0.0;
+  Standard_Real G = 0.0;
+  Standard_Real B = 0.0;
+  Standard_ShortReal alpha = 1.0;
   Standard_Boolean isOk = theSource >> R >> G >> B;
   if(isOk) {
     Standard_Boolean isRGBA = theSource >> alpha;
index 042985dd30268b18d6a1d724643799ac30df8ae6..ef63b4731adffe2cc53322f6e7f75ea8dbfd50f1 100644 (file)
@@ -198,7 +198,7 @@ public:
   Standard_Real LowerValue() 
   {
     Standard_Integer a, aResultIndex = 0;
-    Standard_Real aValue;
+    Standard_Real aValue = 0.0;
     for(a = myV.Length(); a > 0; a--) 
     {
       if (aResultIndex == 0 || Abs(aValue) > Abs(myV.Value(a))) 
index da727d1a35efa006d647c9c995d6a9791ad64e2a..eaa2162e0de8063f7e93ff1746e100660423376d 100644 (file)
@@ -3915,7 +3915,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
     }
     TopoDS_Face FFv;
     Standard_Real tol;
-    Standard_Integer prol;
+    Standard_Integer prol = 0;
     BRep_Builder BRE;
     Handle(Geom_Surface ) Sface;
     Sface=BRep_Tool::Surface(Fv);
index 078a6472317f727b96239f6c5cb998b0fc758c46..7beddbcf1f5f94fa46c0129ccac3445d4264bced 100644 (file)
@@ -1780,7 +1780,7 @@ void ChFi3d_ChBuilder::ExtentTwoCorner(const TopoDS_Vertex&        V,
   Standard_Integer Sens = 0;
   ChFiDS_ListIteratorOfListOfStripe itel(LS);
   Standard_Boolean FF = Standard_True;
-  Standard_Boolean isfirst[2];
+  Standard_Boolean isfirst[2] = { Standard_True, Standard_True };
   Standard_Integer Iedge[2];
   Iedge[0] = 1;
   Iedge[1] = 1;
index 3eca3e98d6f8fbd5237c2a0b08d3cef9a73888e6..bfd05fb6d9be4d43ba9c3a1b5fa2a6924e14ead7 100644 (file)
@@ -420,7 +420,8 @@ HLRAlgo_PolyInternalData::UpdateLinks (const Standard_Integer ip1,
     aSegIndices2->Conex2 = cnx2;
     aNodIndices3.NdSg   = find;
 
-    Standard_Integer iOld,iNew,iTr,skip,ip4,itpk[2];
+    Standard_Integer iOld,iNew,iTr,skip,ip4;
+       Standard_Integer itpk[2] = { -1, -1 };
     Standard_Integer n1,n2,n3,nOld[3],nNew[3],New[4];
     New[0] = cnx1;
     New[2] = myNbTData + 1;
index 42746650231488d809d2bc0a1d1a50ce75d3e7c7..9c61cea66d44a143dc99ec0e78386f519384037f 100644 (file)
@@ -999,7 +999,8 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref,
       }
 
       // resolve arcs for vertices not having a link to an arc
-      Standard_Real utst,vtst;
+      Standard_Real utst = 0.0;
+         Standard_Real vtst = 0.0;
       TColStd_Array1OfReal paramsResolved(1,nbvtx);
       TColStd_Array1OfTransient arcsResolved(1,nbvtx);
       arcsResolved.Init(Handle(Adaptor2d_Curve2d)());
index 27f20299b24f2f977bfa854f9b75be0f8542426e..928f32f15776d6e8cf710fa860976446e025587c 100644 (file)
@@ -2335,7 +2335,7 @@ Standard_Boolean ClassifyLin2d(const Handle(GeomAdaptor_Surface)& theS,
 
 {
   Standard_Real xmin, xmax, ymin, ymax, d1, d2, A, B, C;
-  Standard_Real par[2];
+  Standard_Real par[2] = { 0.0, 0.0 };
   Standard_Integer nbi = 0;
 
   xmin = theS->FirstUParameter();
index 00badf3a98c6d1a4e1e660b33f5a8b9ee75a1507..565b5cf28e712c174ef5b18b8d8a32fa868a88b1 100644 (file)
@@ -318,7 +318,7 @@ Bnd_Box MeshVS_DataSource::GetBoundingBox() const
   const TColStd_PackedMapOfInteger& aNodes = GetAllNodes();
   if( aNodes.Extent() )
   {
-    Standard_Real aCoordsBuf[ 3 ];
+    const Standard_Real aCoordsBuf[3] = { 0.0, 0.0, 0.0 };
     TColStd_Array1OfReal aCoords (*aCoordsBuf, 1, 3);
     Standard_Integer nbNodes;
     MeshVS_EntityType aType;
index 1f0268cfd2b210170dc8bfe7b5b0d04ac51decea..0bbf51fa5e66d855ecea125dfd6883f211674083 100644 (file)
@@ -108,7 +108,7 @@ void MeshVS_MeshPrsBuilder::BuildNodes ( const Handle(Prs3d_Presentation)& Prs,
   Standard_Boolean HasSelectFlag = ( ( DisplayMode & MeshVS_DMF_SelectionPrs ) != 0 );
   Standard_Boolean HasHilightFlag = ( ( DisplayMode & MeshVS_DMF_HilightPrs ) != 0 );
 
-  Standard_Real aCoordsBuf[ 3 ];
+  const Standard_Real aCoordsBuf[3] = { 0.0, 0.0, 0.0 };
   TColStd_Array1OfReal aCoords( *aCoordsBuf, 1, 3 );
   Standard_Integer NbNodes;
   MeshVS_EntityType aType;
index 7da3f19004c1886e44590905327f2c79d5ee2e77..cede27663e556258dc919da773c55bda0f1b2304 100644 (file)
@@ -294,7 +294,7 @@ static LONG CallHandler (DWORD theExceptionCode,
    && theExceptionCode != EXCEPTION_NONCONTINUABLE_EXCEPTION)
   {
     MessageBeep (MB_ICONHAND);
-    char aMsgBoxBuffer[2048];
+    char aMsgBoxBuffer[2048] = { '\0' };
     strcat_s (aMsgBoxBuffer, sizeof(aMsgBoxBuffer), aBuffer);
     if (aStackBuffer != NULL)
     {
index af65c6c3379e17259ca481c8b058f364421eb6b3..6b1a9ec8d6add74803b760cfeb688640113f2305 100644 (file)
@@ -230,10 +230,12 @@ TCollection_AsciiString Standard_Dump::GetPointerInfo (const void* thePointer, c
 
   std::ostringstream aPtrStr;
   aPtrStr << thePointer;
+
+  TCollection_AsciiString anInfoPtr(aPtrStr.str().c_str());
+
   if (!isShortInfo)
-    return aPtrStr.str().c_str();
+    return anInfoPtr;
 
-  TCollection_AsciiString anInfoPtr (aPtrStr.str().c_str());
   for (int aSymbolId = 1; aSymbolId < anInfoPtr.Length(); aSymbolId++)
   {
     if (anInfoPtr.Value(aSymbolId) != '0')
@@ -243,7 +245,7 @@ TCollection_AsciiString Standard_Dump::GetPointerInfo (const void* thePointer, c
       return anInfoPtr;
     }
   }
-  return aPtrStr.str().c_str();
+  return TCollection_AsciiString(aPtrStr.str().c_str());
 }
 
 // =======================================================================