summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_mp.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_mp.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_mp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_mp.c b/src/nxt_mp.c
index d0de2c0e..2bd8cdee 100644
--- a/src/nxt_mp.c
+++ b/src/nxt_mp.c
@@ -155,7 +155,7 @@ static void *nxt_mp_alloc_large(nxt_mp_t *mp, size_t alignment, size_t size,
nxt_bool_t freeable);
static intptr_t nxt_mp_rbtree_compare(nxt_rbtree_node_t *node1,
nxt_rbtree_node_t *node2);
-static nxt_mp_block_t *nxt_mp_find_block(nxt_rbtree_t *tree, u_char *p);
+static nxt_mp_block_t *nxt_mp_find_block(nxt_rbtree_t *tree, const u_char *p);
static const char *nxt_mp_chunk_free(nxt_mp_t *mp, nxt_mp_block_t *cluster,
u_char *p);
@@ -830,7 +830,7 @@ nxt_mp_free(nxt_mp_t *mp, void *p)
static nxt_mp_block_t *
-nxt_mp_find_block(nxt_rbtree_t *tree, u_char *p)
+nxt_mp_find_block(nxt_rbtree_t *tree, const u_char *p)
{
nxt_mp_block_t *block;
nxt_rbtree_node_t *node, *sentinel;