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/
This commit is contained in:
committed by
Alejandro Colomar
parent
637a2006a6
commit
4418f99cd4
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user