From 16732def37c5a66f3ea28dbe247b09cc6bca6677 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Fri, 6 Nov 2020 17:49:09 +0100 Subject: Cleanup: Clang-Tidy modernize-use-nullptr Replace `NULL` with `nullptr` in C++ code. No functional changes. --- .../blender/freestyle/intern/python/BPy_SShape.cpp | 82 +++++++++++----------- 1 file changed, 41 insertions(+), 41 deletions(-) (limited to 'source/blender/freestyle/intern/python/BPy_SShape.cpp') diff --git a/source/blender/freestyle/intern/python/BPy_SShape.cpp b/source/blender/freestyle/intern/python/BPy_SShape.cpp index b1d5f8f4aac..c2309a1252f 100644 --- a/source/blender/freestyle/intern/python/BPy_SShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_SShape.cpp @@ -35,7 +35,7 @@ extern "C" { //-------------------MODULE INITIALIZATION-------------------------------- int SShape_Init(PyObject *module) { - if (module == NULL) { + if (module == nullptr) { return -1; } @@ -65,8 +65,8 @@ PyDoc_STRVAR( static int SShape_init(BPy_SShape *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"brother", NULL}; - PyObject *brother = 0; + static const char *kwlist[] = {"brother", nullptr}; + PyObject *brother = nullptr; if (!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist, &SShape_Type, &brother)) { return -1; @@ -104,11 +104,11 @@ static char SShape_add_edge_doc[] = static PyObject *SShape_add_edge(BPy_SShape *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"edge", NULL}; - PyObject *py_fe = 0; + static const char *kwlist[] = {"edge", nullptr}; + PyObject *py_fe = nullptr; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &FEdge_Type, &py_fe)) { - return NULL; + return nullptr; } self->ss->AddEdge(((BPy_FEdge *)py_fe)->fe); Py_RETURN_NONE; @@ -125,11 +125,11 @@ PyDoc_STRVAR(SShape_add_vertex_doc, static PyObject *SShape_add_vertex(BPy_SShape *self, PyObject *args, PyObject *kwds) { - static const char *kwlist[] = {"edge", NULL}; - PyObject *py_sv = 0; + static const char *kwlist[] = {"edge", nullptr}; + PyObject *py_sv = nullptr; if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &SVertex_Type, &py_sv)) { - return NULL; + return nullptr; } self->ss->AddNewVertex(((BPy_SVertex *)py_sv)->sv); Py_RETURN_NONE; @@ -157,7 +157,7 @@ static PyMethodDef BPy_SShape_methods[] = { METH_VARARGS | METH_KEYWORDS, SShape_add_vertex_doc}, {"compute_bbox", (PyCFunction)SShape_compute_bbox, METH_NOARGS, SShape_compute_bbox_doc}, - {NULL, NULL, 0, NULL}, + {nullptr, nullptr, 0, nullptr}, }; /*----------------------SShape get/setters ----------------------------*/ @@ -266,53 +266,53 @@ static PyObject *SShape_edges_get(BPy_SShape *self, void *UNUSED(closure)) } static PyGetSetDef BPy_SShape_getseters[] = { - {"id", (getter)SShape_id_get, (setter)SShape_id_set, SShape_id_doc, NULL}, - {"name", (getter)SShape_name_get, (setter)SShape_name_set, SShape_name_doc, NULL}, - {"bbox", (getter)SShape_bbox_get, (setter)SShape_bbox_set, SShape_bbox_doc, NULL}, - {"edges", (getter)SShape_edges_get, (setter)NULL, SShape_edges_doc, NULL}, - {"vertices", (getter)SShape_vertices_get, (setter)NULL, SShape_vertices_doc, NULL}, - {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ + {"id", (getter)SShape_id_get, (setter)SShape_id_set, SShape_id_doc, nullptr}, + {"name", (getter)SShape_name_get, (setter)SShape_name_set, SShape_name_doc, nullptr}, + {"bbox", (getter)SShape_bbox_get, (setter)SShape_bbox_set, SShape_bbox_doc, nullptr}, + {"edges", (getter)SShape_edges_get, (setter)nullptr, SShape_edges_doc, nullptr}, + {"vertices", (getter)SShape_vertices_get, (setter)nullptr, SShape_vertices_doc, nullptr}, + {nullptr, nullptr, nullptr, nullptr, nullptr} /* Sentinel */ }; /*-----------------------BPy_SShape type definition ------------------------------*/ PyTypeObject SShape_Type = { - PyVarObject_HEAD_INIT(NULL, 0) "SShape", /* tp_name */ + PyVarObject_HEAD_INIT(nullptr, 0) "SShape", /* tp_name */ sizeof(BPy_SShape), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SShape_dealloc, /* tp_dealloc */ - 0, /* tp_print */ - 0, /* tp_getattr */ - 0, /* tp_setattr */ - 0, /* tp_reserved */ + nullptr, /* tp_print */ + nullptr, /* tp_getattr */ + nullptr, /* tp_setattr */ + nullptr, /* tp_reserved */ (reprfunc)SShape_repr, /* tp_repr */ - 0, /* tp_as_number */ - 0, /* tp_as_sequence */ - 0, /* tp_as_mapping */ - 0, /* tp_hash */ - 0, /* tp_call */ - 0, /* tp_str */ - 0, /* tp_getattro */ - 0, /* tp_setattro */ - 0, /* tp_as_buffer */ + nullptr, /* tp_as_number */ + nullptr, /* tp_as_sequence */ + nullptr, /* tp_as_mapping */ + nullptr, /* tp_hash */ + nullptr, /* tp_call */ + nullptr, /* tp_str */ + nullptr, /* tp_getattro */ + nullptr, /* tp_setattro */ + nullptr, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, /* tp_flags */ SShape_doc, /* tp_doc */ - 0, /* tp_traverse */ - 0, /* tp_clear */ - 0, /* tp_richcompare */ + nullptr, /* tp_traverse */ + nullptr, /* tp_clear */ + nullptr, /* tp_richcompare */ 0, /* tp_weaklistoffset */ - 0, /* tp_iter */ - 0, /* tp_iternext */ + nullptr, /* tp_iter */ + nullptr, /* tp_iternext */ BPy_SShape_methods, /* tp_methods */ - 0, /* tp_members */ + nullptr, /* tp_members */ BPy_SShape_getseters, /* tp_getset */ - 0, /* tp_base */ - 0, /* tp_dict */ - 0, /* tp_descr_get */ - 0, /* tp_descr_set */ + nullptr, /* tp_base */ + nullptr, /* tp_dict */ + nullptr, /* tp_descr_get */ + nullptr, /* tp_descr_set */ 0, /* tp_dictoffset */ (initproc)SShape_init, /* tp_init */ - 0, /* tp_alloc */ + nullptr, /* tp_alloc */ PyType_GenericNew, /* tp_new */ }; -- cgit v1.2.3