diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2024-04-16 20:40:35 +0100 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2024-04-25 15:15:15 +0100 |
commit | 33c978cc24de3110b763354d97a907982f664b23 (patch) | |
tree | 78d7fb1f170e1284bf880b9aa728bb3bf97eb53e | |
parent | 8f861cf4d15e8befca6edcee4b04b5304f082f05 (diff) | |
download | unit-33c978cc24de3110b763354d97a907982f664b23.tar.gz unit-33c978cc24de3110b763354d97a907982f664b23.tar.bz2 |
php: Constify some local static variables
A common pattern was to declare variables in functions like
static nxt_str_t ...
Not sure why static, as they were being treated more like string
literals, let's actually make them constants (qualifier wise).
Reviewed-by: Zhidao HONG <z.hong@f5.com>
Signed-off-by: Andrew Clayton <a.clayton@nginx.com>
-rw-r--r-- | src/nxt_php_sapi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/nxt_php_sapi.c b/src/nxt_php_sapi.c index 77117533..da667b66 100644 --- a/src/nxt_php_sapi.c +++ b/src/nxt_php_sapi.c @@ -377,9 +377,9 @@ nxt_php_setup(nxt_task_t *task, nxt_process_t *process, nxt_conf_value_t *value; nxt_php_app_conf_t *c; - static nxt_str_t file_str = nxt_string("file"); - static nxt_str_t user_str = nxt_string("user"); - static nxt_str_t admin_str = nxt_string("admin"); + static const nxt_str_t file_str = nxt_string("file"); + static const nxt_str_t user_str = nxt_string("user"); + static const nxt_str_t admin_str = nxt_string("admin"); c = &conf->u.php; @@ -529,9 +529,9 @@ nxt_php_set_target(nxt_task_t *task, nxt_php_target_t *target, nxt_int_t ret; nxt_conf_value_t *value; - static nxt_str_t root_str = nxt_string("root"); - static nxt_str_t script_str = nxt_string("script"); - static nxt_str_t index_str = nxt_string("index"); + static const nxt_str_t root_str = nxt_string("root"); + static const nxt_str_t script_str = nxt_string("script"); + static const nxt_str_t index_str = nxt_string("index"); value = nxt_conf_get_object_member(conf, &root_str, NULL); |