From 39f9121339559738cba5130c818e8920e1a2fa16 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Wed, 21 May 2025 04:13:11 +0100 Subject: Use NULL instead of 0 as null pointer constant MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 15 enabled "-Wzero-as-null-pointer-constant" for C, which checks for places where '0' has been used as a null pointer constant. This showed a few places in Unit where we were using '0' instead of the more correct NULL macro. E.g. $ make -j4 EXTRA_CFLAGS=-Wzero-as-null-pointer-constant ... src/nxt_buf.c: In function ‘nxt_buf_mmap_alloc’: src/nxt_buf.h:192:21: error: zero as null pointer constant [-Werror=zero-as-null-pointer-constant] 192 | (bm)->start = 0; \ | ^ src/nxt_buf.c:135:9: note: in expansion of macro ‘nxt_buf_mem_set_size’ 135 | nxt_buf_mem_set_size(&b->mem, size); | ^~~~~~~~~~~~~~~~~~~~ Signed-off-by: Andrew Clayton --- src/python/nxt_python_asgi_websocket.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/python/nxt_python_asgi_websocket.c') diff --git a/src/python/nxt_python_asgi_websocket.c b/src/python/nxt_python_asgi_websocket.c index ab1d0324..e3c37e74 100644 --- a/src/python/nxt_python_asgi_websocket.c +++ b/src/python/nxt_python_asgi_websocket.c @@ -70,10 +70,10 @@ static PyObject *nxt_py_asgi_websocket_done(PyObject *self, PyObject *future); static PyMethodDef nxt_py_asgi_websocket_methods[] = { - { "receive", nxt_py_asgi_websocket_receive, METH_NOARGS, 0 }, - { "send", nxt_py_asgi_websocket_send, METH_O, 0 }, - { "_done", nxt_py_asgi_websocket_done, METH_O, 0 }, - { NULL, NULL, 0, 0 } + { "receive", nxt_py_asgi_websocket_receive, METH_NOARGS, NULL }, + { "send", nxt_py_asgi_websocket_send, METH_O, NULL }, + { "_done", nxt_py_asgi_websocket_done, METH_O, NULL }, + {} }; static PyAsyncMethods nxt_py_asgi_async_methods = { -- cgit