From 1ba47e7af9edfa682faba73df8bf0dc240facb19 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 15 Dec 2004 01:38:25 +0000 Subject: Add 'const' to immutable arrays. --- src/main.c | 10 +++++----- src/writeenv.c | 3 ++- src/writeout.c | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/main.c b/src/main.c index 001bbd40c..5bc466ffe 100644 --- a/src/main.c +++ b/src/main.c @@ -1191,7 +1191,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ long-name, boolean whether it takes an additional argument */ - struct LongShort aliases[]= { + static const struct LongShort aliases[]= { /* all these ones, starting with "*" or "$" as a short-option have *no* short option to mention. */ {"*", "url", TRUE}, @@ -2036,7 +2036,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */ const char *name; int bitmask; }; - struct feat feats[] = { + static const struct feat feats[] = { {"AsynchDNS", CURL_VERSION_ASYNCHDNS}, {"Debug", CURL_VERSION_DEBUG}, {"GSS-Negotiate", CURL_VERSION_GSSNEGOTIATE}, @@ -4014,11 +4014,11 @@ char * msdosify (char *file_name) { static char dos_name[PATH_MAX]; - static char illegal_chars_dos[] = ".+, ;=[]|<>\\\":?*"; - static char *illegal_chars_w95 = &illegal_chars_dos[8]; + static const char illegal_chars_dos[] = ".+, ;=[]|<>\\\":?*"; + static const char *illegal_chars_w95 = &illegal_chars_dos[8]; int idx, dot_idx; char *s = file_name, *d = dos_name; - char *illegal_aliens = illegal_chars_dos; + const char *illegal_aliens = illegal_chars_dos; size_t len = sizeof (illegal_chars_dos) - 1; int lfn = 0; diff --git a/src/writeenv.c b/src/writeenv.c index 833d9a679..90d341356 100644 --- a/src/writeenv.c +++ b/src/writeenv.c @@ -26,12 +26,13 @@ #ifdef USE_ENVIRONMENT #include +#include "writeenv.h" #ifdef __riscos__ #include #endif -struct +static const struct { const char * name; CURLINFO id; diff --git a/src/writeout.c b/src/writeout.c index b396eeb70..a7b8729ef 100644 --- a/src/writeout.c +++ b/src/writeout.c @@ -68,7 +68,7 @@ struct variable { }; -static struct variable replacements[]={ +static const struct variable replacements[]={ {"url_effective", VAR_EFFECTIVE_URL}, {"http_code", VAR_HTTP_CODE}, {"time_total", VAR_TOTAL_TIME}, -- cgit v1.2.3