r5546 - in trunk/varnish-cache: bin/varnishd include

phk at varnish-cache.org phk at varnish-cache.org
Tue Nov 16 15:09:28 CET 2010


Author: phk
Date: 2010-11-16 15:09:28 +0100 (Tue, 16 Nov 2010)
New Revision: 5546

Modified:
   trunk/varnish-cache/bin/varnishd/cache.h
   trunk/varnish-cache/bin/varnishd/cache_backend.c
   trunk/varnish-cache/bin/varnishd/cache_backend.h
   trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c
   trunk/varnish-cache/bin/varnishd/cache_ban.c
   trunk/varnish-cache/bin/varnishd/cache_dir_dns.c
   trunk/varnish-cache/bin/varnishd/cache_dir_random.c
   trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
   trunk/varnish-cache/bin/varnishd/cache_expire.c
   trunk/varnish-cache/bin/varnishd/cache_fetch.c
   trunk/varnish-cache/bin/varnishd/cache_hash.c
   trunk/varnish-cache/bin/varnishd/cache_http.c
   trunk/varnish-cache/bin/varnishd/cache_lck.c
   trunk/varnish-cache/bin/varnishd/cache_vrt.c
   trunk/varnish-cache/bin/varnishd/cache_vrt_var.c
   trunk/varnish-cache/bin/varnishd/common.h
   trunk/varnish-cache/bin/varnishd/hash_slinger.h
   trunk/varnish-cache/bin/varnishd/mgt_child.c
   trunk/varnish-cache/bin/varnishd/mgt_vcc.c
   trunk/varnish-cache/bin/varnishd/stevedore.c
   trunk/varnish-cache/bin/varnishd/stevedore.h
   trunk/varnish-cache/bin/varnishd/storage_file.c
   trunk/varnish-cache/bin/varnishd/storage_malloc.c
   trunk/varnish-cache/bin/varnishd/storage_persistent.c
   trunk/varnish-cache/bin/varnishd/storage_umem.c
   trunk/varnish-cache/include/vrt.h
Log:
Introduce the __match_proto__() macro, to mark functions which have to
match a externally imposed prototype and which are therefore not subject
to argument refinements such as constification.

Define it so FlexeLint supresses 818, and remove manual 818 suppressions
througout.

Constify what we can.



Modified: trunk/varnish-cache/bin/varnishd/cache.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache.h	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache.h	2010-11-16 14:09:28 UTC (rev 5546)
@@ -839,4 +839,3 @@
 	CHECK_OBJ_NOTNULL(o->objcore, OBJCORE_MAGIC);
 	return (o->objcore->flags & OC_F_BUSY);
 }
-

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -463,7 +463,7 @@
  *
  */
 
-static struct vbc *
+static struct vbc * __match_proto__(vdi_getfd_f)
 vdi_simple_getfd(const struct director *d, struct sess *sp)
 {
 	struct vdi_simple *vs;
@@ -492,9 +492,8 @@
 	return (vbe_Healthy(now, target, vs));
 }
 
-/*lint -e{818} not const-able */
 static void
-vdi_simple_fini(struct director *d)
+vdi_simple_fini(const struct director *d)
 {
 	struct vdi_simple *vs;
 

Modified: trunk/varnish-cache/bin/varnishd/cache_backend.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend.h	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_backend.h	2010-11-16 14:09:28 UTC (rev 5546)
@@ -78,7 +78,7 @@
  */
 
 typedef struct vbc *vdi_getfd_f(const struct director *, struct sess *sp);
-typedef void vdi_fini_f(struct director *);
+typedef void vdi_fini_f(const struct director *);
 typedef unsigned vdi_healthy(double now, const struct director *,
     uintptr_t target);
 

Modified: trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_backend_cfg.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -273,6 +273,7 @@
 	ASSERT_CLI();
 	CHECK_OBJ_NOTNULL(b, DIRECTOR_MAGIC);
 	b->fini(b);
+	b->priv = NULL;
 }
 
 /*--------------------------------------------------------------------*/

Modified: trunk/varnish-cache/bin/varnishd/cache_ban.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_ban.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_ban.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -487,7 +487,7 @@
  * Ban tail lurker thread
  */
 
-static void *
+static void * __match_proto__(bgthread_t)
 ban_lurker(struct sess *sp, void *priv)
 {
 	struct ban *b, *bf;

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_dns.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_dns.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_dns.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -424,9 +424,8 @@
 	*/
 }
 
-/*lint -e{818} not const-able */
 static void
-vdi_dns_fini(struct director *d)
+vdi_dns_fini(const struct director *d)
 {
 	struct vdi_dns *vs;
 

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_random.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_random.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_random.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -203,9 +203,8 @@
 	return 0;
 }
 
-/*lint -e{818} not const-able */
 static void
-vdi_random_fini(struct director *d)
+vdi_random_fini(const struct director *d)
 {
 	struct vdi_random *vs;
 

Modified: trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_dir_round_robin.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -102,9 +102,8 @@
 	return 0;
 }
 
-/*lint -e{818} not const-able */
 static void
-vdi_round_robin_fini(struct director *d)
+vdi_round_robin_fini(const struct director *d)
 {
 	struct vdi_round_robin *vs;
 

Modified: trunk/varnish-cache/bin/varnishd/cache_expire.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_expire.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_expire.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -246,7 +246,7 @@
  * discarded.
  */
 
-static void *
+static void * __match_proto__(void *start_routine(void *))
 exp_timer(struct sess *sp, void *priv)
 {
 	struct objcore *oc;

Modified: trunk/varnish-cache/bin/varnishd/cache_fetch.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_fetch.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_fetch.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -47,7 +47,7 @@
 /*--------------------------------------------------------------------*/
 
 static int
-fetch_straight(struct sess *sp, struct http_conn *htc, const char *b)
+fetch_straight(const struct sess *sp, struct http_conn *htc, const char *b)
 {
 	int i;
 	unsigned char *p;
@@ -92,7 +92,7 @@
 /* XXX: Cleanup.  It must be possible somehow :-( */
 
 static int
-fetch_chunked(struct sess *sp, struct http_conn *htc)
+fetch_chunked(const struct sess *sp, struct http_conn *htc)
 {
 	int i;
 	char *q;
@@ -240,7 +240,7 @@
 }
 
 static int
-fetch_eof(struct sess *sp, struct http_conn *htc)
+fetch_eof(const struct sess *sp, struct http_conn *htc)
 {
 	int i;
 	unsigned char *p;

Modified: trunk/varnish-cache/bin/varnishd/cache_hash.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_hash.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -75,7 +75,7 @@
  * Default objcore methods
  */
 
-static struct object *
+static struct object * __match_proto__(getobj_f)
 default_oc_getobj(struct worker *wrk, struct objcore *oc)
 {
 	struct object *o;
@@ -538,7 +538,7 @@
  */
 
 void
-HSH_Purge(struct sess *sp, struct objhead *oh, double ttl, double grace)
+HSH_Purge(const struct sess *sp, struct objhead *oh, double ttl, double grace)
 {
 	struct objcore *oc, **ocp;
 	unsigned spc, nobj, n;
@@ -698,7 +698,7 @@
  */
 
 void
-HSH_FindBan(struct sess *sp, struct objcore **oc)
+HSH_FindBan(const struct sess *sp, struct objcore **oc)
 {
 	struct objcore *oc1, *oc2;
 	struct objhead *oh;
@@ -715,7 +715,7 @@
 		if (oc1 == oc2)
 			break;
 	if (oc2 != NULL)
-		oc_getobj(sp->wrk, oc2);
+		(void)oc_getobj(sp->wrk, oc2);
 	if (oc2 != NULL)
 		oc2->refcnt++;
 	Lck_Unlock(&oh->mtx);

Modified: trunk/varnish-cache/bin/varnishd/cache_http.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_http.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_http.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -206,7 +206,7 @@
 			if (b + x < e) {
 				memcpy(b, hp->hd[f].b, x);
 				b += x;
-			} else 
+			} else
 				b = e;
 		}
 
@@ -220,7 +220,7 @@
 		if (b + x < e) {
 			memcpy(b, hp->hd[u].b + *hdr, x);
 			b += x;
-		} else 
+		} else
 			b = e;
 
 		/* Shift remaining headers up one slot */

Modified: trunk/varnish-cache/bin/varnishd/cache_lck.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_lck.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_lck.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -45,7 +45,6 @@
 #include "cache.h"
 
 /*The constability of lck depends on platform pthreads implementation */
-/*lint -save -esym(818,lck) */
 
 struct ilck {
 	unsigned		magic;
@@ -63,7 +62,7 @@
 
 static pthread_mutex_t		lck_mtx;
 
-void
+void __match_proto__()
 Lck__Lock(struct lock *lck, const char *p, const char *f, int l)
 {
 	struct ilck *ilck;
@@ -95,7 +94,7 @@
 	ilck->held = 1;
 }
 
-void
+void __match_proto__()
 Lck__Unlock(struct lock *lck, const char *p, const char *f, int l)
 {
 	struct ilck *ilck;
@@ -109,7 +108,7 @@
 		VSL(SLT_Debug, 0, "MTX_UNLOCK(%s,%s,%d,%s)", p, f, l, ilck->w);
 }
 
-int
+int __match_proto__()
 Lck__Trylock(struct lock *lck, const char *p, const char *f, int l)
 {
 	struct ilck *ilck;
@@ -143,7 +142,7 @@
 		    !pthread_equal(ilck->owner, pthread_self()));
 }
 
-void
+void __match_proto__()
 Lck_CondWait(pthread_cond_t *cond, struct lock *lck)
 {
 	struct ilck *ilck;
@@ -206,5 +205,3 @@
 #include "locks.h"
 #undef LOCK
 }
-
-/*lint -restore */

Modified: trunk/varnish-cache/bin/varnishd/cache_vrt.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -53,9 +53,6 @@
 #include "hash_slinger.h"
 #include "cache_backend.h"
 
-/*XXX: sort of a hack, improve the Tcl code in the compiler to avoid */
-/*lint -save -esym(818,sp) */
-
 const void * const vrt_magic_string_end = &vrt_magic_string_end;
 
 /*--------------------------------------------------------------------*/
@@ -140,7 +137,6 @@
  * XXX: Optimize the single element case ?
  */
 
-/*lint -e{818} ap,hp could be const */
 char *
 VRT_StringList(char *d, unsigned dl, const char *p, va_list ap)
 {
@@ -161,9 +157,9 @@
 	if (b < e)
 		*b = '\0';
 	b++;
-	if (b > e) 
+	if (b > e)
 		return (NULL);
-	else 
+	else
 		return (b);
 }
 
@@ -171,7 +167,6 @@
  * XXX: Optimize the single element case ?
  */
 
-/*lint -e{818} ap,hp could be const */
 char *
 VRT_String(struct ws *ws, const char *h, const char *p, va_list ap)
 {
@@ -194,7 +189,7 @@
 	if (b == NULL || b == e) {
 		WS_Release(ws, 0);
 		return (NULL);
-	} 
+	}
 	e = b;
 	b = ws->f;
 	WS_Release(ws, e - b);
@@ -205,9 +200,9 @@
  * XXX: Optimize the single element case ?
  */
 
-/*lint -e{818} ap,hp could be const */
 static char *
-vrt_assemble_string(struct http *hp, const char *h, const char *p, va_list ap)
+vrt_assemble_string(const struct http *hp, const char *h, const char *p,
+    va_list ap)
 {
 
 	return (VRT_String(hp->ws, h, p, ap));
@@ -273,7 +268,7 @@
  */
 
 void
-VRT_hashdata(struct sess *sp, const char *str, ...)
+VRT_hashdata(const struct sess *sp, const char *str, ...)
 {
 	va_list ap;
 	const char *p;
@@ -364,7 +359,7 @@
 }
 
 const char *
-VRT_backend_string(struct sess *sp, const struct director *d)
+VRT_backend_string(const struct sess *sp, const struct director *d)
 {
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
 	if (d == NULL)
@@ -395,7 +390,7 @@
 /*--------------------------------------------------------------------*/
 
 void
-VRT_ESI(struct sess *sp)
+VRT_ESI(const struct sess *sp)
 {
 
 	if (sp->cur_method != VCL_MET_FETCH) {
@@ -410,9 +405,8 @@
 
 /*--------------------------------------------------------------------*/
 
-/*lint -e{818} sp could be const */
 void
-VRT_panic(struct sess *sp, const char *str, ...)
+VRT_panic(const struct sess *sp, const char *str, ...)
 {
 	va_list ap;
 	char *b;
@@ -425,9 +419,8 @@
 
 /*--------------------------------------------------------------------*/
 
-/*lint -e{818} sp could be const */
 void
-VRT_synth_page(struct sess *sp, unsigned flags, const char *str, ...)
+VRT_synth_page(const struct sess *sp, unsigned flags, const char *str, ...)
 {
 	va_list ap;
 	const char *p;
@@ -543,7 +536,7 @@
  */
 
 void
-VRT_purge(struct sess *sp, double ttl, double grace)
+VRT_purge(const struct sess *sp, double ttl, double grace)
 {
 	if (sp->cur_method == VCL_MET_HIT)
 		HSH_Purge(sp, sp->obj->objcore->objhead, ttl, grace);
@@ -569,5 +562,3 @@
 
 	(void)memmove(dst, src, len);
 }
-
-/*lint -restore */

Modified: trunk/varnish-cache/bin/varnishd/cache_vrt_var.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/cache_vrt_var.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/cache_vrt_var.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -49,7 +49,7 @@
 /*--------------------------------------------------------------------*/
 
 static void
-vrt_do_string(struct worker *w, int fd, struct http *hp, int fld,
+vrt_do_string(struct worker *w, int fd, const struct http *hp, int fld,
     const char *err, const char *p, va_list ap)
 {
 	char *b;
@@ -199,7 +199,7 @@
 
 /*--------------------------------------------------------------------*/
 
-const char *
+const char * __match_proto__()
 VRT_r_client_identity(struct sess *sp)
 {
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -260,7 +260,7 @@
 /*--------------------------------------------------------------------*/
 
 #define BEREQ_TIMEOUT(which)					\
-void								\
+void __match_proto__()						\
 VRT_l_bereq_##which(struct sess *sp, double num)		\
 {								\
 								\
@@ -268,7 +268,7 @@
 	sp->wrk->which = (num > 0.0 ? num : 0.0);		\
 }								\
 								\
-double								\
+double __match_proto__()					\
 VRT_r_bereq_##which(struct sess *sp)				\
 {								\
 								\
@@ -373,8 +373,7 @@
 	sp->director = be;
 }
 
-/*lint -e{818} sp could be const */
-struct director *
+struct director * __match_proto__()
 VRT_r_req_backend(struct sess *sp)
 {
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -395,7 +394,7 @@
 		sp->disable_esi = !process_esi;
 }
 
-unsigned
+unsigned __match_proto__()
 VRT_r_req_esi(struct sess *sp)
 {
 	CHECK_OBJ_NOTNULL(sp, SESS_MAGIC);
@@ -415,7 +414,7 @@
 /*--------------------------------------------------------------------*/
 
 #define VRT_DO_GRACE(which, fld, extra)				\
-void								\
+void __match_proto__()						\
 VRT_l_##which##_grace(struct sess *sp, double a)		\
 {								\
 								\
@@ -424,7 +423,7 @@
 	extra;							\
 }								\
 								\
-double								\
+double __match_proto__()					\
 VRT_r_##which##_grace(struct sess *sp)				\
 {								\
 								\
@@ -442,8 +441,7 @@
  * req.xid
  */
 
-/*lint -e{818} sp could be const */
-const char *
+const char * __match_proto__()
 VRT_r_req_xid(struct sess *sp)
 {
 	char *p;
@@ -459,7 +457,7 @@
 /*--------------------------------------------------------------------*/
 
 #define REQ_BOOL(which)						\
-void								\
+void __match_proto__()						\
 VRT_l_req_##which(struct sess *sp, unsigned val)		\
 {								\
 								\
@@ -467,7 +465,7 @@
 	sp->which = val ? 1 : 0;				\
 }								\
 								\
-unsigned							\
+unsigned __match_proto__()					\
 VRT_r_req_##which(struct sess *sp)				\
 {								\
 								\

Modified: trunk/varnish-cache/bin/varnishd/common.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/common.h	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/common.h	2010-11-16 14:09:28 UTC (rev 5546)
@@ -47,6 +47,10 @@
 
 #define TRUST_ME(ptr)	((void*)(uintptr_t)(ptr))
 
+
+/* Help shut up FlexeLint */
+#define __match_proto__(xxx) /*lint -e{818} */
+
 /* Really belongs in mgt.h, but storage_file chokes on both */
 void mgt_child_inherit(int fd, const char *what);
 

Modified: trunk/varnish-cache/bin/varnishd/hash_slinger.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/hash_slinger.h	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/hash_slinger.h	2010-11-16 14:09:28 UTC (rev 5546)
@@ -62,9 +62,9 @@
 void HSH_Init(void);
 void HSH_AddString(const struct sess *sp, const char *str);
 void HSH_DerefObjCore(struct worker *sp, struct objcore *oc);
-void HSH_FindBan(struct sess *sp, struct objcore **oc);
+void HSH_FindBan(const struct sess *sp, struct objcore **oc);
 struct objcore *HSH_Insert(const struct sess *sp);
-void HSH_Purge(struct sess *, struct objhead *, double ttl, double grace);
+void HSH_Purge(const struct sess *, struct objhead *, double ttl, double grace);
 void HSH_config(const char *h_arg);
 
 #ifdef VARNISH_CACHE_CHILD

Modified: trunk/varnish-cache/bin/varnishd/mgt_child.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_child.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/mgt_child.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -645,8 +645,7 @@
 
 /*--------------------------------------------------------------------*/
 
-/*lint -e{818} priv could be const */
-void
+void __match_proto__(cli_func_t)
 mcf_server_startstop(struct cli *cli, const char * const *av, void *priv)
 {
 

Modified: trunk/varnish-cache/bin/varnishd/mgt_vcc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/mgt_vcc.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -187,7 +187,7 @@
  * Attempt to open compiled VCL in a sub-process
  */
 
-static void
+static void __match_proto__(sub_func_f)
 run_dlopen(void *priv)
 {
 	const char *of;

Modified: trunk/varnish-cache/bin/varnishd/stevedore.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/stevedore.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -98,8 +98,8 @@
 /*********************************************************************/
 
 static void
-STV_InitObj(struct sess *sp, struct object *o, unsigned wsl, unsigned lhttp,
-    unsigned nhttp)
+STV_InitObj(const struct sess *sp, struct object *o, unsigned wsl,
+    unsigned lhttp, unsigned nhttp)
 {
 
 	memset(o, 0, sizeof *o);
@@ -123,7 +123,7 @@
 /*********************************************************************/
 
 struct object *
-STV_NewObject(struct sess *sp, unsigned l, double ttl, unsigned nhttp)
+STV_NewObject(const struct sess *sp, unsigned l, double ttl, unsigned nhttp)
 {
 	struct object *o;
 	struct storage *st;
@@ -161,7 +161,7 @@
 /*********************************************************************/
 
 struct storage *
-STV_alloc(struct sess *sp, size_t size, struct objcore *oc)
+STV_alloc(const struct sess *sp, size_t size, struct objcore *oc)
 {
 	struct storage *st;
 	struct stevedore *stv = NULL;

Modified: trunk/varnish-cache/bin/varnishd/stevedore.h
===================================================================
--- trunk/varnish-cache/bin/varnishd/stevedore.h	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/stevedore.h	2010-11-16 14:09:28 UTC (rev 5546)
@@ -67,9 +67,9 @@
 	char			ident[16];	/* XXX: match vsm_chunk.ident */
 };
 
-struct object *STV_NewObject(struct sess *sp, unsigned len, double ttl,
+struct object *STV_NewObject(const struct sess *sp, unsigned len, double ttl,
     unsigned nhttp);
-struct storage *STV_alloc(struct sess *sp, size_t size, struct objcore *oc);
+struct storage *STV_alloc(const struct sess *sp, size_t size, struct objcore *oc);
 void STV_trim(struct storage *st, size_t size);
 void STV_free(struct storage *st);
 void STV_open(void);

Modified: trunk/varnish-cache/bin/varnishd/storage_file.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_file.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/storage_file.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -526,8 +526,7 @@
 
 /*--------------------------------------------------------------------*/
 
-/*lint -e{818} not const-able */
-static void
+static void __match_proto__(storage_free_f)
 smf_free(struct storage *s)
 {
 	struct smf *smf;

Modified: trunk/varnish-cache/bin/varnishd/storage_malloc.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_malloc.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/storage_malloc.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -105,8 +105,7 @@
 	return (&sma->s);
 }
 
-/*lint -e{818} not const-able */
-static void
+static void __match_proto__(storage_free_f)
 sma_free(struct storage *s)
 {
 	struct sma_sc *sma_sc;

Modified: trunk/varnish-cache/bin/varnishd/storage_persistent.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_persistent.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/storage_persistent.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -877,7 +877,7 @@
  */
 
 static void
-smp_load_seg(struct sess *sp, const struct smp_sc *sc, struct smp_seg *sg)
+smp_load_seg(const struct sess *sp, const struct smp_sc *sc, struct smp_seg *sg)
 {
 	struct smp_object *so;
 	struct objcore *oc;
@@ -1465,7 +1465,7 @@
  * can be reclaimed.
  */
 
-static void
+static void __match_proto__(storage_free_f)
 smp_free(struct storage *st)
 {
 

Modified: trunk/varnish-cache/bin/varnishd/storage_umem.c
===================================================================
--- trunk/varnish-cache/bin/varnishd/storage_umem.c	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/bin/varnishd/storage_umem.c	2010-11-16 14:09:28 UTC (rev 5546)
@@ -89,7 +89,6 @@
 	return (&smu->s);
 }
 
-/*lint -e{818} not const-able */
 static void
 smu_free(struct storage *s)
 {

Modified: trunk/varnish-cache/include/vrt.h
===================================================================
--- trunk/varnish-cache/include/vrt.h	2010-11-16 10:28:02 UTC (rev 5545)
+++ trunk/varnish-cache/include/vrt.h	2010-11-16 14:09:28 UTC (rev 5546)
@@ -151,10 +151,10 @@
 const char *VRT_regsub(const struct sess *sp, int all, const char *,
     void *, const char *);
 
-void VRT_panic(struct sess *sp, const char *, ...);
+void VRT_panic(const struct sess *sp, const char *, ...);
 void VRT_ban(struct sess *sp, char *, ...);
 void VRT_ban_string(struct sess *sp, const char *);
-void VRT_purge(struct sess *sp, double ttl, double grace);
+void VRT_purge(const struct sess *sp, double ttl, double grace);
 
 void VRT_count(const struct sess *, unsigned);
 int VRT_rewrite(const char *, const char *);
@@ -167,17 +167,17 @@
     const char *, ...);
 void VRT_handling(struct sess *sp, unsigned hand);
 
-void VRT_hashdata(struct sess *sp, const char *str, ...);
+void VRT_hashdata(const struct sess *sp, const char *str, ...);
 
 /* Simple stuff */
 int VRT_strcmp(const char *s1, const char *s2);
 void VRT_memmove(void *dst, const void *src, unsigned len);
 
-void VRT_ESI(struct sess *sp);
+void VRT_ESI(const struct sess *sp);
 void VRT_Rollback(struct sess *sp);
 
 /* Synthetic pages */
-void VRT_synth_page(struct sess *sp, unsigned flags, const char *, ...);
+void VRT_synth_page(const struct sess *sp, unsigned flags, const char *, ...);
 
 /* Backend related */
 void VRT_init_dir(struct cli *, struct director **, const char *name,
@@ -213,7 +213,7 @@
 char *VRT_double_string(const struct sess *sp, double);
 char *VRT_time_string(const struct sess *sp, double);
 const char *VRT_bool_string(const struct sess *sp, unsigned);
-const char *VRT_backend_string(struct sess *sp, const struct director *d);
+const char *VRT_backend_string(const struct sess *sp, const struct director *d);
 
 #define VRT_done(sp, hand)			\
 	do {					\




More information about the varnish-commit mailing list