diff options
| author | Andrew Clayton <andrew@digital-domain.net> | 2022-06-09 22:34:34 +0100 |
|---|---|---|
| committer | Andrew Clayton <andrew@digital-domain.net> | 2022-06-15 21:14:25 +0100 |
| commit | 1956745549be6af6134825731caa5ce8aa99ca5c (patch) | |
| tree | 9c0720c1dd0b6c0ddefe27c80d4bf0521a6a8cb7 /src/nxt_unit.c | |
| parent | 6a8081d71e805b12d0f7fd32ce72d60babadfc85 (diff) | |
| download | unit-1956745549be6af6134825731caa5ce8aa99ca5c.tar.gz unit-1956745549be6af6134825731caa5ce8aa99ca5c.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_unit.c | 5 |
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; |
