From 5c4911a35e289d1813daeab61bf7e347d7bea3f3 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Fri, 21 Jun 2024 23:56:20 +0100 Subject: [PATCH 1/2] perl: Constify some local static variables These somehow got missed in my previous constification patches... Signed-off-by: Andrew Clayton --- src/perl/nxt_perl_psgi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/perl/nxt_perl_psgi.c b/src/perl/nxt_perl_psgi.c index 807d1741c..271494ac6 100644 --- a/src/perl/nxt_perl_psgi.c +++ b/src/perl/nxt_perl_psgi.c @@ -407,7 +407,7 @@ nxt_perl_psgi_module_create(const char *script) char *buf, *p; size_t length; - static nxt_str_t prefix = nxt_string( + static const nxt_str_t prefix = nxt_string( "package NGINX::Unit::Sandbox;" "sub new {" " return bless {}, $_[0];" @@ -415,7 +415,7 @@ nxt_perl_psgi_module_create(const char *script) "{my $app = do \"" ); - static nxt_str_t suffix = nxt_string_zero( + static const nxt_str_t suffix = nxt_string_zero( "\";" "unless ($app) {" " if($@ || $1) {die $@ || $1}" From ab1b3f9da8cd6d4816f916244a728243e514a544 Mon Sep 17 00:00:00 2001 From: Andrew Clayton Date: Fri, 21 Jun 2024 23:57:44 +0100 Subject: [PATCH 2/2] test/clone: Constify some local static variables These somehow got missed in my previous constification patches... Signed-off-by: Andrew Clayton --- src/test/nxt_clone_test.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/test/nxt_clone_test.c b/src/test/nxt_clone_test.c index 64b9ddeaf..1a864f0e0 100644 --- a/src/test/nxt_clone_test.c +++ b/src/test/nxt_clone_test.c @@ -560,9 +560,9 @@ nxt_clone_test_parse_map(nxt_task_t *task, nxt_str_t *map_str, nxt_runtime_t *rt; nxt_conf_value_t *array, *obj, *value; - static nxt_str_t host_name = nxt_string("host"); - static nxt_str_t cont_name = nxt_string("container"); - static nxt_str_t size_name = nxt_string("size"); + static const nxt_str_t host_name = nxt_string("host"); + static const nxt_str_t cont_name = nxt_string("container"); + static const nxt_str_t size_name = nxt_string("size"); rt = task->thread->runtime;