Part: modernize C++11
* use nullptr
This commit is contained in:
@@ -63,7 +63,7 @@ PyObject *Geometry2dPy::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 'Geometry'.");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// constructor method
|
||||
@@ -94,7 +94,7 @@ PyObject* Geometry2dPy::mirror(PyObject *args)
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "either a point (vector) or axis (vector, vector) must be given");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* Geometry2dPy::rotate(PyObject *args)
|
||||
@@ -110,7 +110,7 @@ PyObject* Geometry2dPy::rotate(PyObject *args)
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Vector2d and float expected");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* Geometry2dPy::scale(PyObject *args)
|
||||
@@ -126,14 +126,14 @@ PyObject* Geometry2dPy::scale(PyObject *args)
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Vector2d and float expected");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* Geometry2dPy::transform(PyObject *args)
|
||||
{
|
||||
PyObject* o;
|
||||
if (!PyArg_ParseTuple(args, "O", &o))
|
||||
return 0;
|
||||
return nullptr;
|
||||
Py::Sequence list(o);
|
||||
double a11 = static_cast<double>(Py::Float(list.getItem(0)));
|
||||
double a12 = static_cast<double>(Py::Float(list.getItem(1)));
|
||||
@@ -168,23 +168,23 @@ PyObject* Geometry2dPy::translate(PyObject *args)
|
||||
}
|
||||
|
||||
PyErr_SetString(PartExceptionOCCError, "Vector2d expected");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
PyObject* Geometry2dPy::copy(PyObject *args)
|
||||
{
|
||||
if (!PyArg_ParseTuple(args, ""))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
Part::Geometry2d* geom = this->getGeometry2dPtr();
|
||||
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 geometry");
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Part::Geometry2dPy* geompy = static_cast<Part::Geometry2dPy*>(cpy);
|
||||
@@ -200,7 +200,7 @@ PyObject* Geometry2dPy::copy(PyObject *args)
|
||||
|
||||
PyObject *Geometry2dPy::getCustomAttributes(const char* /*attr*/) const
|
||||
{
|
||||
return 0;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
int Geometry2dPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)
|
||||
|
||||
Reference in New Issue
Block a user