Marked a couple of variables 'const'.

As was pointed out by the cppcheck[0] static code analysis utility we
can mark a couple of variables 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:
Andrew Clayton
2022-06-16 02:00:53 +01:00
committed by Alejandro Colomar
parent 4418f99cd4
commit 29c7208526
2 changed files with 3 additions and 3 deletions

View File

@@ -22,7 +22,7 @@ nxt_time_parse(const u_char *p, size_t len)
nxt_uint_t year, days; nxt_uint_t year, days;
const u_char *end; const u_char *end;
static nxt_int_t mday[12] = { static const nxt_int_t mday[12] = {
31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
}; };

View File

@@ -11,8 +11,8 @@
static void static void
nxt_websocket_base64_encode(u_char *d, const uint8_t *s, size_t len) nxt_websocket_base64_encode(u_char *d, const uint8_t *s, size_t len)
{ {
u_char c0, c1, c2; u_char c0, c1, c2;
static u_char basis[] = static const u_char basis[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
while (len > 2) { while (len > 2) {