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

0024023: Revamp the OCCT Handle - gcc and clang

Adaptations for compiling with GCC 4.7 and 4.8:
- Construction semantics is used for Handle objects being initialized by const Handle objects of derived type, to avoid overload resolution error in GCC 4.7.
- Missing includes added.
- Fixed bugs related to misuse of direct casts of handle.
- Eliminate CLang warnings on uninitialized and unused variables, functions, and expressions
This commit is contained in:
abv
2015-07-03 11:31:43 +03:00
parent caaeed1b91
commit 5b111128de
72 changed files with 250 additions and 431 deletions

View File

@@ -202,10 +202,7 @@ TDataXtd_Constraint::TDataXtd_Constraint()
void TDataXtd_Constraint::SetPlane(const Handle(TNaming_NamedShape)& plane)
{
// OCC2932 correction
Handle(TNaming_NamedShape) aPlane =
Handle(TNaming_NamedShape)::DownCast(myPlane);
if (aPlane.IsNull() == Standard_False && plane.IsNull() == Standard_False)
if ( aPlane -> Get() == plane->Get())
if (! myPlane.IsNull() && ! plane.IsNull() && myPlane->Get() == plane->Get())
return;
Backup();
@@ -218,7 +215,7 @@ void TDataXtd_Constraint::SetPlane(const Handle(TNaming_NamedShape)& plane)
//=======================================================================
const Handle(TNaming_NamedShape)& TDataXtd_Constraint::GetPlane() const
{
return Handle(TNaming_NamedShape)::DownCast (myPlane);
return myPlane;
}
//=======================================================================

View File

@@ -25,6 +25,7 @@
#include <Standard_Integer.hxx>
#include <TDF_LabelList.hxx>
#include <Standard_OStream.hxx>
class TDataStd_Real;
class TDF_Attribute;
class Standard_GUID;
@@ -207,18 +208,10 @@ private:
TDataXtd_ConstraintEnum myType;
Handle(TDataStd_Real) myValue;
Handle(TDF_Attribute) myGeometries[4];
Handle(TDF_Attribute) myPlane;
Handle(TNaming_NamedShape) myPlane;
Standard_Boolean myIsReversed;
Standard_Boolean myIsInverted;
Standard_Boolean myIsVerified;
};
#endif // _TDataXtd_Constraint_HeaderFile