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
@@ -1024,7 +1024,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;
|
||||
@@ -1049,7 +1049,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;
|
||||
|
||||
Reference in New Issue
Block a user