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_http_static.c | |
| parent | 6a8081d71e805b12d0f7fd32ce72d60babadfc85 (diff) | |
| download | unit-archive/constParameter.tar.gz unit-archive/constParameter.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 'src/nxt_http_static.c')
| -rw-r--r-- | src/nxt_http_static.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nxt_http_static.c b/src/nxt_http_static.c index 61dd0cb3..7c7991fc 100644 --- a/src/nxt_http_static.c +++ b/src/nxt_http_static.c @@ -1023,7 +1023,7 @@ typedef struct { nxt_int_t nxt_http_static_mtypes_hash_add(nxt_mp_t *mp, nxt_lvlhsh_t *hash, - nxt_str_t *exten, nxt_str_t *type) + const nxt_str_t *exten, nxt_str_t *type) { nxt_lvlhsh_query_t lhq; nxt_http_static_mtype_t *mtype; @@ -1048,7 +1048,7 @@ nxt_http_static_mtypes_hash_add(nxt_mp_t *mp, nxt_lvlhsh_t *hash, nxt_str_t * -nxt_http_static_mtype_get(nxt_lvlhsh_t *hash, nxt_str_t *exten) +nxt_http_static_mtype_get(nxt_lvlhsh_t *hash, const nxt_str_t *exten) { nxt_lvlhsh_query_t lhq; nxt_http_static_mtype_t *mtype; |
