1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0026377: Passing Handle objects as arguments to functions as non-const reference to base type is dangerous

Operator of cast to non-const reference is declared deprecated to produce compiler warning if used (usually implicitly).

OCCT code is updated to avoid that cast, occurring when function accepting non-const reference to handle is called with handle to derived type.
For that, local variable of argument type is passed instead, and down-cast is used to get it to desired type after the call.
A few occurrences of use of uninitialized variable are corrected.
This commit is contained in:
abv
2016-02-17 17:33:18 +03:00
parent fe9b8ff2f2
commit aa00364da7
59 changed files with 395 additions and 211 deletions

View File

@@ -109,11 +109,11 @@ void IGESGeom_ToolBoundedSurface::ReadOwnParams(const Handle(IGESGeom_BoundedSur
if (!tempBounds.IsNull()){
for ( i = 1; i <= num; i++ )
{
Handle(IGESGeom_Boundary) tempEnt;
Handle(IGESData_IGESEntity) tempEnt;
//st = PR.ReadEntity(IR, PR.Current(), Msg168, tempEnt); //szv#4:S4163:12Mar99 moved in if
//st = PR.ReadEntity(IR, PR.Current(), "Boundary Entities", tempEnt);
if (PR.ReadEntity(IR, PR.Current(), aStatus, tempEnt))
tempBounds->SetValue(i, tempEnt);
tempBounds->SetValue(i, Handle(IGESGeom_Boundary)::DownCast (tempEnt));
else{
Message_Msg Msg168("XTSEP_168");
switch(aStatus) {