modernize C++: use nullptr

This commit is contained in:
wmayer
2023-08-05 16:52:01 +02:00
committed by Chris Hennes
parent aa53596289
commit d244dcf2da
12 changed files with 242 additions and 137 deletions

View File

@@ -63,12 +63,12 @@ PyObject* StringHasherPy::getID(PyObject *args)
{
long id = -1;
int index = 0;
PyObject *value = 0;
PyObject *value = nullptr;
PyObject *base64 = Py_False;
if (!PyArg_ParseTuple(args, "l|i",&id,&index)) {
PyErr_Clear();
if (!PyArg_ParseTuple(args, "O|O",&value,&base64))
return NULL; // NULL triggers exception
return nullptr;
}
if(id>0) {
PY_TRY {
@@ -139,7 +139,7 @@ Py::Dict StringHasherPy::getTable() const {
PyObject *StringHasherPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
return nullptr;
}
int StringHasherPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/)