From 4418f99cd46b17be893b6bd0df56434078e5aad3 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Thu, 16 Jun 2022 02:00:52 +0100 Subject: 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/ --- src/nxt_conf.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/nxt_conf.h') diff --git a/src/nxt_conf.h b/src/nxt_conf.h index cfbc5991..46effac4 100644 --- a/src/nxt_conf.h +++ b/src/nxt_conf.h @@ -109,7 +109,7 @@ size_t nxt_conf_json_length(nxt_conf_value_t *value, nxt_conf_json_pretty_t *pretty); u_char *nxt_conf_json_print(u_char *p, nxt_conf_value_t *value, nxt_conf_json_pretty_t *pretty); -void nxt_conf_json_position(u_char *start, u_char *pos, nxt_uint_t *line, +void nxt_conf_json_position(u_char *start, const u_char *pos, nxt_uint_t *line, nxt_uint_t *column); nxt_int_t nxt_conf_validate(nxt_conf_validation_t *vldt); @@ -125,7 +125,7 @@ NXT_EXPORT uint8_t nxt_conf_get_boolean(nxt_conf_value_t *value); NXT_EXPORT nxt_uint_t nxt_conf_object_members_count(nxt_conf_value_t *value); nxt_conf_value_t *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); void nxt_conf_set_member_string(nxt_conf_value_t *object, nxt_str_t *name, nxt_str_t *value, uint32_t index); nxt_int_t nxt_conf_set_member_string_dup(nxt_conf_value_t *object, nxt_mp_t *mp, @@ -137,7 +137,7 @@ void nxt_conf_set_member_null(nxt_conf_value_t *object, nxt_str_t *name, nxt_conf_value_t *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); nxt_int_t nxt_conf_set_element_string_dup(nxt_conf_value_t *array, nxt_mp_t *mp, nxt_uint_t index, nxt_str_t *value); NXT_EXPORT nxt_uint_t nxt_conf_array_elements_count(nxt_conf_value_t *value); -- cgit