[master] 217c0e2 Make the VDP ptr argument const
Poul-Henning Kamp
phk at varnish-cache.org
Fri Sep 6 09:00:39 CEST 2013
commit 217c0e24feda130fdb1fc7cb64b083affcf7bd12
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Thu Sep 5 22:14:28 2013 +0000
Make the VDP ptr argument const
diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index ab827d3..cc2f963 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -283,7 +283,8 @@ enum vdp_action {
VDP_FLUSH,
VDP_FINISH,
};
-typedef int vdp_bytes(struct req *, enum vdp_action, void *ptr, ssize_t len);
+typedef int vdp_bytes(struct req *, enum vdp_action, const void *ptr,
+ ssize_t len);
/*--------------------------------------------------------------------*/
@@ -842,7 +843,7 @@ int HTTP1_IterateReqBody(struct req *req, req_body_iter_f *func, void *priv);
void V1D_Deliver(struct req *);
static inline int
-VDP_bytes(struct req *req, enum vdp_action act, void *ptr, ssize_t len)
+VDP_bytes(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
{
int i, retval;
diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index 9f42529..6eab8a4 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -315,7 +315,7 @@ VGZ_WrwInit(struct vgz *vg)
*/
int __match_proto__(vdp_bytes)
-VDP_gunzip(struct req *req, enum vdp_action act, void *ptr, ssize_t len)
+VDP_gunzip(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
{
enum vgzret_e vr;
size_t dl;
diff --git a/bin/varnishd/cache/cache_http1_deliver.c b/bin/varnishd/cache/cache_http1_deliver.c
index c57b977..7206ff4 100644
--- a/bin/varnishd/cache/cache_http1_deliver.c
+++ b/bin/varnishd/cache/cache_http1_deliver.c
@@ -36,7 +36,7 @@
/*--------------------------------------------------------------------*/
static int __match_proto__(vdp_bytes)
-v1d_bytes(struct req *req, enum vdp_action act, void *ptr, ssize_t len)
+v1d_bytes(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
{
ssize_t wl = 0;
@@ -58,11 +58,12 @@ v1d_bytes(struct req *req, enum vdp_action act, void *ptr, ssize_t len)
/*--------------------------------------------------------------------*/
static int __match_proto__(vdp_bytes)
-v1d_range_bytes(struct req *req, enum vdp_action act, void *ptr, ssize_t len)
+v1d_range_bytes(struct req *req, enum vdp_action act, const void *ptr,
+ ssize_t len)
{
int retval = 0;
ssize_t l;
- char *p = ptr;
+ const char *p = ptr;
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
l = req->range_low - req->range_off;
More information about the varnish-commit
mailing list