Skip to content

Use NULL instead of 0 as null pointer constant #1619

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/nxt_buf.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ struct nxt_buf_s {

#define nxt_buf_mem_set_size(bm, size) \
do { \
(bm)->start = 0; \
(bm)->start = NULL; \
(bm)->end = (void *) size; \
} while (0)

Expand Down
2 changes: 1 addition & 1 deletion src/nxt_unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ nxt_unit_ctx_init(nxt_unit_impl_t *lib, nxt_unit_ctx_impl_t *ctx_impl,
ctx_impl->req.req.unit = &lib->unit;

ctx_impl->read_port = NULL;
ctx_impl->requests.slot = 0;
ctx_impl->requests.slot = NULL;

return NXT_UNIT_OK;
}
Expand Down
8 changes: 4 additions & 4 deletions src/python/nxt_python_asgi_http.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ static PyObject *nxt_py_asgi_http_done(PyObject *self, PyObject *future);


static PyMethodDef nxt_py_asgi_http_methods[] = {
{ "receive", nxt_py_asgi_http_receive, METH_NOARGS, 0 },
{ "send", nxt_py_asgi_http_send, METH_O, 0 },
{ "_done", nxt_py_asgi_http_done, METH_O, 0 },
{ NULL, NULL, 0, 0 }
{ "receive", nxt_py_asgi_http_receive, METH_NOARGS, NULL },
{ "send", nxt_py_asgi_http_send, METH_O, NULL },
{ "_done", nxt_py_asgi_http_done, METH_O, NULL },
{}
};

static PyAsyncMethods nxt_py_asgi_async_methods = {
Expand Down
8 changes: 4 additions & 4 deletions src/python/nxt_python_asgi_lifespan.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@ static void nxt_py_asgi_lifespan_dealloc(PyObject *self);


static PyMethodDef nxt_py_asgi_lifespan_methods[] = {
{ "receive", nxt_py_asgi_lifespan_receive, METH_NOARGS, 0 },
{ "send", nxt_py_asgi_lifespan_send, METH_O, 0 },
{ "_done", nxt_py_asgi_lifespan_done, METH_O, 0 },
{ NULL, NULL, 0, 0 }
{ "receive", nxt_py_asgi_lifespan_receive, METH_NOARGS, NULL },
{ "send", nxt_py_asgi_lifespan_send, METH_O, NULL },
{ "_done", nxt_py_asgi_lifespan_done, METH_O, NULL },
{}
};

static PyMemberDef nxt_py_asgi_lifespan_members[] = {
Expand Down
8 changes: 4 additions & 4 deletions src/python/nxt_python_asgi_websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
8 changes: 4 additions & 4 deletions src/python/nxt_python_wsgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ static PyMethodDef nxt_py_write_method[] = {


static PyMethodDef nxt_py_input_methods[] = {
{ "read", (PyCFunction) nxt_py_input_read, METH_VARARGS, 0 },
{ "readline", (PyCFunction) nxt_py_input_readline, METH_VARARGS, 0 },
{ "readlines", (PyCFunction) nxt_py_input_readlines, METH_VARARGS, 0 },
{ NULL, NULL, 0, 0 }
{ "read", (PyCFunction) nxt_py_input_read, METH_VARARGS, NULL },
{ "readline", (PyCFunction) nxt_py_input_readline, METH_VARARGS, NULL },
{ "readlines", (PyCFunction) nxt_py_input_readlines, METH_VARARGS, NULL },
{}
};


Expand Down
2 changes: 1 addition & 1 deletion src/ruby/nxt_ruby.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ nxt_ruby_rack_result_body(nxt_unit_request_info_t *req, VALUE result)
}

} else if (rb_respond_to(body, rb_intern("each"))) {
rb_block_call(body, rb_intern("each"), 0, 0,
rb_block_call(body, rb_intern("each"), 0, NULL,
nxt_ruby_rack_result_body_each, (VALUE) (uintptr_t) req);

} else {
Expand Down