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

@@ -40,7 +40,7 @@ PyObject *GeometryExtensionPy::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 'GeometryExtension'.");
return 0;
return nullptr;
}
// constructor method
@@ -52,17 +52,17 @@ int GeometryExtensionPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
PyObject* GeometryExtensionPy::copy(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return NULL;
return nullptr;
Part::GeometryExtension* ext = this->getGeometryExtensionPtr();
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 the geometry extension");
return 0;
return nullptr;
}
Part::GeometryExtensionPy* extpy = static_cast<Part::GeometryExtensionPy*>(cpy);
@@ -92,7 +92,7 @@ void GeometryExtensionPy::setName(Py::String arg)
PyObject *GeometryExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int GeometryExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)