[master] 499bde9 Constify the vfp structs

Poul-Henning Kamp phk at varnish-cache.org
Tue Nov 26 16:58:10 CET 2013


commit 499bde928f8e86a6f05e3e52d6cffcfd47cc721c
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Nov 26 13:27:38 2013 +0000

    Constify the vfp structs

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 77a109a..8cb3a4d 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -270,10 +270,10 @@ struct vfp {
 	vfp_end_f	*end;
 };
 
-extern struct vfp vfp_gunzip;
-extern struct vfp vfp_gzip;
-extern struct vfp vfp_testgzip;
-extern struct vfp vfp_esi;
+extern const struct vfp vfp_gunzip;
+extern const struct vfp vfp_gzip;
+extern const struct vfp vfp_testgzip;
+extern const struct vfp vfp_esi;
 
 /* Deliver processors ------------------------------------------------*/
 
@@ -540,7 +540,7 @@ struct busyobj {
 	unsigned		is_gzip;
 	unsigned		is_gunzip;
 
-	struct vfp		*vfp;
+	const struct vfp	*vfp;
 	struct vep_state	*vep;
 	enum busyobj_state_e	state;
 	struct vgz		*vgz_rx;
@@ -932,7 +932,7 @@ struct storage *VFP_GetStorage(struct busyobj *, ssize_t sz);
 int VFP_Error2(struct busyobj *, const char *error, const char *more);
 int VFP_Error(struct busyobj *, const char *error);
 void VFP_Init(void);
-extern struct vfp VFP_nop;
+extern const struct vfp VFP_nop;
 
 /* cache_gzip.c */
 struct vgz;
diff --git a/bin/varnishd/cache/cache_esi_fetch.c b/bin/varnishd/cache/cache_esi_fetch.c
index 6218cc2..6cf8dbd 100644
--- a/bin/varnishd/cache/cache_esi_fetch.c
+++ b/bin/varnishd/cache/cache_esi_fetch.c
@@ -415,7 +415,7 @@ vfp_esi_end(struct busyobj *bo)
 	return (retval);
 }
 
-struct vfp vfp_esi = {
+const struct vfp vfp_esi = {
         .begin  =       vfp_esi_begin,
         .bytes  =       vfp_esi_bytes,
         .end    =       vfp_esi_end,
diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index 317afbb..9021e6b 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -153,7 +153,7 @@ vfp_nop_end(struct busyobj *bo)
 	return (0);
 }
 
-struct vfp VFP_nop = {
+const struct vfp VFP_nop = {
 	.begin	=	vfp_nop_begin,
 	.bytes	=	vfp_nop_bytes,
 	.end	=	vfp_nop_end,
diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index 8b46bbd..4c845aa 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -540,7 +540,7 @@ vfp_gunzip_end(struct busyobj *bo)
 	return (0);
 }
 
-struct vfp vfp_gunzip = {
+const struct vfp vfp_gunzip = {
         .begin  =       vfp_gunzip_begin,
         .bytes  =       vfp_gunzip_bytes,
         .end    =       vfp_gunzip_end,
@@ -625,7 +625,7 @@ vfp_gzip_end(struct busyobj *bo)
 	return (0);
 }
 
-struct vfp vfp_gzip = {
+const struct vfp vfp_gzip = {
         .begin  =       vfp_gzip_begin,
         .bytes  =       vfp_gzip_bytes,
         .end    =       vfp_gzip_end,
@@ -710,7 +710,7 @@ vfp_testgzip_end(struct busyobj *bo)
 	return (0);
 }
 
-struct vfp vfp_testgzip = {
+const struct vfp vfp_testgzip = {
         .begin  =       vfp_testgzip_begin,
         .bytes  =       vfp_testgzip_bytes,
         .end    =       vfp_testgzip_end,



More information about the varnish-commit mailing list