From: phk Date: Sun, 9 Nov 2008 13:46:57 +0000 (+0000) Subject: Constifications requested by FlexeLint v9 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b441f029f1bfd3f9f1318d6be0fabf4fd2208e40;p=varnish Constifications requested by FlexeLint v9 git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3363 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache_acceptor.c b/varnish-cache/bin/varnishd/cache_acceptor.c index 119eda77..65955e17 100644 --- a/varnish-cache/bin/varnishd/cache_acceptor.c +++ b/varnish-cache/bin/varnishd/cache_acceptor.c @@ -49,7 +49,7 @@ #include "cache.h" #include "cache_acceptor.h" -static struct acceptor *vca_acceptors[] = { +static struct acceptor * const vca_acceptors[] = { #if defined(HAVE_KQUEUE) &acceptor_kqueue, #endif @@ -63,7 +63,7 @@ static struct acceptor *vca_acceptors[] = { NULL, }; -static struct acceptor *vca_act; +static struct acceptor const *vca_act; static pthread_t vca_thread_acct; static struct timeval tv_sndtimeo; diff --git a/varnish-cache/bin/varnishd/cache_backend_poll.c b/varnish-cache/bin/varnishd/cache_backend_poll.c index 7a812ddf..6f467625 100644 --- a/varnish-cache/bin/varnishd/cache_backend_poll.c +++ b/varnish-cache/bin/varnishd/cache_backend_poll.c @@ -86,7 +86,7 @@ struct vbp_target { static VTAILQ_HEAD(, vbp_target) vbp_list = VTAILQ_HEAD_INITIALIZER(vbp_list); -static char default_request[] = +static const char default_request[] = "GET / HTTP/1.1\r\n" "Connection: close\r\n" "\r\n"; diff --git a/varnish-cache/bin/varnishd/cache_hash.c b/varnish-cache/bin/varnishd/cache_hash.c index 72090082..2ad9551a 100644 --- a/varnish-cache/bin/varnishd/cache_hash.c +++ b/varnish-cache/bin/varnishd/cache_hash.c @@ -66,7 +66,7 @@ #include "cache.h" #include "stevedore.h" -static struct hash_slinger *hash; +static const struct hash_slinger *hash; double HSH_Grace(double g) diff --git a/varnish-cache/bin/varnishd/cache_http.c b/varnish-cache/bin/varnishd/cache_http.c index 18ba655a..ee6d47e2 100644 --- a/varnish-cache/bin/varnishd/cache_http.c +++ b/varnish-cache/bin/varnishd/cache_http.c @@ -65,7 +65,7 @@ LOGMTX2(ax, HTTP_HDR_FIRST, Header), \ } -static enum shmlogtag logmtx[][HTTP_HDR_FIRST + 1] = { +static const enum shmlogtag logmtx[][HTTP_HDR_FIRST + 1] = { [HTTP_Rx] = LOGMTX1(Rx), [HTTP_Tx] = LOGMTX1(Tx), [HTTP_Obj] = LOGMTX1(Obj) diff --git a/varnish-cache/bin/varnishd/mgt_vcc.c b/varnish-cache/bin/varnishd/mgt_vcc.c index 0c2d8402..4c122f95 100644 --- a/varnish-cache/bin/varnishd/mgt_vcc.c +++ b/varnish-cache/bin/varnishd/mgt_vcc.c @@ -78,7 +78,7 @@ char *mgt_cc_cmd; /* * Keep this in synch with man/vcl.7 and etc/default.vcl! */ -static const char *default_vcl = +static const char * const default_vcl = #include "default_vcl.h" "" ; diff --git a/varnish-cache/bin/varnishd/stevedore.c b/varnish-cache/bin/varnishd/stevedore.c index d3c4b3c3..fa89cf1c 100644 --- a/varnish-cache/bin/varnishd/stevedore.c +++ b/varnish-cache/bin/varnishd/stevedore.c @@ -40,7 +40,7 @@ static VTAILQ_HEAD(, stevedore) stevedores = VTAILQ_HEAD_INITIALIZER(stevedores); -static struct stevedore * volatile stv_next; +static const struct stevedore * volatile stv_next; struct storage * STV_alloc(struct sess *sp, size_t size) diff --git a/varnish-cache/bin/varnishd/storage_file.c b/varnish-cache/bin/varnishd/storage_file.c index 08a2ae48..895c2fbe 100644 --- a/varnish-cache/bin/varnishd/storage_file.c +++ b/varnish-cache/bin/varnishd/storage_file.c @@ -233,8 +233,8 @@ smf_initfile(struct smf_sc *sc, const char *size, int newfile) /* XXX: force block allocation here or in open ? */ } -static char default_size[] = "50%"; -static char default_filename[] = "."; +static const char default_size[] = "50%"; +static const char default_filename[] = "."; static void smf_init(struct stevedore *parent, int ac, char * const *av) diff --git a/varnish-cache/lib/libvcl/vcc_token.c b/varnish-cache/lib/libvcl/vcc_token.c index 76e1f528..28811c0d 100644 --- a/varnish-cache/lib/libvcl/vcc_token.c +++ b/varnish-cache/lib/libvcl/vcc_token.c @@ -248,7 +248,7 @@ vcc_ExpectCid(struct tokenlist *tl) static int8_t vcc_xdig(const char c) { - static const char *xdigit = + static const char * const xdigit = "0123456789abcdef" "0123456789ABCDEF"; const char *p;