summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conf.c
diff options
context:
space:
mode:
authorAndrew Clayton <andrew@digital-domain.net>2022-06-16 02:00:52 +0100
committerAlejandro Colomar <alx.manpages@gmail.com>2022-06-22 00:30:44 +0200
commit4418f99cd46b17be893b6bd0df56434078e5aad3 (patch)
tree2a9c47681aac7159b088e8ac5925c900d072b0d3 /src/nxt_conf.c
parent637a2006a6c0da5825dd6b04940e05e2c9feda5d (diff)
downloadunit-4418f99cd46b17be893b6bd0df56434078e5aad3.tar.gz
unit-4418f99cd46b17be893b6bd0df56434078e5aad3.tar.bz2
Constified numerous function parameters.
As was pointed out by the cppcheck[0] static code analysis utility we can mark numerous function parameters as 'const'. This acts as 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_conf.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/nxt_conf.c b/src/nxt_conf.c
index 79e776a0..a44b8c75 100644
--- a/src/nxt_conf.c
+++ b/src/nxt_conf.c
@@ -102,7 +102,7 @@ typedef struct {
static nxt_int_t nxt_conf_path_next_token(nxt_conf_path_parse_t *parse,
nxt_str_t *token);
-static u_char *nxt_conf_json_skip_space(u_char *start, u_char *end);
+static u_char *nxt_conf_json_skip_space(u_char *start, const u_char *end);
static u_char *nxt_conf_json_parse_value(nxt_mp_t *mp, nxt_conf_value_t *value,
u_char *start, u_char *end, nxt_conf_json_error_t *error);
static u_char *nxt_conf_json_parse_object(nxt_mp_t *mp, nxt_conf_value_t *value,
@@ -266,7 +266,7 @@ nxt_conf_create_object(nxt_mp_t *mp, nxt_uint_t count)
void
nxt_conf_set_member(nxt_conf_value_t *object, nxt_str_t *name,
- nxt_conf_value_t *value, uint32_t index)
+ const nxt_conf_value_t *value, uint32_t index)
{
nxt_conf_object_member_t *member;
@@ -367,7 +367,7 @@ nxt_conf_create_array(nxt_mp_t *mp, nxt_uint_t count)
void
nxt_conf_set_element(nxt_conf_value_t *array, nxt_uint_t index,
- nxt_conf_value_t *value)
+ const nxt_conf_value_t *value)
{
array->u.array->elements[index] = *value;
}
@@ -1271,7 +1271,7 @@ nxt_conf_json_parse(nxt_mp_t *mp, u_char *start, u_char *end,
static u_char *
-nxt_conf_json_skip_space(u_char *start, u_char *end)
+nxt_conf_json_skip_space(u_char *start, const u_char *end)
{
u_char *p, ch;
@@ -2605,7 +2605,7 @@ nxt_conf_json_escape(u_char *dst, u_char *src, size_t size)
void
-nxt_conf_json_position(u_char *start, u_char *pos, nxt_uint_t *line,
+nxt_conf_json_position(u_char *start, const u_char *pos, nxt_uint_t *line,
nxt_uint_t *column)
{
u_char *p;