diff --git a/docs/dev/clang-tidy-fixes-2026-04.md b/docs/dev/clang-tidy-fixes-2026-04.md index 81f48441..378463eb 100644 --- a/docs/dev/clang-tidy-fixes-2026-04.md +++ b/docs/dev/clang-tidy-fixes-2026-04.md @@ -101,7 +101,8 @@ - [ ] [modernize-use-designated-initializers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-designated-initializers.html) (69) - [ ] [modernize-use-equals-default](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-equals-default.html) (7) - [ ] [modernize-use-integer-sign-comparison](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-integer-sign-comparison.html) (7) -- [ ] [modernize-use-nullptr](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-nullptr.html) (194) +- [x] [modernize-use-nullptr](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-nullptr.html) (194) + - [PR #592](https://github.com/Framework-R-D/phlex/pull/592) - [ ] [modernize-use-ranges](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-ranges.html) (5) - [ ] [modernize-use-starts-ends-with](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-starts-ends-with.html) (6) - [ ] [modernize-use-std-numbers](https://clang.llvm.org/extra/clang-tidy/checks/modernize/use-std-numbers.html) (2) diff --git a/plugins/python/src/configwrap.cpp b/plugins/python/src/configwrap.cpp index defb95d3..bb9e1374 100644 --- a/plugins/python/src/configwrap.cpp +++ b/plugins/python/src/configwrap.cpp @@ -226,56 +226,56 @@ PyTypeObject phlex::experimental::PhlexConfig_Type = { 0, // tp_itemsize reinterpret_cast(pcm_dealloc), // tp_dealloc 0, // tp_vectorcall_offset / tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_as_async / tp_compare - 0, // tp_repr - 0, // tp_as_number - 0, // tp_as_sequence + nullptr, // tp_getattr + nullptr, // tp_setattr + nullptr, // tp_as_async / tp_compare + nullptr, // tp_repr + nullptr, // tp_as_number + nullptr, // tp_as_sequence &pcm_as_mapping, // tp_as_mapping - 0, // tp_hash - 0, // tp_call - 0, // tp_str - 0, // tp_getattro - 0, // tp_setattro - 0, // tp_as_buffer + nullptr, // tp_hash + nullptr, // tp_call + nullptr, // tp_str + nullptr, // tp_getattro + nullptr, // tp_setattro + nullptr, // tp_as_buffer Py_TPFLAGS_DEFAULT, // tp_flags "phlex configuration object-as-dictionary", // 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 - 0, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set + nullptr, // tp_iter + nullptr, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set offsetof(py_config_map, ph_config_cache), // tp_dictoffset - 0, // tp_init - 0, // tp_alloc + nullptr, // tp_init + nullptr, // tp_alloc reinterpret_cast(pcm_new), // tp_new - 0, // tp_free - 0, // tp_is_gc - 0, // tp_bases - 0, // tp_mro - 0, // tp_cache - 0, // tp_subclasses - 0 // tp_weaklist + nullptr, // tp_free + nullptr, // tp_is_gc + nullptr, // tp_bases + nullptr, // tp_mro + nullptr, // tp_cache + nullptr, // tp_subclasses + nullptr // tp_weaklist #if PY_VERSION_HEX >= 0x02030000 - , 0 // tp_del + , nullptr // tp_del #endif #if PY_VERSION_HEX >= 0x02060000 , 0 // tp_version_tag #endif #if PY_VERSION_HEX >= 0x03040000 - , 0 // tp_finalize + , nullptr // tp_finalize #endif #if PY_VERSION_HEX >= 0x03080000 - , 0 // tp_vectorcall + , nullptr // tp_vectorcall #endif #if PY_VERSION_HEX >= 0x030c0000 , 0 // tp_watched diff --git a/plugins/python/src/dciwrap.cpp b/plugins/python/src/dciwrap.cpp index 0c0cee7e..00c2636e 100644 --- a/plugins/python/src/dciwrap.cpp +++ b/plugins/python/src/dciwrap.cpp @@ -42,58 +42,58 @@ PyTypeObject phlex::experimental::PhlexDataCellIndex_Type = { "pyphlex.data_cell_index", // tp_name sizeof(py_data_cell_index), // tp_basicsize 0, // tp_itemsize - 0, // tp_dealloc + nullptr, // tp_dealloc 0, // tp_vectorcall_offset / tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_as_async / tp_compare - 0, // 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_getattr + nullptr, // tp_setattr + nullptr, // tp_as_async / tp_compare + nullptr, // tp_repr + 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, // tp_flags "phlex data_cell_index", // 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 dci_methods, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc - 0, // tp_new - 0, // tp_free - 0, // tp_is_gc - 0, // tp_bases - 0, // tp_mro - 0, // tp_cache - 0, // tp_subclasses - 0 // tp_weaklist + nullptr, // tp_init + nullptr, // tp_alloc + nullptr, // tp_new + nullptr, // tp_free + nullptr, // tp_is_gc + nullptr, // tp_bases + nullptr, // tp_mro + nullptr, // tp_cache + nullptr, // tp_subclasses + nullptr // tp_weaklist #if PY_VERSION_HEX >= 0x02030000 - , 0 // tp_del + , nullptr // tp_del #endif #if PY_VERSION_HEX >= 0x02060000 , 0 // tp_version_tag #endif #if PY_VERSION_HEX >= 0x03040000 - , 0 // tp_finalize + , nullptr // tp_finalize #endif #if PY_VERSION_HEX >= 0x03080000 - , 0 // tp_vectorcall + , nullptr // tp_vectorcall #endif #if PY_VERSION_HEX >= 0x030c0000 , 0 // tp_watched diff --git a/plugins/python/src/lifelinewrap.cpp b/plugins/python/src/lifelinewrap.cpp index fa1d3627..3a7565b6 100644 --- a/plugins/python/src/lifelinewrap.cpp +++ b/plugins/python/src/lifelinewrap.cpp @@ -52,56 +52,56 @@ PyTypeObject phlex::experimental::PhlexLifeline_Type = { 0, // tp_itemsize reinterpret_cast(ll_dealloc), // tp_dealloc 0, // tp_vectorcall_offset / tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_as_async / tp_compare - 0, // 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_getattr + nullptr, // tp_setattr + nullptr, // tp_as_async / tp_compare + nullptr, // tp_repr + 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_HAVE_GC, // tp_flags "internal", // tp_doc reinterpret_cast(ll_traverse), // tp_traverse reinterpret_cast(ll_clear), // tp_clear - 0, // tp_richcompare + nullptr, // tp_richcompare 0, // tp_weaklistoffset - 0, // tp_iter - 0, // tp_iternext - 0, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set + nullptr, // tp_iter + nullptr, // tp_iternext + nullptr, // tp_methods + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc + nullptr, // tp_init + nullptr, // tp_alloc reinterpret_cast(ll_new), // tp_new - 0, // tp_free - 0, // tp_is_gc - 0, // tp_bases - 0, // tp_mro - 0, // tp_cache - 0, // tp_subclasses - 0 // tp_weaklist + nullptr, // tp_free + nullptr, // tp_is_gc + nullptr, // tp_bases + nullptr, // tp_mro + nullptr, // tp_cache + nullptr, // tp_subclasses + nullptr // tp_weaklist #if PY_VERSION_HEX >= 0x02030000 - , 0 // tp_del + , nullptr // tp_del #endif #if PY_VERSION_HEX >= 0x02060000 , 0 // tp_version_tag #endif #if PY_VERSION_HEX >= 0x03040000 - , 0 // tp_finalize + , nullptr // tp_finalize #endif #if PY_VERSION_HEX >= 0x03080000 - , 0 // tp_vectorcall + , nullptr // tp_vectorcall #endif #if PY_VERSION_HEX >= 0x030c0000 , 0 // tp_watched diff --git a/plugins/python/src/modulewrap.cpp b/plugins/python/src/modulewrap.cpp index ee699c97..f6658e30 100644 --- a/plugins/python/src/modulewrap.cpp +++ b/plugins/python/src/modulewrap.cpp @@ -681,7 +681,8 @@ static PyObject* parse_args(PyObject* args, kw3[] = "concurrency", kw4[] = "name"; // kwnames can be of type char const*[] once we mandate Python 3.13 or newer static char* kwnames[] = {kw0, kw1, kw2, kw3, kw4, nullptr}; - PyObject *callable = 0, *input = 0, *output = 0, *concurrency = 0, *pyname = 0; + PyObject *callable = nullptr, *input = nullptr, *output = nullptr, *concurrency = nullptr, + *pyname = nullptr; if (!PyArg_ParseTupleAndKeywords( args, kwds, "OO|OOO", kwnames, &callable, &input, &output, &concurrency, &pyname)) { // error already set by argument parser @@ -1102,58 +1103,58 @@ PyTypeObject phlex::experimental::PhlexModule_Type = { "pyphlex.module", // tp_name sizeof(py_phlex_module), // tp_basicsize 0, // tp_itemsize - 0, // tp_dealloc + nullptr, // tp_dealloc 0, // tp_vectorcall_offset / tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_as_async / tp_compare - 0, // 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_getattr + nullptr, // tp_setattr + nullptr, // tp_as_async / tp_compare + nullptr, // tp_repr + 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, // tp_flags "phlex module wrapper", // 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 md_methods, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc - 0, // tp_new - 0, // tp_free - 0, // tp_is_gc - 0, // tp_bases - 0, // tp_mro - 0, // tp_cache - 0, // tp_subclasses - 0 // tp_weaklist + nullptr, // tp_init + nullptr, // tp_alloc + nullptr, // tp_new + nullptr, // tp_free + nullptr, // tp_is_gc + nullptr, // tp_bases + nullptr, // tp_mro + nullptr, // tp_cache + nullptr, // tp_subclasses + nullptr // tp_weaklist #if PY_VERSION_HEX >= 0x02030000 - , 0 // tp_del + , nullptr // tp_del #endif #if PY_VERSION_HEX >= 0x02060000 , 0 // tp_version_tag #endif #if PY_VERSION_HEX >= 0x03040000 - , 0 // tp_finalize + , nullptr // tp_finalize #endif #if PY_VERSION_HEX >= 0x03080000 - , 0 // tp_vectorcall + , nullptr // tp_vectorcall #endif #if PY_VERSION_HEX >= 0x030c0000 , 0 // tp_watched @@ -1176,7 +1177,7 @@ static PyObject* sc_provide(py_phlex_source* src, PyObject* args, PyObject* kwds static char kw0[] = "callable", kw1[] = "output_product", kw2[] = "name"; // kwnames can be of type char const*[] once we mandate Python 3.13 or newer static char* kwnames[] = {kw0, kw1, kw2, nullptr}; - PyObject *callable = 0, *output = 0, *pyname = 0; + PyObject *callable = nullptr, *output = nullptr, *pyname = nullptr; if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|O", kwnames, &callable, &output, &pyname)) { // error already set by argument parser return nullptr; @@ -1309,58 +1310,58 @@ PyTypeObject phlex::experimental::PhlexSource_Type = { "pyphlex.source", // tp_name sizeof(py_phlex_source), // tp_basicsize 0, // tp_itemsize - 0, // tp_dealloc + nullptr, // tp_dealloc 0, // tp_vectorcall_offset / tp_print - 0, // tp_getattr - 0, // tp_setattr - 0, // tp_as_async / tp_compare - 0, // 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_getattr + nullptr, // tp_setattr + nullptr, // tp_as_async / tp_compare + nullptr, // tp_repr + 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, // tp_flags "phlex source wrapper", // 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 sc_methods, // tp_methods - 0, // tp_members - 0, // tp_getset - 0, // tp_base - 0, // tp_dict - 0, // tp_descr_get - 0, // tp_descr_set + nullptr, // tp_members + nullptr, // tp_getset + nullptr, // tp_base + nullptr, // tp_dict + nullptr, // tp_descr_get + nullptr, // tp_descr_set 0, // tp_dictoffset - 0, // tp_init - 0, // tp_alloc - 0, // tp_new - 0, // tp_free - 0, // tp_is_gc - 0, // tp_bases - 0, // tp_mro - 0, // tp_cache - 0, // tp_subclasses - 0 // tp_weaklist + nullptr, // tp_init + nullptr, // tp_alloc + nullptr, // tp_new + nullptr, // tp_free + nullptr, // tp_is_gc + nullptr, // tp_bases + nullptr, // tp_mro + nullptr, // tp_cache + nullptr, // tp_subclasses + nullptr // tp_weaklist #if PY_VERSION_HEX >= 0x02030000 - , 0 // tp_del + , nullptr // tp_del #endif #if PY_VERSION_HEX >= 0x02060000 , 0 // tp_version_tag #endif #if PY_VERSION_HEX >= 0x03040000 - , 0 // tp_finalize + , nullptr // tp_finalize #endif #if PY_VERSION_HEX >= 0x03080000 - , 0 // tp_vectorcall + , nullptr // tp_vectorcall #endif #if PY_VERSION_HEX >= 0x030c0000 , 0 // tp_watched