Measure: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:12:11 +01:00
parent f76c121c28
commit 635534cb15
2 changed files with 12 additions and 12 deletions

View File

@@ -60,7 +60,7 @@ PyMOD_INIT_FUNC(Measure)
}
catch(const Base::Exception& e) {
PyErr_SetString(PyExc_ImportError, e.what());
PyMOD_Return(0);
PyMOD_Return(nullptr);
}
PyObject* mod = Measure::initModule();
// Add Types to module

View File

@@ -60,7 +60,7 @@ PyObject* MeasurementPy::addReference3D(PyObject *args)
char *ObjectName;
char *SubName;
if (!PyArg_ParseTuple(args, "ss:Give an object and subelement name", &ObjectName,&SubName))
return 0;
return nullptr;
// get the target object for the external link
App::DocumentObject * Obj = App::GetApplication().getActiveDocument()->getObject(ObjectName);
@@ -68,7 +68,7 @@ PyObject* MeasurementPy::addReference3D(PyObject *args)
std::stringstream str;
str << ObjectName << "does not exist in the document";
PyErr_SetString(PyExc_ValueError, str.str().c_str());
return 0;
return nullptr;
}
// add the external
@@ -76,7 +76,7 @@ PyObject* MeasurementPy::addReference3D(PyObject *args)
std::stringstream str;
str << "Not able to add reference";
PyErr_SetString(PyExc_ValueError, str.str().c_str());
return 0;
return nullptr;
}
Py_Return;
@@ -86,7 +86,7 @@ PyObject* MeasurementPy::has3DReferences(PyObject *args)
{
PyObject *result=Py_False;
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
if (getMeasurementPtr()->has3DReferences()) {
result = Py_True;
@@ -99,7 +99,7 @@ PyObject* MeasurementPy::has3DReferences(PyObject *args)
PyObject* MeasurementPy::clear(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
this->getMeasurementPtr()->clear();
@@ -109,7 +109,7 @@ PyObject* MeasurementPy::clear(PyObject *args)
PyObject* MeasurementPy::delta(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Py::Vector delta(this->getMeasurementPtr()->delta());
@@ -119,7 +119,7 @@ PyObject* MeasurementPy::delta(PyObject *args)
PyObject* MeasurementPy::length(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Py::Float length;
length = this->getMeasurementPtr()->length();
@@ -130,7 +130,7 @@ PyObject* MeasurementPy::length(PyObject *args)
PyObject* MeasurementPy::radius(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Py::Float radius;
radius = this->getMeasurementPtr()->radius();
@@ -141,7 +141,7 @@ PyObject* MeasurementPy::radius(PyObject *args)
PyObject* MeasurementPy::angle(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Py::Float angle;
angle = this->getMeasurementPtr()->angle();
@@ -152,7 +152,7 @@ PyObject* MeasurementPy::angle(PyObject *args)
PyObject* MeasurementPy::com(PyObject *args)
{
if (!PyArg_ParseTuple(args, ""))
return 0;
return nullptr;
Py::Vector com(this->getMeasurementPtr()->massCenter());
@@ -161,7 +161,7 @@ PyObject* MeasurementPy::com(PyObject *args)
PyObject *MeasurementPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int MeasurementPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)