diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2017-03-23 17:53:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-23 17:53:47 +0200 |
commit | 0b3ec192259a65971001ce8f0de85a9c1e71d9c7 (patch) | |
tree | a1be55ac1679e3b80ccb4cc2e31c5c57fc4bbdc9 /Modules/_sqlite | |
parent | aefa7ebf0ff0f73feee7ab24f4cdcb2014d83ee5 (diff) | |
download | cpython-git-0b3ec192259a65971001ce8f0de85a9c1e71d9c7.tar.gz |
Use NULL rather than 0. (#778)
There was few cases of using literal 0 instead of NULL in the context of
pointers. While this was a legitimate C code, using NULL rather than 0 makes
the code clearer.
Diffstat (limited to 'Modules/_sqlite')
-rw-r--r-- | Modules/_sqlite/connection.c | 2 | ||||
-rw-r--r-- | Modules/_sqlite/module.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c index 72156b91a4..fab77ef20b 100644 --- a/Modules/_sqlite/connection.c +++ b/Modules/_sqlite/connection.c @@ -643,7 +643,7 @@ static void _pysqlite_step_callback(sqlite3_context *context, int argc, sqlite3_ aggregate_instance = (PyObject**)sqlite3_aggregate_context(context, sizeof(PyObject*)); - if (*aggregate_instance == 0) { + if (*aggregate_instance == NULL) { *aggregate_instance = _PyObject_CallNoArg(aggregate_class); if (PyErr_Occurred()) { diff --git a/Modules/_sqlite/module.c b/Modules/_sqlite/module.c index 72c3a7f34f..59406e1d77 100644 --- a/Modules/_sqlite/module.c +++ b/Modules/_sqlite/module.c @@ -434,7 +434,7 @@ PyMODINIT_FUNC PyInit__sqlite3(void) PyDict_SetItemString(dict, "OptimizedUnicode", (PyObject*)&PyUnicode_Type); /* Set integer constants */ - for (i = 0; _int_constants[i].constant_name != 0; i++) { + for (i = 0; _int_constants[i].constant_name != NULL; i++) { tmp_obj = PyLong_FromLong(_int_constants[i].constant_value); if (!tmp_obj) { goto error; |