diff options
Diffstat (limited to 'Lib')
| -rw-r--r-- | Lib/test/_testcppext.cpp | 8 | ||||
| -rw-r--r-- | Lib/test/test_cppext.py | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/_testcppext.cpp b/Lib/test/_testcppext.cpp index 257843b..dc40f0e 100644 --- a/Lib/test/_testcppext.cpp +++ b/Lib/test/_testcppext.cpp @@ -52,7 +52,7 @@ test_api_casts(PyObject *Py_UNUSED(module), PyObject *Py_UNUSED(args)) static PyMethodDef _testcppext_methods[] = { {"add", _testcppext_add, METH_VARARGS, _testcppext_add_doc}, - {"test_api_casts", test_api_casts, METH_NOARGS, NULL}, + {"test_api_casts", test_api_casts, METH_NOARGS, nullptr}, {nullptr, nullptr, 0, nullptr} /* sentinel */ }; @@ -68,7 +68,7 @@ _testcppext_exec(PyObject *module) static PyModuleDef_Slot _testcppext_slots[] = { {Py_mod_exec, reinterpret_cast<void*>(_testcppext_exec)}, - {0, NULL} + {0, nullptr} }; @@ -81,8 +81,8 @@ static struct PyModuleDef _testcppext_module = { 0, // m_size _testcppext_methods, // m_methods _testcppext_slots, // m_slots - NULL, // m_traverse - NULL, // m_clear + nullptr, // m_traverse + nullptr, // m_clear nullptr, // m_free }; diff --git a/Lib/test/test_cppext.py b/Lib/test/test_cppext.py index fbb79bb..e056410 100644 --- a/Lib/test/test_cppext.py +++ b/Lib/test/test_cppext.py @@ -29,6 +29,8 @@ if not MS_WINDOWS: '-Werror', # Warn on old-style cast (C cast) like: (PyObject*)op '-Wold-style-cast', + # Warn when using NULL rather than _Py_NULL in static inline functions + '-Wzero-as-null-pointer-constant', ] else: # Don't pass any compiler flag to MSVC |
