Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some more variable constification #1466

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading