summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_unit.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_unit.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 'src/nxt_unit.c')
-rw-r--r--src/nxt_unit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nxt_unit.c b/src/nxt_unit.c
index f183ac6e..4be09061 100644
--- a/src/nxt_unit.c
+++ b/src/nxt_unit.c
@@ -196,7 +196,8 @@ static int nxt_unit_request_hash_add(nxt_unit_ctx_t *ctx,
static nxt_unit_request_info_t *nxt_unit_request_hash_find(
nxt_unit_ctx_t *ctx, uint32_t stream, int remove);
-static char * nxt_unit_snprint_prefix(char *p, char *end, pid_t pid, int level);
+static char * nxt_unit_snprint_prefix(char *p, const char *end, pid_t pid,
+ int level);
static void *nxt_unit_lvlhsh_alloc(void *data, size_t size);
static void nxt_unit_lvlhsh_free(void *data, void *p);
static int nxt_unit_memcasecmp(const void *p1, const void *p2, size_t length);
@@ -6666,7 +6667,7 @@ static const char * nxt_unit_log_levels[] = {
static char *
-nxt_unit_snprint_prefix(char *p, char *end, pid_t pid, int level)
+nxt_unit_snprint_prefix(char *p, const char *end, pid_t pid, int level)
{
struct tm tm;
struct timespec ts;