mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +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:
@@ -169,7 +169,7 @@ void IGESDraw_ToolViewsVisible::OwnRenew
|
||||
up = another->NbDisplayedEntities();
|
||||
if (up == 0) return;
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
|
||||
Handle(IGESData_IGESEntity) anew;
|
||||
Handle(Standard_Transient) anew;
|
||||
for (I = 1; I <= up; I++) {
|
||||
if (TC.Search (another->DisplayedEntity(I),anew)) newdisp.GetOneItem(anew);
|
||||
}
|
||||
|
@@ -272,7 +272,7 @@ void IGESDraw_ToolViewsVisibleWithAttr::OwnRenew
|
||||
up = another->NbDisplayedEntities();
|
||||
if (up == 0) return;
|
||||
Handle(IGESData_HArray1OfIGESEntity) tempDisplayEntities;
|
||||
Handle(IGESData_IGESEntity) anew;
|
||||
Handle(Standard_Transient) anew;
|
||||
for (I = 1; I <= up; I++) {
|
||||
if (TC.Search (another->DisplayedEntity(I),anew)) newdisp.GetOneItem(anew);
|
||||
}
|
||||
|
Reference in New Issue
Block a user