Fem: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:17:40 +01:00
parent 51b94abfde
commit 7ae9fc0d67
88 changed files with 301 additions and 301 deletions

View File

@@ -45,19 +45,19 @@ PyObject* FemPostPipelinePy::read(PyObject *args)
PyMem_Free(Name);
Py_Return;
}
return 0;
return nullptr;
}
PyObject* FemPostPipelinePy::load(PyObject *args)
{
PyObject* py;
if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &py))
return 0;
return nullptr;
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(py)->getDocumentObjectPtr();
if (!obj->getTypeId().isDerivedFrom(FemResultObject::getClassTypeId())) {
PyErr_SetString(PyExc_TypeError, "object is not a result object");
return 0;
return nullptr;
}
getFemPostPipelinePtr()->load(static_cast<FemResultObject*>(obj));
@@ -67,7 +67,7 @@ PyObject* FemPostPipelinePy::load(PyObject *args)
PyObject* FemPostPipelinePy::getLastPostObject(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
App::DocumentObject* obj = getFemPostPipelinePtr()->getLastPostObject();
if (obj)
@@ -79,12 +79,12 @@ PyObject* FemPostPipelinePy::holdsPostObject(PyObject *args)
{
PyObject* py;
if (!PyArg_ParseTuple(args, "O!", &(App::DocumentObjectPy::Type), &py))
return 0;
return nullptr;
App::DocumentObject* obj = static_cast<App::DocumentObjectPy*>(py)->getDocumentObjectPtr();
if (!obj->getTypeId().isDerivedFrom(FemPostObject::getClassTypeId())) {
PyErr_SetString(PyExc_TypeError, "object is not a post-processing object");
return 0;
return nullptr;
}
bool ok = getFemPostPipelinePtr()->holdsPostObject(static_cast<FemPostObject*>(obj));
@@ -93,7 +93,7 @@ PyObject* FemPostPipelinePy::holdsPostObject(PyObject *args)
PyObject *FemPostPipelinePy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int FemPostPipelinePy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)