1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-07 18:30:55 +03:00

0029927: Coding Rules - eliminate GCC compiler warnings -Wmaybe-uninitialized in BRepApprox

The code has been fixed to avoid taking a reference from a field of a temporary variable
(BRepApprox_ApproxLine::Point() returns non-reference structure).
This commit is contained in:
kgv 2018-07-04 10:49:44 +03:00 committed by bugmaster
parent 5efab28a44
commit b053e5d673
2 changed files with 7 additions and 7 deletions

View File

@ -43,7 +43,7 @@ static void ComputeTrsf3d(const Handle(TheWLine)& theline,
Standard_Real aXmin = RealLast(), aYmin = RealLast(), aZmin = RealLast(); Standard_Real aXmin = RealLast(), aYmin = RealLast(), aZmin = RealLast();
for(Standard_Integer i=1;i<=aNbPnts;i++) for(Standard_Integer i=1;i<=aNbPnts;i++)
{ {
const gp_Pnt& P = theline->Point(i).Value(); const gp_Pnt P = theline->Point(i).Value();
aXmin = Min(P.X(), aXmin); aXmin = Min(P.X(), aXmin);
aYmin = Min(P.Y(), aYmin); aYmin = Min(P.Y(), aYmin);
aZmin = Min(P.Z(), aZmin); aZmin = Min(P.Z(), aZmin);
@ -76,7 +76,7 @@ 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,V;
(POn2S.*pfunc)(U,V); (POn2S.*pfunc)(U,V);
aUmin = Min(U, aUmin); aUmin = Min(U, aUmin);

View File

@ -158,7 +158,7 @@ Standard_Integer ApproxInt_MultiLine::NbP2d() const {
void ApproxInt_MultiLine::Value(const Standard_Integer Index, void ApproxInt_MultiLine::Value(const Standard_Integer Index,
TColgp_Array1OfPnt& TabPnt) const TColgp_Array1OfPnt& TabPnt) const
{ {
const gp_Pnt& aP = myLine->Point(Index).Value(); const gp_Pnt aP = myLine->Point(Index).Value();
TabPnt(1).SetCoord(aP.X()+Xo, aP.Y()+Yo, aP.Z()+Zo); TabPnt(1).SetCoord(aP.X()+Xo, aP.Y()+Yo, aP.Z()+Zo);
} }