Core/Mod: modernize C++11
* use nullptr
This commit is contained in:
@@ -43,21 +43,21 @@ std::string FeaturePathCompoundPy::representation(void) const
|
||||
PyObject* FeaturePathCompoundPy::addObject(PyObject *args)
|
||||
{
|
||||
PyObject *object;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(DocumentObjectPy::Type), &object)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "O!", &(DocumentObjectPy::Type), &object))
|
||||
return nullptr;
|
||||
|
||||
DocumentObjectPy* docObj = static_cast<DocumentObjectPy*>(object);
|
||||
if (!docObj->getDocumentObjectPtr() || !docObj->getDocumentObjectPtr()->getNameInDocument()) {
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot add an invalid object");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (docObj->getDocumentObjectPtr()->getDocument() != getFeaturePathCompoundPtr()->getDocument()) {
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot add an object from another document to this group");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (docObj->getDocumentObjectPtr() == this->getFeaturePathCompoundPtr()) {
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot add a group object to itself");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FeatureCompound* comp = getFeaturePathCompoundPtr();
|
||||
@@ -88,17 +88,17 @@ PyObject* FeaturePathCompoundPy::addObject(PyObject *args)
|
||||
PyObject* FeaturePathCompoundPy::removeObject(PyObject *args)
|
||||
{
|
||||
PyObject *object;
|
||||
if (!PyArg_ParseTuple(args, "O!", &(DocumentObjectPy::Type), &object)) // convert args: Python->C
|
||||
return NULL; // NULL triggers exception
|
||||
if (!PyArg_ParseTuple(args, "O!", &(DocumentObjectPy::Type), &object))
|
||||
return nullptr;
|
||||
|
||||
DocumentObjectPy* docObj = static_cast<DocumentObjectPy*>(object);
|
||||
if (!docObj->getDocumentObjectPtr() || !docObj->getDocumentObjectPtr()->getNameInDocument()) {
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot remove an invalid object");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
if (docObj->getDocumentObjectPtr()->getDocument() != getFeaturePathCompoundPtr()->getDocument()) {
|
||||
PyErr_SetString(Base::BaseExceptionFreeCADError, "Cannot remove an object from another document from this group");
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
FeatureCompound* comp = getFeaturePathCompoundPtr();
|
||||
|
||||
Reference in New Issue
Block a user