]> granicus.if.org Git - apache/commitdiff
Fix string constness to get rid of gcc compiler warnings by -Wwrite-strings.
authorTakashi Sato <takashi@apache.org>
Tue, 29 Dec 2009 12:34:26 +0000 (12:34 +0000)
committerTakashi Sato <takashi@apache.org>
Tue, 29 Dec 2009 12:34:26 +0000 (12:34 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@894368 13f79535-47bb-0310-9956-ffa450edef68

server/core.c
server/log.c
server/request.c
server/util_cookies.c
server/util_script.c

index b942e1e52a7b2810d26e895b6d20882fc0e09f8b..7c37861aaf251f9a584ecd9b0b69b096f15e0ae3 100644 (file)
@@ -2682,7 +2682,7 @@ AP_DECLARE(const char *) ap_psignature(const char *prefix, request_rec *r)
 
 static char *server_banner = NULL;
 static int banner_locked = 0;
-static char *server_description = NULL;
+static const char *server_description = NULL;
 
 enum server_token_type {
     SrvTk_MAJOR,         /* eg: Apache/2 */
index 3733797dfdf5bf98463a474b356a1720b1b3bdaf..7e224a6d02b32d8240ef58abb49cbc4930bfba94 100644 (file)
@@ -50,8 +50,8 @@
 #include "ap_mpm.h"
 
 typedef struct {
-    char    *t_name;
-    int      t_val;
+    const char *t_name;
+    int t_val;
 } TRANS;
 
 APR_HOOK_STRUCT(
index f34f9f5723f4ff1aa948854456365b977d65f275..97e0803c2f2f5628deb1f495f6bf31226b6b16bc 100644 (file)
@@ -89,7 +89,7 @@ static int auth_internal_per_conf_hooks = 0;
 static int auth_internal_per_conf_providers = 0;
 
 
-static int decl_die(int status, char *phase, request_rec *r)
+static int decl_die(int status, const char *phase, request_rec *r)
 {
     if (status == DECLINED) {
         ap_log_rerror(APLOG_MARK, APLOG_CRIT, 0, r,
index 82afba1b6837fa6a1911500b0fb07bd58f658865..8f1504c7bd2bcba48fb2ff442539adf15ea02bbc 100644 (file)
@@ -35,8 +35,8 @@ AP_DECLARE(apr_status_t) ap_cookie_write(request_rec * r, const char *name, cons
                                          const char *attrs, long maxage, ...)
 {
 
-    char *buffer;
-    char *rfc2109;
+    const char *buffer;
+    const char *rfc2109;
     apr_table_t *t;
     va_list vp;
 
@@ -79,8 +79,8 @@ AP_DECLARE(apr_status_t) ap_cookie_write2(request_rec * r, const char *name2, co
                                           const char *attrs2, long maxage, ...)
 {
 
-    char *buffer;
-    char *rfc2965;
+    const char *buffer;
+    const char *rfc2965;
     apr_table_t *t;
     va_list vp;
 
@@ -121,7 +121,7 @@ AP_DECLARE(apr_status_t) ap_cookie_remove(request_rec * r, const char *name, con
     va_list vp;
 
     /* create RFC2109 compliant cookie */
-    char *rfc2109 = apr_pstrcat(r->pool, name, "=;Max-Age=0;",
+    const char *rfc2109 = apr_pstrcat(r->pool, name, "=;Max-Age=0;",
                                 attrs ? attrs : CLEAR_ATTRS, NULL);
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, LOG_PREFIX
                   "user '%s' removed cookie: '%s'", r->user, rfc2109);
@@ -149,7 +149,7 @@ AP_DECLARE(apr_status_t) ap_cookie_remove2(request_rec * r, const char *name2, c
     va_list vp;
 
     /* create RFC2965 compliant cookie */
-    char *rfc2965 = apr_pstrcat(r->pool, name2, "=;Max-Age=0;",
+    const char *rfc2965 = apr_pstrcat(r->pool, name2, "=;Max-Age=0;",
                                 attrs2 ? attrs2 : CLEAR_ATTRS, NULL);
     ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, LOG_PREFIX
                   "user '%s' removed cookie2: '%s'", r->user, rfc2965);
@@ -178,7 +178,7 @@ static int extract_cookie_line(ap_cookie_do * v, const char *key, const char *va
     char *cookie = apr_pstrdup(v->r->pool, val);
     const char *name = apr_pstrcat(v->r->pool, v->name ? v->name : "", "=", NULL);
     size_t len = strlen(name);
-    char *new_cookie = "";
+    const char *new_cookie = "";
     const char *comma = ",";
     char *next1;
     const char *semi = ";";
index 58983079de8c923e0bbb45c3df43f0a11eded4b1..0a7a8a6dd57ff522b47debe0c785cde910dec52e 100644 (file)
@@ -121,9 +121,9 @@ AP_DECLARE(void) ap_add_common_vars(request_rec *r)
     server_rec *s = r->server;
     conn_rec *c = r->connection;
     const char *rem_logname;
-    char *env_path;
+    const char *env_path;
 #if defined(WIN32) || defined(OS2)
-    char *env_temp;
+    const char *env_temp;
 #endif
     const char *host;
     const apr_array_header_t *hdrs_arr = apr_table_elts(r->headers_in);