+ fix strict-aliasing warnings
This commit is contained in:
parent
023de9b0f8
commit
1a12d109e9
|
@ -185,14 +185,8 @@ PyObject* DocumentObjectGroupPy::hasObject(PyObject *args)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if (getDocumentObjectGroupPtr()->hasObject(docObj->getDocumentObjectPtr())) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
bool v = getDocumentObjectGroupPtr()->hasObject(docObj->getDocumentObjectPtr());
|
||||
return PyBool_FromLong(v ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject *DocumentObjectGroupPy::getCustomAttributes(const char* /*attr*/) const
|
||||
|
|
|
@ -1788,11 +1788,7 @@ bool PropertyBool::getValue(void) const
|
|||
|
||||
PyObject *PropertyBool::getPyObject(void)
|
||||
{
|
||||
if (_lValue)
|
||||
{Py_INCREF(Py_True); return Py_True;}
|
||||
else
|
||||
{Py_INCREF(Py_False); return Py_False;}
|
||||
|
||||
return PyBool_FromLong(_lValue ? 1 : 0);
|
||||
}
|
||||
|
||||
void PropertyBool::setPyObject(PyObject *value)
|
||||
|
@ -1904,12 +1900,10 @@ PyObject *PropertyBoolList::getPyObject(void)
|
|||
for(int i = 0;i<getSize(); i++) {
|
||||
bool v = _lValueList[i];
|
||||
if (v) {
|
||||
Py_INCREF(Py_True);
|
||||
PyTuple_SetItem(tuple, i, Py_True);
|
||||
PyTuple_SetItem(tuple, i, PyBool_FromLong(1));
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
PyTuple_SetItem(tuple, i, Py_False);
|
||||
PyTuple_SetItem(tuple, i, PyBool_FromLong(0));
|
||||
}
|
||||
}
|
||||
return tuple;
|
||||
|
|
|
@ -45,14 +45,8 @@ PyObject* BaseClassPy::isDerivedFrom(PyObject *args)
|
|||
return NULL; // NULL triggers exception
|
||||
|
||||
Base::Type type = Base::Type::fromName(name);
|
||||
if (type != Base::Type::badType() && getBaseClassPtr()->getTypeId().isDerivedFrom(type)) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
bool v = (type != Base::Type::badType() && getBaseClassPtr()->getTypeId().isDerivedFrom(type));
|
||||
return PyBool_FromLong(v ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BaseClassPy::getAllDerivedFrom(PyObject *args)
|
||||
|
|
|
@ -78,14 +78,7 @@ PyObject* BSplineCurvePy::isRational(PyObject *args)
|
|||
Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = curve->IsRational();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineCurvePy::isPeriodic(PyObject *args)
|
||||
|
@ -95,14 +88,7 @@ PyObject* BSplineCurvePy::isPeriodic(PyObject *args)
|
|||
Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = curve->IsPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineCurvePy::isClosed(PyObject *args)
|
||||
|
@ -112,14 +98,7 @@ PyObject* BSplineCurvePy::isClosed(PyObject *args)
|
|||
Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = curve->IsClosed();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineCurvePy::increaseDegree(PyObject * args)
|
||||
|
@ -249,14 +228,7 @@ PyObject* BSplineCurvePy::removeKnot(PyObject * args)
|
|||
Handle_Geom_BSplineCurve curve = Handle_Geom_BSplineCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean ok = curve->RemoveKnot(Index,M,tol);
|
||||
if (ok) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(ok ? 1 : 0);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
|
@ -1106,14 +1078,7 @@ PyObject* BSplineCurvePy::join(PyObject *args)
|
|||
|
||||
bool ok = curve1->join(spline);
|
||||
|
||||
if (ok) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(ok ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineCurvePy::makeC1Continuous(PyObject *args)
|
||||
|
|
|
@ -91,14 +91,7 @@ PyObject* BSplineSurfacePy::isURational(PyObject *args)
|
|||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsURational();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineSurfacePy::isVRational(PyObject *args)
|
||||
|
@ -109,14 +102,7 @@ PyObject* BSplineSurfacePy::isVRational(PyObject *args)
|
|||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsVRational();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineSurfacePy::isUPeriodic(PyObject *args)
|
||||
|
@ -127,14 +113,7 @@ PyObject* BSplineSurfacePy::isUPeriodic(PyObject *args)
|
|||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsUPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineSurfacePy::isVPeriodic(PyObject *args)
|
||||
|
@ -145,14 +124,7 @@ PyObject* BSplineSurfacePy::isVPeriodic(PyObject *args)
|
|||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsVPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineSurfacePy::isUClosed(PyObject *args)
|
||||
|
@ -163,14 +135,7 @@ PyObject* BSplineSurfacePy::isUClosed(PyObject *args)
|
|||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsUClosed();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineSurfacePy::isVClosed(PyObject *args)
|
||||
|
@ -181,14 +146,7 @@ PyObject* BSplineSurfacePy::isVClosed(PyObject *args)
|
|||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsVPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BSplineSurfacePy::increaseDegree(PyObject *args)
|
||||
|
@ -420,14 +378,7 @@ PyObject* BSplineSurfacePy::removeUKnot(PyObject *args)
|
|||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean ok = surf->RemoveUKnot(Index,M,tol);
|
||||
if (ok) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(ok ? 1 : 0);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
|
@ -447,14 +398,7 @@ PyObject* BSplineSurfacePy::removeVKnot(PyObject *args)
|
|||
Handle_Geom_BSplineSurface surf = Handle_Geom_BSplineSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean ok = surf->RemoveVKnot(Index,M,tol);
|
||||
if (ok) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(ok ? 1 : 0);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
|
|
|
@ -64,14 +64,7 @@ PyObject* BezierCurvePy::isRational(PyObject *args)
|
|||
Handle_Geom_BezierCurve curve = Handle_Geom_BezierCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = curve->IsRational();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BezierCurvePy::isPeriodic(PyObject *args)
|
||||
|
@ -81,14 +74,7 @@ PyObject* BezierCurvePy::isPeriodic(PyObject *args)
|
|||
Handle_Geom_BezierCurve curve = Handle_Geom_BezierCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = curve->IsPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BezierCurvePy::isClosed(PyObject *args)
|
||||
|
@ -98,14 +84,7 @@ PyObject* BezierCurvePy::isClosed(PyObject *args)
|
|||
Handle_Geom_BezierCurve curve = Handle_Geom_BezierCurve::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = curve->IsClosed();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BezierCurvePy::increase(PyObject * args)
|
||||
|
|
|
@ -86,14 +86,7 @@ PyObject* BezierSurfacePy::isURational(PyObject *args)
|
|||
Handle_Geom_BezierSurface surf = Handle_Geom_BezierSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsURational();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BezierSurfacePy::isVRational(PyObject *args)
|
||||
|
@ -104,14 +97,7 @@ PyObject* BezierSurfacePy::isVRational(PyObject *args)
|
|||
Handle_Geom_BezierSurface surf = Handle_Geom_BezierSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsVRational();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BezierSurfacePy::isUPeriodic(PyObject *args)
|
||||
|
@ -122,14 +108,7 @@ PyObject* BezierSurfacePy::isUPeriodic(PyObject *args)
|
|||
Handle_Geom_BezierSurface surf = Handle_Geom_BezierSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsUPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BezierSurfacePy::isVPeriodic(PyObject *args)
|
||||
|
@ -140,14 +119,7 @@ PyObject* BezierSurfacePy::isVPeriodic(PyObject *args)
|
|||
Handle_Geom_BezierSurface surf = Handle_Geom_BezierSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsVPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BezierSurfacePy::isUClosed(PyObject *args)
|
||||
|
@ -158,14 +130,7 @@ PyObject* BezierSurfacePy::isUClosed(PyObject *args)
|
|||
Handle_Geom_BezierSurface surf = Handle_Geom_BezierSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsUClosed();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BezierSurfacePy::isVClosed(PyObject *args)
|
||||
|
@ -176,14 +141,7 @@ PyObject* BezierSurfacePy::isVClosed(PyObject *args)
|
|||
Handle_Geom_BezierSurface surf = Handle_Geom_BezierSurface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsVPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* BezierSurfacePy::increase(PyObject *args)
|
||||
|
|
|
@ -212,14 +212,7 @@ PyObject* GeometrySurfacePy::isUPeriodic(PyObject * args)
|
|||
Handle_Geom_Surface surf = Handle_Geom_Surface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsUPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* GeometrySurfacePy::isVPeriodic(PyObject * args)
|
||||
|
@ -230,14 +223,7 @@ PyObject* GeometrySurfacePy::isVPeriodic(PyObject * args)
|
|||
Handle_Geom_Surface surf = Handle_Geom_Surface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsVPeriodic();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* GeometrySurfacePy::isUClosed(PyObject * args)
|
||||
|
@ -248,14 +234,7 @@ PyObject* GeometrySurfacePy::isUClosed(PyObject * args)
|
|||
Handle_Geom_Surface surf = Handle_Geom_Surface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsUClosed();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* GeometrySurfacePy::isVClosed(PyObject * args)
|
||||
|
@ -266,14 +245,7 @@ PyObject* GeometrySurfacePy::isVClosed(PyObject * args)
|
|||
Handle_Geom_Surface surf = Handle_Geom_Surface::DownCast
|
||||
(getGeometryPtr()->handle());
|
||||
Standard_Boolean val = surf->IsVClosed();
|
||||
if (val) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong(val ? 1 : 0);
|
||||
}
|
||||
|
||||
PyObject* GeometrySurfacePy::UPeriod(PyObject * args)
|
||||
|
|
|
@ -420,14 +420,7 @@ PyObject* TopoShapeFacePy::isPartOfDomain(PyObject *args)
|
|||
//tol = std::max<double>(dialen, tol);
|
||||
BRepTopAdaptor_FClass2d CL(face,tol);
|
||||
TopAbs_State state = CL.Perform(gp_Pnt2d(u,v));
|
||||
if (state == TopAbs_ON || state == TopAbs_IN) {
|
||||
Py_INCREF(Py_True);
|
||||
return Py_True;
|
||||
}
|
||||
else {
|
||||
Py_INCREF(Py_False);
|
||||
return Py_False;
|
||||
}
|
||||
return PyBool_FromLong((state == TopAbs_ON || state == TopAbs_IN) ? 1 : 0);
|
||||
}
|
||||
catch (Standard_Failure) {
|
||||
Handle_Standard_Failure e = Standard_Failure::Caught();
|
||||
|
|
Loading…
Reference in New Issue
Block a user