Skip to content

Commit

Permalink
Some more variable constification
Browse files Browse the repository at this point in the history
Mostly more 'static nxt_str_t ...'s

Signed-off-by: Andrew Clayton <[email protected]>
  • Loading branch information
ac000 committed Oct 24, 2024
1 parent 76cc071 commit ebd02c6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions src/nxt_cert.c
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,13 @@ nxt_cert_details(nxt_mp_t *mp, nxt_cert_t *cert)
nxt_conf_value_t *object, *chain, *element, *value;
u_char buf[256];

static nxt_str_t key_str = nxt_string("key");
static nxt_str_t chain_str = nxt_string("chain");
static nxt_str_t since_str = nxt_string("since");
static nxt_str_t until_str = nxt_string("until");
static nxt_str_t issuer_str = nxt_string("issuer");
static nxt_str_t subject_str = nxt_string("subject");
static nxt_str_t validity_str = nxt_string("validity");
static const nxt_str_t key_str = nxt_string("key");
static const nxt_str_t chain_str = nxt_string("chain");
static const nxt_str_t since_str = nxt_string("since");
static const nxt_str_t until_str = nxt_string("until");
static const nxt_str_t issuer_str = nxt_string("issuer");
static const nxt_str_t subject_str = nxt_string("subject");
static const nxt_str_t validity_str = nxt_string("validity");

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

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

static nxt_str_t alt_names_str = nxt_string("alt_names");
static const nxt_str_t alt_names_str = nxt_string("alt_names");

count = 0;

Expand Down
10 changes: 5 additions & 5 deletions src/nxt_controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -1078,15 +1078,15 @@ nxt_controller_process_request(nxt_task_t *task, nxt_controller_request_t *req)
#endif

#if (NXT_TLS)
static nxt_str_t certificates = nxt_string("certificates");
static const nxt_str_t certificates = nxt_string("certificates");
#endif

#if (NXT_HAVE_NJS)
static nxt_str_t scripts_str = nxt_string("js_modules");
static const nxt_str_t scripts_str = nxt_string("js_modules");
#endif

static nxt_str_t config = nxt_string("config");
static nxt_str_t status = nxt_string("status");
static const nxt_str_t config = nxt_string("config");
static const nxt_str_t status = nxt_string("status");

c = req->conn;
path = req->parser.path;
Expand Down Expand Up @@ -2302,7 +2302,7 @@ nxt_controller_process_control(nxt_task_t *task,
nxt_conf_value_t *value;
nxt_controller_response_t resp;

static nxt_str_t applications = nxt_string("applications");
static const nxt_str_t applications = nxt_string("applications");

nxt_memzero(&resp, sizeof(nxt_controller_response_t));

Expand Down
4 changes: 2 additions & 2 deletions src/nxt_main_process.c
Original file line number Diff line number Diff line change
Expand Up @@ -1421,8 +1421,8 @@ nxt_main_port_modules_handler(nxt_task_t *task, nxt_port_recv_msg_t *msg)
nxt_conf_value_t *conf, *root, *value, *mounts;
nxt_app_lang_module_t *lang;

static nxt_str_t root_path = nxt_string("/");
static nxt_str_t mounts_name = nxt_string("mounts");
static const nxt_str_t root_path = nxt_string("/");
static const nxt_str_t mounts_name = nxt_string("mounts");

rt = task->thread->runtime;

Expand Down

0 comments on commit ebd02c6

Please sign in to comment.