Part: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:06:48 +01:00
parent a057e5486d
commit 6d2d45ceb7
155 changed files with 1504 additions and 1504 deletions

View File

@@ -63,7 +63,7 @@ PyObject *Geometry2dPy::PyMake(struct _typeobject *, PyObject *, PyObject *) //
// never create such objects with the constructor
PyErr_SetString(PyExc_RuntimeError,
"You cannot create an instance of the abstract class 'Geometry'.");
return 0;
return nullptr;
}
// constructor method
@@ -94,7 +94,7 @@ PyObject* Geometry2dPy::mirror(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "either a point (vector) or axis (vector, vector) must be given");
return 0;
return nullptr;
}
PyObject* Geometry2dPy::rotate(PyObject *args)
@@ -110,7 +110,7 @@ PyObject* Geometry2dPy::rotate(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "Vector2d and float expected");
return 0;
return nullptr;
}
PyObject* Geometry2dPy::scale(PyObject *args)
@@ -126,14 +126,14 @@ PyObject* Geometry2dPy::scale(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "Vector2d and float expected");
return 0;
return nullptr;
}
PyObject* Geometry2dPy::transform(PyObject *args)
{
PyObject* o;
if (!PyArg_ParseTuple(args, "O", &o))
return 0;
return nullptr;
Py::Sequence list(o);
double a11 = static_cast<double>(Py::Float(list.getItem(0)));
double a12 = static_cast<double>(Py::Float(list.getItem(1)));
@@ -168,23 +168,23 @@ PyObject* Geometry2dPy::translate(PyObject *args)
}
PyErr_SetString(PartExceptionOCCError, "Vector2d expected");
return 0;
return nullptr;
}
PyObject* Geometry2dPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
Part::Geometry2d* geom = this->getGeometry2dPtr();
PyTypeObject* type = this->GetType();
PyObject* cpy = 0;
PyObject* cpy = nullptr;
// let the type object decide
if (type->tp_new)
cpy = type->tp_new(type, this, 0);
cpy = type->tp_new(type, this, nullptr);
if (!cpy) {
PyErr_SetString(PyExc_TypeError, "failed to create copy of geometry");
return 0;
return nullptr;
}
Part::Geometry2dPy* geompy = static_cast<Part::Geometry2dPy*>(cpy);
@@ -200,7 +200,7 @@ PyObject* Geometry2dPy::copy(PyObject *args)
PyObject *Geometry2dPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int Geometry2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)