PD: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:07:22 +01:00
parent 068c0e5a98
commit 3608ee7f51
89 changed files with 273 additions and 273 deletions

View File

@@ -42,7 +42,7 @@ std::string BodyPy::representation(void) const
PyObject *BodyPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int BodyPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
@@ -57,7 +57,7 @@ PyObject* BodyPy::insertObject(PyObject *args)
PyObject* afterPy = Py_False;
if (!PyArg_ParseTuple(args, "O!O|O!", &(App::DocumentObjectPy::Type), &featurePy,
&targetPy, &PyBool_Type, &afterPy)) {
return 0;
return nullptr;
}
App::DocumentObject* feature = static_cast<App::DocumentObjectPy*>(featurePy)->getDocumentObjectPtr();
@@ -68,7 +68,7 @@ PyObject* BodyPy::insertObject(PyObject *args)
if (!Body::isAllowed(feature)) {
PyErr_SetString(PyExc_SystemError, "Only PartDesign features, datum features and sketches can be inserted into a Body");
return 0;
return nullptr;
}
bool after = PyObject_IsTrue(afterPy) ? true : false;
@@ -79,7 +79,7 @@ PyObject* BodyPy::insertObject(PyObject *args)
}
catch (Base::Exception& e) {
PyErr_SetString(PyExc_SystemError, e.what());
return 0;
return nullptr;
}
Py_Return;