Path: modernize C++11

* use nullptr
This commit is contained in:
wmayer
2022-03-23 19:13:07 +01:00
parent b5c71395f1
commit 7b591da9f5
37 changed files with 163 additions and 163 deletions

View File

@@ -88,7 +88,7 @@ Voronoi::point_type getPointFromPy(PyObject *obj) {
}
PyObject* VoronoiPy::addPoint(PyObject *args) {
PyObject *obj = 0;
PyObject *obj = nullptr;
if (PyArg_ParseTuple(args, "O", &obj)) {
getVoronoiPtr()->addPoint(getPointFromPy(obj));
}
@@ -97,8 +97,8 @@ PyObject* VoronoiPy::addPoint(PyObject *args) {
}
PyObject* VoronoiPy::addSegment(PyObject *args) {
PyObject *objBegin = 0;
PyObject *objEnd = 0;
PyObject *objBegin = nullptr;
PyObject *objEnd = nullptr;
if (PyArg_ParseTuple(args, "OO", &objBegin, &objEnd)) {
auto p0 = getPointFromPy(objBegin);
@@ -188,7 +188,7 @@ static bool callbackWithVertex(Voronoi::diagram_type *dia, PyObject *callback, c
#endif
Py_DECREF(arglist);
Py_DECREF(vx);
if (result == NULL) {
if (result == nullptr) {
bail = true;
} else {
rc = result == Py_True;
@@ -208,7 +208,7 @@ static bool callbackWithVertex(Voronoi::diagram_type *dia, PyObject *callback, c
PyObject* VoronoiPy::colorExterior(PyObject *args) {
Voronoi::color_type color = 0;
PyObject *callback = 0;
PyObject *callback = nullptr;
if (!PyArg_ParseTuple(args, "k|O", &color, &callback)) {
throw Py::RuntimeError("colorExterior requires an integer (color) argument");
}
@@ -237,7 +237,7 @@ PyObject* VoronoiPy::colorExterior(PyObject *args) {
}
}
if (bail) {
return NULL;
return nullptr;
}
}
}
@@ -334,7 +334,7 @@ PyObject* VoronoiPy::numSegments(PyObject *args)
PyObject *VoronoiPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int VoronoiPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)