1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

Fixed errors

This commit is contained in:
aln
2022-06-30 00:22:19 +03:00
parent 835f8451ac
commit a28be1eb2a
24 changed files with 45 additions and 35 deletions

View File

@@ -1948,7 +1948,7 @@ int mcrcomm_(integer *kop,
/* Local variables */ /* Local variables */
intptr_t ideb; intptr_t ideb;
doublereal dtab[32000]; doublereal dtab[32000];
intptr_t itab[160] /* was [4][40] */; intptr_t itab[160] = {0} /* was [4][40] */;
intptr_t ipre; intptr_t ipre;
integer i__, j, k; integer i__, j, k;
@@ -2522,7 +2522,7 @@ int AdvApp2Var_SysBase::mcrlist_(integer *ier) const
/* Local variables */ /* Local variables */
char cfmt[1]; char cfmt[1];
doublereal dfmt; doublereal dfmt = 0.0; // unused
integer ifmt, i__, nufmt, ntotal; integer ifmt, i__, nufmt, ntotal;
char subrou[7]; char subrou[7];
@@ -2667,7 +2667,7 @@ int AdvApp2Var_SysBase::mcrrqst_(integer *iunit,
integer i__1, i__2; integer i__1, i__2;
/* Local variables */ /* Local variables */
doublereal dfmt; doublereal dfmt = 0.0; // unused
integer ifmt, iver; integer ifmt, iver;
char subr[7]; char subr[7];
integer ksys , ibyte, irest, ier; integer ksys , ibyte, irest, ier;

View File

@@ -77,7 +77,8 @@ static void ComputeTrsf2d(const Handle(TheWLine)& theline,
for(Standard_Integer i=1; i<=aNbPnts; i++) for(Standard_Integer i=1; i<=aNbPnts; i++)
{ {
const IntSurf_PntOn2S POn2S = theline->Point(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); (POn2S.*pfunc)(U,V);
aUmin = Min(U, aUmin); aUmin = Min(U, aUmin);
aVmin = Min(V, aVmin); aVmin = Min(V, aVmin);

View File

@@ -51,7 +51,7 @@ Standard_Boolean BinMDF_TagSourceDriver::Paste
BinObjMgt_RRelocationTable& ) const BinObjMgt_RRelocationTable& ) const
{ {
Handle(TDF_TagSource) aTag = Handle(TDF_TagSource)::DownCast(theTarget); Handle(TDF_TagSource) aTag = Handle(TDF_TagSource)::DownCast(theTarget);
Standard_Integer aValue; const Standard_Integer aValue = -1;
Standard_Boolean ok = theSource >> aValue; Standard_Boolean ok = theSource >> aValue;
if (ok) if (ok)
aTag->Set(aValue); aTag->Set(aValue);

View File

@@ -73,7 +73,7 @@ Standard_Boolean BinMDataStd_IntPackedMapDriver::Paste
} }
if(aSize) { if(aSize) {
Handle(TColStd_HPackedMapOfInteger) aHMap = new TColStd_HPackedMapOfInteger (); Handle(TColStd_HPackedMapOfInteger) aHMap = new TColStd_HPackedMapOfInteger ();
Standard_Integer aKey; const Standard_Integer aKey = -1;
for(Standard_Integer i = 0; i< aSize; i++) { for(Standard_Integer i = 0; i< aSize; i++) {
Standard_Boolean ok = Source >> aKey; Standard_Boolean ok = Source >> aKey;
if (!ok) { if (!ok) {

View File

@@ -54,7 +54,7 @@ Standard_Boolean BinMDataStd_IntegerDriver::Paste
BinObjMgt_RRelocationTable& theRT) const BinObjMgt_RRelocationTable& theRT) const
{ {
Handle(TDataStd_Integer) anAtt = Handle(TDataStd_Integer)::DownCast(theTarget); Handle(TDataStd_Integer) anAtt = Handle(TDataStd_Integer)::DownCast(theTarget);
Standard_Integer aValue; const Standard_Integer aValue = -1;
Standard_Boolean ok = theSource >> aValue; Standard_Boolean ok = theSource >> aValue;
if (ok) if (ok)
anAtt->Set(aValue); anAtt->Set(aValue);

View File

@@ -54,7 +54,7 @@ Standard_Boolean BinMDataStd_RealDriver::Paste
BinObjMgt_RRelocationTable& theRelocTable) const BinObjMgt_RRelocationTable& theRelocTable) const
{ {
Handle(TDataStd_Real) anAtt= Handle(TDataStd_Real)::DownCast(theTarget); Handle(TDataStd_Real) anAtt= Handle(TDataStd_Real)::DownCast(theTarget);
Standard_Real aValue; Standard_Real aValue = -1.0;
Standard_Boolean ok = theSource >> aValue; Standard_Boolean ok = theSource >> aValue;
if (ok) if (ok)
anAtt->Set(aValue); anAtt->Set(aValue);

View File

@@ -54,7 +54,7 @@ Standard_Boolean BinMDataXtd_GeometryDriver::Paste
Handle(TDataXtd_Geometry) aT = Handle(TDataXtd_Geometry) aT =
Handle(TDataXtd_Geometry)::DownCast (theTarget); Handle(TDataXtd_Geometry)::DownCast (theTarget);
Standard_Integer aType; const Standard_Integer aType = -1;
Standard_Boolean ok = theSource >> aType; Standard_Boolean ok = theSource >> aType;
if (ok) if (ok)
aT->SetType ((TDataXtd_GeometryEnum) aType); aT->SetType ((TDataXtd_GeometryEnum) aType);

View File

@@ -55,7 +55,7 @@ Standard_Boolean BinMDataXtd_PositionDriver::Paste
BinObjMgt_RRelocationTable& ) const BinObjMgt_RRelocationTable& ) const
{ {
Handle(TDataXtd_Position) anAtt = Handle(TDataXtd_Position)::DownCast(theTarget); Handle(TDataXtd_Position) anAtt = Handle(TDataXtd_Position)::DownCast(theTarget);
Standard_Real aValue; Standard_Real aValue = 0.0;
Standard_Boolean ok = theSource >> aValue; Standard_Boolean ok = theSource >> aValue;
if (!ok) return ok; if (!ok) return ok;
gp_Pnt aPosition(0., 0., 0.); gp_Pnt aPosition(0., 0., 0.);

View File

@@ -56,7 +56,7 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste
Handle(TDataXtd_Presentation) anAttribute = Handle(TDataXtd_Presentation)::DownCast(theTarget); Handle(TDataXtd_Presentation) anAttribute = Handle(TDataXtd_Presentation)::DownCast(theTarget);
// Display status // Display status
Standard_Integer aValue; const Standard_Integer aValue = -1;
ok = theSource >> aValue; ok = theSource >> aValue;
if (!ok) return ok; if (!ok) return ok;
anAttribute->SetDisplayed (aValue != 0); anAttribute->SetDisplayed (aValue != 0);
@@ -92,7 +92,7 @@ Standard_Boolean BinMDataXtd_PresentationDriver::Paste
anAttribute->UnsetMaterial(); anAttribute->UnsetMaterial();
// Transparency // Transparency
Standard_Real aRValue; Standard_Real aRValue = -1.0;
ok = theSource >> aRValue; ok = theSource >> aRValue;
if ( !ok ) return ok; if ( !ok ) return ok;
if ( aRValue != -1. ) if ( aRValue != -1. )

View File

@@ -62,7 +62,7 @@ Standard_Boolean BinMFunction_FunctionDriver::Paste
Standard_Boolean ok = theSource >> aGUID; Standard_Boolean ok = theSource >> aGUID;
if (ok) { if (ok) {
anAtt->SetDriverGUID(aGUID); anAtt->SetDriverGUID(aGUID);
Standard_Integer aValue; const Standard_Integer aValue = -1;
ok = theSource >> aValue; ok = theSource >> aValue;
if(ok) if(ok)
anAtt->SetFailure(aValue); anAtt->SetFailure(aValue);

View File

@@ -117,8 +117,9 @@ static int TranslateFrom (const BinObjMgt_Persistent& theSource,
TopoDS_Shape& theResult, TopoDS_Shape& theResult,
BinTools_ShapeSet* theShapeSet) BinTools_ShapeSet* theShapeSet)
{ {
Standard_Integer aShapeID, aLocID; const Standard_Integer aShapeID = -1;
Standard_Character aCharOrient; const Standard_Integer aLocID = -1;
const Standard_Character aCharOrient = '0';
Standard_Boolean Ok = theSource >> aShapeID; //TShapeID; Standard_Boolean Ok = theSource >> aShapeID; //TShapeID;
if(!Ok) return 1; if(!Ok) return 1;
// Read TShape and Orientation // Read TShape and Orientation
@@ -176,11 +177,11 @@ Standard_Boolean BinMNaming_NamedShapeDriver::Paste
theSource >> aNbShapes; theSource >> aNbShapes;
TDF_Label aLabel = theTarget->Label (); TDF_Label aLabel = theTarget->Label ();
TNaming_Builder aBuilder (aLabel); TNaming_Builder aBuilder (aLabel);
Standard_Integer aVer; const Standard_Integer aVer = -1;
Standard_Boolean ok = theSource >> aVer; Standard_Boolean ok = theSource >> aVer;
if(!ok) return Standard_False; if(!ok) return Standard_False;
aTAtt->SetVersion(aVer); //Version aTAtt->SetVersion(aVer); //Version
Standard_Character aCharEvol; const Standard_Character aCharEvol = '0';
ok = theSource >> aCharEvol; ok = theSource >> aCharEvol;
if(!ok) return Standard_False; if(!ok) return Standard_False;
TNaming_Evolution anEvol = EvolutionToEnum (aCharEvol); //Evolution TNaming_Evolution anEvol = EvolutionToEnum (aCharEvol); //Evolution

View File

@@ -152,7 +152,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
TNaming_Name& aName = anAtt->ChangeName(); TNaming_Name& aName = anAtt->ChangeName();
TCollection_ExtendedString aMsg; TCollection_ExtendedString aMsg;
//1. NameType //1. NameType
Standard_Character aValue; const Standard_Character aValue = '0';
Standard_Boolean ok = theSource >> aValue; Standard_Boolean ok = theSource >> aValue;
Standard_Boolean aNewF = Standard_False; Standard_Boolean aNewF = Standard_False;
if (ok) { if (ok) {
@@ -171,7 +171,7 @@ Standard_Boolean BinMNaming_NamingDriver::Paste
//3. Args //3. Args
Standard_Integer aNbArgs=0; Standard_Integer aNbArgs=0;
Standard_Integer anIndx; const Standard_Integer anIndx = -1;
Handle(TNaming_NamedShape) aNS; Handle(TNaming_NamedShape) aNS;
ok = theSource >> aNbArgs; ok = theSource >> aNbArgs;
if (ok) { if (ok) {

View File

@@ -48,7 +48,9 @@ Standard_Boolean BinMXCAFDoc_CentroidDriver::Paste(const BinObjMgt_Persistent& t
BinObjMgt_RRelocationTable& /*theRelocTable*/) const BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{ {
Handle(XCAFDoc_Centroid) anAtt = Handle(XCAFDoc_Centroid)::DownCast(theTarget); 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; Standard_Boolean isOk = theSource >> x >> y >> z;
if(isOk) { if(isOk) {
gp_Pnt aPnt(x, y, z); gp_Pnt aPnt(x, y, z);

View File

@@ -48,8 +48,10 @@ Standard_Boolean BinMXCAFDoc_ColorDriver::Paste(const BinObjMgt_Persistent& theS
BinObjMgt_RRelocationTable& /*theRelocTable*/) const BinObjMgt_RRelocationTable& /*theRelocTable*/) const
{ {
Handle(XCAFDoc_Color) anAtt = Handle(XCAFDoc_Color)::DownCast(theTarget); Handle(XCAFDoc_Color) anAtt = Handle(XCAFDoc_Color)::DownCast(theTarget);
Standard_Real R, G, B; Standard_Real R = 0.0;
Standard_ShortReal alpha; Standard_Real G = 0.0;
Standard_Real B = 0.0;
Standard_ShortReal alpha = 1.0;
Standard_Boolean isOk = theSource >> R >> G >> B; Standard_Boolean isOk = theSource >> R >> G >> B;
if(isOk) { if(isOk) {
Standard_Boolean isRGBA = theSource >> alpha; Standard_Boolean isRGBA = theSource >> alpha;

View File

@@ -198,7 +198,7 @@ public:
Standard_Real LowerValue() Standard_Real LowerValue()
{ {
Standard_Integer a, aResultIndex = 0; Standard_Integer a, aResultIndex = 0;
Standard_Real aValue; Standard_Real aValue = 0.0;
for(a = myV.Length(); a > 0; a--) for(a = myV.Length(); a > 0; a--)
{ {
if (aResultIndex == 0 || Abs(aValue) > Abs(myV.Value(a))) if (aResultIndex == 0 || Abs(aValue) > Abs(myV.Value(a)))

View File

@@ -3915,7 +3915,7 @@ void ChFi3d_Builder::IntersectMoreCorner(const Standard_Integer Index)
} }
TopoDS_Face FFv; TopoDS_Face FFv;
Standard_Real tol; Standard_Real tol;
Standard_Integer prol; Standard_Integer prol = 0;
BRep_Builder BRE; BRep_Builder BRE;
Handle(Geom_Surface ) Sface; Handle(Geom_Surface ) Sface;
Sface=BRep_Tool::Surface(Fv); Sface=BRep_Tool::Surface(Fv);

View File

@@ -1780,7 +1780,7 @@ void ChFi3d_ChBuilder::ExtentTwoCorner(const TopoDS_Vertex& V,
Standard_Integer Sens = 0; Standard_Integer Sens = 0;
ChFiDS_ListIteratorOfListOfStripe itel(LS); ChFiDS_ListIteratorOfListOfStripe itel(LS);
Standard_Boolean FF = Standard_True; Standard_Boolean FF = Standard_True;
Standard_Boolean isfirst[2]; Standard_Boolean isfirst[2] = { Standard_True, Standard_True };
Standard_Integer Iedge[2]; Standard_Integer Iedge[2];
Iedge[0] = 1; Iedge[0] = 1;
Iedge[1] = 1; Iedge[1] = 1;

View File

@@ -420,7 +420,8 @@ HLRAlgo_PolyInternalData::UpdateLinks (const Standard_Integer ip1,
aSegIndices2->Conex2 = cnx2; aSegIndices2->Conex2 = cnx2;
aNodIndices3.NdSg = find; 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]; Standard_Integer n1,n2,n3,nOld[3],nNew[3],New[4];
New[0] = cnx1; New[0] = cnx1;
New[2] = myNbTData + 1; New[2] = myNbTData + 1;

View File

@@ -999,7 +999,8 @@ static void TestWLineToRLine(const IntPatch_SequenceOfLine& slinref,
} }
// resolve arcs for vertices not having a link to an arc // 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_Array1OfReal paramsResolved(1,nbvtx);
TColStd_Array1OfTransient arcsResolved(1,nbvtx); TColStd_Array1OfTransient arcsResolved(1,nbvtx);
arcsResolved.Init(Handle(Adaptor2d_Curve2d)()); arcsResolved.Init(Handle(Adaptor2d_Curve2d)());

View 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 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; Standard_Integer nbi = 0;
xmin = theS->FirstUParameter(); xmin = theS->FirstUParameter();

View File

@@ -318,7 +318,7 @@ Bnd_Box MeshVS_DataSource::GetBoundingBox() const
const TColStd_PackedMapOfInteger& aNodes = GetAllNodes(); const TColStd_PackedMapOfInteger& aNodes = GetAllNodes();
if( aNodes.Extent() ) if( aNodes.Extent() )
{ {
Standard_Real aCoordsBuf[ 3 ]; const Standard_Real aCoordsBuf[3] = { 0.0, 0.0, 0.0 };
TColStd_Array1OfReal aCoords (*aCoordsBuf, 1, 3); TColStd_Array1OfReal aCoords (*aCoordsBuf, 1, 3);
Standard_Integer nbNodes; Standard_Integer nbNodes;
MeshVS_EntityType aType; MeshVS_EntityType aType;

View File

@@ -108,7 +108,7 @@ void MeshVS_MeshPrsBuilder::BuildNodes ( const Handle(Prs3d_Presentation)& Prs,
Standard_Boolean HasSelectFlag = ( ( DisplayMode & MeshVS_DMF_SelectionPrs ) != 0 ); Standard_Boolean HasSelectFlag = ( ( DisplayMode & MeshVS_DMF_SelectionPrs ) != 0 );
Standard_Boolean HasHilightFlag = ( ( DisplayMode & MeshVS_DMF_HilightPrs ) != 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 ); TColStd_Array1OfReal aCoords( *aCoordsBuf, 1, 3 );
Standard_Integer NbNodes; Standard_Integer NbNodes;
MeshVS_EntityType aType; MeshVS_EntityType aType;

View File

@@ -294,7 +294,7 @@ static LONG CallHandler (DWORD theExceptionCode,
&& theExceptionCode != EXCEPTION_NONCONTINUABLE_EXCEPTION) && theExceptionCode != EXCEPTION_NONCONTINUABLE_EXCEPTION)
{ {
MessageBeep (MB_ICONHAND); MessageBeep (MB_ICONHAND);
char aMsgBoxBuffer[2048]; char aMsgBoxBuffer[2048] = { '\0' };
strcat_s (aMsgBoxBuffer, sizeof(aMsgBoxBuffer), aBuffer); strcat_s (aMsgBoxBuffer, sizeof(aMsgBoxBuffer), aBuffer);
if (aStackBuffer != NULL) if (aStackBuffer != NULL)
{ {

View File

@@ -230,10 +230,12 @@ TCollection_AsciiString Standard_Dump::GetPointerInfo (const void* thePointer, c
std::ostringstream aPtrStr; std::ostringstream aPtrStr;
aPtrStr << thePointer; 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++) for (int aSymbolId = 1; aSymbolId < anInfoPtr.Length(); aSymbolId++)
{ {
if (anInfoPtr.Value(aSymbolId) != '0') if (anInfoPtr.Value(aSymbolId) != '0')
@@ -243,7 +245,7 @@ TCollection_AsciiString Standard_Dump::GetPointerInfo (const void* thePointer, c
return anInfoPtr; return anInfoPtr;
} }
} }
return aPtrStr.str().c_str(); return TCollection_AsciiString(aPtrStr.str().c_str());
} }
// ======================================================================= // =======================================================================