Skip to content

Commit 95e4dda

Browse files
committed
*) Constify static arrays of string constants.
trunk patch: https://svn.apache.org/r1933659 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1935817 13f79535-47bb-0310-9956-ffa450edef68
1 parent 35a154e commit 95e4dda

14 files changed

Lines changed: 17 additions & 22 deletions

File tree

STATUS

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,6 @@ RELEASE SHOWSTOPPERS:
163163
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
164164
[ start all new proposals below, under PATCHES PROPOSED. ]
165165

166-
*) Constify static arrays of string constants.
167-
trunk patch: https://svn.apache.org/r1933659
168-
2.4.x patch: svn merge -c 1933659 ^/httpd/httpd/trunk .
169-
+1: rjung, jorton, jim
170-
171166
*) include/httpd.h: Define HTTP_EARLY_HINTS (103) per RFC 8297.
172167
modules/http/http_protocol.c (status_lines): Add 103 response.
173168
Needed by backport 1934913 below.

modules/cache/mod_cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static ap_filter_rec_t *cache_invalidate_filter_handle;
3939
/**
4040
* Entity headers' names
4141
*/
42-
static const char *MOD_CACHE_ENTITY_HEADERS[] = {
42+
static const char *const MOD_CACHE_ENTITY_HEADERS[] = {
4343
"Allow",
4444
"Content-Encoding",
4545
"Content-Language",
@@ -819,7 +819,7 @@ static apr_status_t cache_save_filter(ap_filter_t *f, apr_bucket_brigade *in)
819819
apr_time_t exp, date, lastmod, now;
820820
apr_off_t size = -1;
821821
cache_info *info = NULL;
822-
const char *reason, **eh;
822+
const char *reason, *const *eh;
823823
apr_pool_t *p;
824824
apr_bucket *e;
825825
apr_table_t *headers;

modules/filters/mod_proxy_html.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ static void proxy_html_insert(request_rec *r)
13041304
}
13051305
static void proxy_html_hooks(apr_pool_t *p)
13061306
{
1307-
static const char *aszSucc[] = { "mod_filter.c", NULL };
1307+
static const char *const aszSucc[] = { "mod_filter.c", NULL };
13081308
ap_register_output_filter_protocol("proxy-html", proxy_html_filter,
13091309
NULL, AP_FTYPE_RESOURCE,
13101310
AP_FILTER_PROTO_CHANGE|AP_FILTER_PROTO_CHANGE_LENGTH);

modules/http2/h2_protocol.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ const char *H2_MAGIC_TOKEN = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n";
5858
/*******************************************************************************
5959
* HTTP/2 error stuff
6060
*/
61-
static const char *h2_err_descr[] = {
61+
static const char *const h2_err_descr[] = {
6262
"no error", /* 0x0 */
6363
"protocol error",
6464
"internal error",
@@ -91,7 +91,7 @@ const char *h2_protocol_err_description(unsigned int h2_error)
9191
* Black Listed Ciphers from RFC 7549 Appendix A
9292
*
9393
*/
94-
static const char *RFC7540_names[] = {
94+
static const char *const RFC7540_names[] = {
9595
/* ciphers with NULL encrpytion */
9696
"NULL-MD5", /* TLS_NULL_WITH_NULL_NULL */
9797
/* same */ /* TLS_RSA_WITH_NULL_MD5 */

modules/http2/h2_proxy_session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1188,7 +1188,7 @@ static apr_status_t session_shutdown(h2_proxy_session *session, int reason,
11881188
}
11891189

11901190

1191-
static const char *StateNames[] = {
1191+
static const char *const StateNames[] = {
11921192
"INIT", /* H2_PROXYS_ST_INIT */
11931193
"DONE", /* H2_PROXYS_ST_DONE */
11941194
"IDLE", /* H2_PROXYS_ST_IDLE */

modules/http2/h2_session.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ static void on_stream_output(void *ctx, h2_stream *stream)
14161416
}
14171417

14181418

1419-
static const char *StateNames[] = {
1419+
static const char *const StateNames[] = {
14201420
"INIT", /* H2_SESSION_ST_INIT */
14211421
"DONE", /* H2_SESSION_ST_DONE */
14221422
"IDLE", /* H2_SESSION_ST_IDLE */

modules/loggers/mod_logio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ static const command_rec logio_cmds[] = {
254254

255255
static void register_hooks(apr_pool_t *p)
256256
{
257-
static const char *pre[] = { "mod_log_config.c", NULL };
257+
static const char *const pre[] = { "mod_log_config.c", NULL };
258258

259259
ap_hook_pre_connection(logio_pre_conn, NULL, NULL, APR_HOOK_MIDDLE);
260260
ap_hook_pre_config(logio_pre_config, NULL, NULL, APR_HOOK_REALLY_FIRST);

modules/mappers/mod_speling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ typedef enum {
125125
SP_VERYDIFFERENT = 6
126126
} sp_reason;
127127

128-
static const char *sp_reason_str[] =
128+
static const char *const sp_reason_str[] =
129129
{
130130
"identical",
131131
"miscapitalized",

modules/md/md_log.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
#define LOG_BUFFER_LEN 1024
2424

25-
static const char *level_names[] = {
25+
static const char *const level_names[] = {
2626
"emergency",
2727
"alert",
2828
"crit",

modules/md/md_store.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
#define GNAME_STAGING
4848
#define GNAME_ARCHIVE
4949

50-
static const char *GROUP_NAME[] = {
50+
static const char *const GROUP_NAME[] = {
5151
"none",
5252
"accounts",
5353
"challenges",

0 commit comments

Comments
 (0)