Skip to content
This repository was archived by the owner on Oct 8, 2025. It is now read-only.

Commit ebd02c6

Browse files
committed
Some more variable constification
Mostly more 'static nxt_str_t ...'s Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
1 parent 76cc071 commit ebd02c6

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

src/nxt_cert.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -502,13 +502,13 @@ nxt_cert_details(nxt_mp_t *mp, nxt_cert_t *cert)
502502
nxt_conf_value_t *object, *chain, *element, *value;
503503
u_char buf[256];
504504

505-
static nxt_str_t key_str = nxt_string("key");
506-
static nxt_str_t chain_str = nxt_string("chain");
507-
static nxt_str_t since_str = nxt_string("since");
508-
static nxt_str_t until_str = nxt_string("until");
509-
static nxt_str_t issuer_str = nxt_string("issuer");
510-
static nxt_str_t subject_str = nxt_string("subject");
511-
static nxt_str_t validity_str = nxt_string("validity");
505+
static const nxt_str_t key_str = nxt_string("key");
506+
static const nxt_str_t chain_str = nxt_string("chain");
507+
static const nxt_str_t since_str = nxt_string("since");
508+
static const nxt_str_t until_str = nxt_string("until");
509+
static const nxt_str_t issuer_str = nxt_string("issuer");
510+
static const nxt_str_t subject_str = nxt_string("subject");
511+
static const nxt_str_t validity_str = nxt_string("validity");
512512

513513
object = nxt_conf_create_object(mp, 2);
514514
if (nxt_slow_path(object == NULL)) {
@@ -660,7 +660,7 @@ nxt_cert_name_details(nxt_mp_t *mp, X509 *x509, nxt_bool_t issuer)
660660
STACK_OF(GENERAL_NAME) *alt_names;
661661
u_char buf[256];
662662

663-
static nxt_cert_nid_t nids[] = {
663+
static const nxt_cert_nid_t nids[] = {
664664
{ NID_commonName, nxt_string("common_name") },
665665
{ NID_countryName, nxt_string("country") },
666666
{ NID_stateOrProvinceName, nxt_string("state_or_province") },
@@ -669,7 +669,7 @@ nxt_cert_name_details(nxt_mp_t *mp, X509 *x509, nxt_bool_t issuer)
669669
{ NID_organizationalUnitName, nxt_string("department") },
670670
};
671671

672-
static nxt_str_t alt_names_str = nxt_string("alt_names");
672+
static const nxt_str_t alt_names_str = nxt_string("alt_names");
673673

674674
count = 0;
675675

src/nxt_controller.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1078,15 +1078,15 @@ nxt_controller_process_request(nxt_task_t *task, nxt_controller_request_t *req)
10781078
#endif
10791079

10801080
#if (NXT_TLS)
1081-
static nxt_str_t certificates = nxt_string("certificates");
1081+
static const nxt_str_t certificates = nxt_string("certificates");
10821082
#endif
10831083

10841084
#if (NXT_HAVE_NJS)
1085-
static nxt_str_t scripts_str = nxt_string("js_modules");
1085+
static const nxt_str_t scripts_str = nxt_string("js_modules");
10861086
#endif
10871087

1088-
static nxt_str_t config = nxt_string("config");
1089-
static nxt_str_t status = nxt_string("status");
1088+
static const nxt_str_t config = nxt_string("config");
1089+
static const nxt_str_t status = nxt_string("status");
10901090

10911091
c = req->conn;
10921092
path = req->parser.path;
@@ -2302,7 +2302,7 @@ nxt_controller_process_control(nxt_task_t *task,
23022302
nxt_conf_value_t *value;
23032303
nxt_controller_response_t resp;
23042304

2305-
static nxt_str_t applications = nxt_string("applications");
2305+
static const nxt_str_t applications = nxt_string("applications");
23062306

23072307
nxt_memzero(&resp, sizeof(nxt_controller_response_t));
23082308

src/nxt_main_process.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,8 +1421,8 @@ nxt_main_port_modules_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
14211421
nxt_conf_value_t *conf, *root, *value, *mounts;
14221422
nxt_app_lang_module_t *lang;
14231423

1424-
static nxt_str_t root_path = nxt_string("/");
1425-
static nxt_str_t mounts_name = nxt_string("mounts");
1424+
static const nxt_str_t root_path = nxt_string("/");
1425+
static const nxt_str_t mounts_name = nxt_string("mounts");
14261426

14271427
rt = task->thread->runtime;
14281428

0 commit comments

Comments
 (0)