summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port_socket.c
diff options
context:
space:
mode:
authorAndrew Clayton <andrew@digital-domain.net>2022-06-09 22:34:34 +0100
committerAndrew Clayton <andrew@digital-domain.net>2022-06-15 21:14:25 +0100
commit1956745549be6af6134825731caa5ce8aa99ca5c (patch)
tree9c0720c1dd0b6c0ddefe27c80d4bf0521a6a8cb7 /src/nxt_port_socket.c
parent6a8081d71e805b12d0f7fd32ce72d60babadfc85 (diff)
downloadunit-archive/constParameter.tar.gz
unit-archive/constParameter.tar.bz2
Constified numerous function parameters.archive/constParameter
As was pointed out by the cppcheck[0] static code analysis utility we can mark numerous function parameters as 'const'. This acts a hint to the compiler about our intentions and the compiler will tell us when we deviate from them. [0]: https://cppcheck.sourceforge.io/
Diffstat (limited to '')
-rw-r--r--src/nxt_port_socket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_port_socket.c b/src/nxt_port_socket.c
index 2a51dfb6..5752d5ab 100644
--- a/src/nxt_port_socket.c
+++ b/src/nxt_port_socket.c
@@ -19,7 +19,7 @@ static uint8_t nxt_port_enqueue_buf(nxt_task_t *task, nxt_port_msg_t *pm,
void *qbuf, nxt_buf_t *b);
static nxt_int_t nxt_port_msg_chk_insert(nxt_task_t *task, nxt_port_t *port,
nxt_port_send_msg_t *msg);
-static nxt_port_send_msg_t *nxt_port_msg_alloc(nxt_port_send_msg_t *m);
+static nxt_port_send_msg_t *nxt_port_msg_alloc(const nxt_port_send_msg_t *m);
static void nxt_port_write_handler(nxt_task_t *task, void *obj, void *data);
static nxt_port_send_msg_t *nxt_port_msg_first(nxt_port_t *port);
nxt_inline void nxt_port_msg_close_fd(nxt_port_send_msg_t *msg);
@@ -332,7 +332,7 @@ nxt_port_msg_chk_insert(nxt_task_t *task, nxt_port_t *port,
static nxt_port_send_msg_t *
-nxt_port_msg_alloc(nxt_port_send_msg_t *m)
+nxt_port_msg_alloc(const nxt_port_send_msg_t *m)
{
nxt_port_send_msg_t *msg;