diff --git a/src/AdvApp2Var/AdvApp2Var_SysBase.cxx b/src/AdvApp2Var/AdvApp2Var_SysBase.cxx index 7f32dcb631..b6c74f532c 100644 --- a/src/AdvApp2Var/AdvApp2Var_SysBase.cxx +++ b/src/AdvApp2Var/AdvApp2Var_SysBase.cxx @@ -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; diff --git a/src/ApproxInt/ApproxInt_Approx.gxx b/src/ApproxInt/ApproxInt_Approx.gxx index b115781ca5..8af2bd753f 100644 --- a/src/ApproxInt/ApproxInt_Approx.gxx +++ b/src/ApproxInt/ApproxInt_Approx.gxx @@ -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); diff --git a/src/BinMDF/BinMDF_TagSourceDriver.cxx b/src/BinMDF/BinMDF_TagSourceDriver.cxx index ad444faa59..1215a49237 100644 --- a/src/BinMDF/BinMDF_TagSourceDriver.cxx +++ b/src/BinMDF/BinMDF_TagSourceDriver.cxx @@ -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); diff --git a/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx b/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx index e65923e342..e2ef76fe4c 100644 --- a/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_IntPackedMapDriver.cxx @@ -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) { diff --git a/src/BinMDataStd/BinMDataStd_IntegerDriver.cxx b/src/BinMDataStd/BinMDataStd_IntegerDriver.cxx index fe39951d9d..cc30275abf 100644 --- a/src/BinMDataStd/BinMDataStd_IntegerDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_IntegerDriver.cxx @@ -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); diff --git a/src/BinMDataStd/BinMDataStd_RealDriver.cxx b/src/BinMDataStd/BinMDataStd_RealDriver.cxx index 480f7dc482..1ded70a2e8 100644 --- a/src/BinMDataStd/BinMDataStd_RealDriver.cxx +++ b/src/BinMDataStd/BinMDataStd_RealDriver.cxx @@ -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); diff --git a/src/BinMDataXtd/BinMDataXtd_GeometryDriver.cxx b/src/BinMDataXtd/BinMDataXtd_GeometryDriver.cxx index 5144b187a6..cac2ab253d 100644 --- a/src/BinMDataXtd/BinMDataXtd_GeometryDriver.cxx +++ b/src/BinMDataXtd/BinMDataXtd_GeometryDriver.cxx @@ -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); diff --git a/src/BinMDataXtd/BinMDataXtd_PositionDriver.cxx b/src/BinMDataXtd/BinMDataXtd_PositionDriver.cxx index cf73dee135..777d2bb4d3 100644 --- a/src/BinMDataXtd/BinMDataXtd_PositionDriver.cxx +++ b/src/BinMDataXtd/BinMDataXtd_PositionDriver.cxx @@ -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.); diff --git a/src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx b/src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx index 732625a1ed..0d8099a9f7 100644 --- a/src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx +++ b/src/BinMDataXtd/BinMDataXtd_PresentationDriver.cxx @@ -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. ) diff --git a/src/BinMFunction/BinMFunction_FunctionDriver.cxx b/src/BinMFunction/BinMFunction_FunctionDriver.cxx index 6db923651a..d7703be2c5 100644 --- a/src/BinMFunction/BinMFunction_FunctionDriver.cxx +++ b/src/BinMFunction/BinMFunction_FunctionDriver.cxx @@ -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); diff --git a/src/BinMNaming/BinMNaming_NamedShapeDriver.cxx b/src/BinMNaming/BinMNaming_NamedShapeDriver.cxx index 1ee3e46d0b..00922457eb 100644 --- a/src/BinMNaming/BinMNaming_NamedShapeDriver.cxx +++ b/src/BinMNaming/BinMNaming_NamedShapeDriver.cxx @@ -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 diff --git a/src/BinMNaming/BinMNaming_NamingDriver.cxx b/src/BinMNaming/BinMNaming_NamingDriver.cxx index 8411cfe42a..ceb3a5659f 100644 --- a/src/BinMNaming/BinMNaming_NamingDriver.cxx +++ b/src/BinMNaming/BinMNaming_NamingDriver.cxx @@ -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) { diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_CentroidDriver.cxx b/src/BinMXCAFDoc/BinMXCAFDoc_CentroidDriver.cxx index 53fbb560a3..25056a9fcc 100644 --- a/src/BinMXCAFDoc/BinMXCAFDoc_CentroidDriver.cxx +++ b/src/BinMXCAFDoc/BinMXCAFDoc_CentroidDriver.cxx @@ -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); diff --git a/src/BinMXCAFDoc/BinMXCAFDoc_ColorDriver.cxx b/src/BinMXCAFDoc/BinMXCAFDoc_ColorDriver.cxx index b8ffbba0d0..b6a97a9307 100644 --- a/src/BinMXCAFDoc/BinMXCAFDoc_ColorDriver.cxx +++ b/src/BinMXCAFDoc/BinMXCAFDoc_ColorDriver.cxx @@ -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; diff --git a/src/ChFi2d/ChFi2d_FilletAlgo.hxx b/src/ChFi2d/ChFi2d_FilletAlgo.hxx index 042985dd30..ef63b4731a 100644 --- a/src/ChFi2d/ChFi2d_FilletAlgo.hxx +++ b/src/ChFi2d/ChFi2d_FilletAlgo.hxx @@ -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))) diff --git a/src/ChFi3d/ChFi3d_Builder_C1.cxx b/src/ChFi3d/ChFi3d_Builder_C1.cxx index da727d1a35..eaa2162e0d 100644 --- a/src/ChFi3d/ChFi3d_Builder_C1.cxx +++ b/src/ChFi3d/ChFi3d_Builder_C1.cxx @@ -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); diff --git a/src/ChFi3d/ChFi3d_ChBuilder.cxx b/src/ChFi3d/ChFi3d_ChBuilder.cxx index 078a647231..7beddbcf1f 100644 --- a/src/ChFi3d/ChFi3d_ChBuilder.cxx +++ b/src/ChFi3d/ChFi3d_ChBuilder.cxx @@ -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; diff --git a/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx b/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx index 3eca3e98d6..bfd05fb6d9 100644 --- a/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx +++ b/src/HLRAlgo/HLRAlgo_PolyInternalData.cxx @@ -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; diff --git a/src/IntPatch/IntPatch_LineConstructor.cxx b/src/IntPatch/IntPatch_LineConstructor.cxx index 4274665023..9c61cea66d 100644 --- a/src/IntPatch/IntPatch_LineConstructor.cxx +++ b/src/IntPatch/IntPatch_LineConstructor.cxx @@ -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)()); diff --git a/src/IntTools/IntTools_FaceFace.cxx b/src/IntTools/IntTools_FaceFace.cxx index 27f20299b2..928f32f157 100644 --- a/src/IntTools/IntTools_FaceFace.cxx +++ b/src/IntTools/IntTools_FaceFace.cxx @@ -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(); diff --git a/src/MeshVS/MeshVS_DataSource.cxx b/src/MeshVS/MeshVS_DataSource.cxx index 00badf3a98..565b5cf28e 100644 --- a/src/MeshVS/MeshVS_DataSource.cxx +++ b/src/MeshVS/MeshVS_DataSource.cxx @@ -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; diff --git a/src/MeshVS/MeshVS_MeshPrsBuilder.cxx b/src/MeshVS/MeshVS_MeshPrsBuilder.cxx index 1f0268cfd2..0bbf51fa5e 100644 --- a/src/MeshVS/MeshVS_MeshPrsBuilder.cxx +++ b/src/MeshVS/MeshVS_MeshPrsBuilder.cxx @@ -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; diff --git a/src/OSD/OSD_signal.cxx b/src/OSD/OSD_signal.cxx index 7da3f19004..cede27663e 100644 --- a/src/OSD/OSD_signal.cxx +++ b/src/OSD/OSD_signal.cxx @@ -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) { diff --git a/src/Standard/Standard_Dump.cxx b/src/Standard/Standard_Dump.cxx index af65c6c337..6b1a9ec8d6 100644 --- a/src/Standard/Standard_Dump.cxx +++ b/src/Standard/Standard_Dump.cxx @@ -230,10 +230,12 @@ TCollection_AsciiString Standard_Dump::GetPointerInfo (const void* thePointer, c std::ostringstream aPtrStr; aPtrStr << thePointer; - if (!isShortInfo) - return aPtrStr.str().c_str(); - TCollection_AsciiString anInfoPtr (aPtrStr.str().c_str()); + TCollection_AsciiString anInfoPtr(aPtrStr.str().c_str()); + + if (!isShortInfo) + return anInfoPtr; + 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()); } // =======================================================================