From: phk Date: Fri, 20 Feb 2009 19:06:07 +0000 (+0000) Subject: Some constifications X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e164df93bcd0bdd05ac19b45697118017a291c5b;p=varnish Some constifications git-svn-id: svn+ssh://projects.linpro.no/svn/varnish/trunk@3802 d4fa192b-c00b-0410-8231-f00ffab90ce4 --- diff --git a/varnish-cache/bin/varnishd/cache.h b/varnish-cache/bin/varnishd/cache.h index af1a2945..0993301d 100644 --- a/varnish-cache/bin/varnishd/cache.h +++ b/varnish-cache/bin/varnishd/cache.h @@ -564,7 +564,7 @@ void PipeSession(struct sess *sp); void WRK_Init(void); int WRK_Queue(struct workreq *wrq); void WRK_QueueSession(struct sess *sp); -void WRK_SumStat(struct worker *w); +void WRK_SumStat(const struct worker *w); void WRW_Reserve(struct worker *w, int *fd); void WRW_Release(struct worker *w); diff --git a/varnish-cache/bin/varnishd/cache_hash.c b/varnish-cache/bin/varnishd/cache_hash.c index cd0e12fe..2ac8f667 100644 --- a/varnish-cache/bin/varnishd/cache_hash.c +++ b/varnish-cache/bin/varnishd/cache_hash.c @@ -162,7 +162,7 @@ HSH_Cleanup(struct worker *w) } void -HSH_DeleteObjHead(struct worker *w, struct objhead *oh) +HSH_DeleteObjHead(const struct worker *w, struct objhead *oh) { AZ(oh->refcnt); @@ -478,7 +478,7 @@ HSH_Ref(struct object *o) } void -HSH_Deref(struct worker *w, struct object **oo) +HSH_Deref(const struct worker *w, struct object **oo) { struct object *o; struct objhead *oh; diff --git a/varnish-cache/bin/varnishd/cache_pool.c b/varnish-cache/bin/varnishd/cache_pool.c index 866af943..a45a7300 100644 --- a/varnish-cache/bin/varnishd/cache_pool.c +++ b/varnish-cache/bin/varnishd/cache_pool.c @@ -266,12 +266,12 @@ WRW_Sendfile(struct worker *w, int fd, off_t off, unsigned len) /*--------------------------------------------------------------------*/ static void -wrk_sumstat(struct worker *w) +wrk_sumstat(const struct worker *w) { Lck_AssertHeld(&wstat_mtx); #define L0(n) -#define L1(n) VSL_stats->n += w->stats->n +#define L1(n) (VSL_stats->n += w->stats->n) #define MAC_STAT(n, t, l, f, d) L##l(n); #include "stat_field.h" #undef MAC_STAT @@ -281,7 +281,7 @@ wrk_sumstat(struct worker *w) } void -WRK_SumStat(struct worker *w) +WRK_SumStat(const struct worker *w) { Lck_Lock(&wstat_mtx); wrk_sumstat(w); diff --git a/varnish-cache/bin/varnishd/hash_slinger.h b/varnish-cache/bin/varnishd/hash_slinger.h index c6f8df15..602e3a30 100644 --- a/varnish-cache/bin/varnishd/hash_slinger.h +++ b/varnish-cache/bin/varnishd/hash_slinger.h @@ -100,6 +100,6 @@ struct objhead { }; extern unsigned save_hash; -void HSH_DeleteObjHead(struct worker *w, struct objhead *oh); -void HSH_Deref(struct worker *w, struct object **o); +void HSH_DeleteObjHead(const struct worker *w, struct objhead *oh); +void HSH_Deref(const struct worker *w, struct object **o); #endif /* VARNISH_CACHE_CHILD */