[master] 8eea87d Be consistent about size_t and ssize_t, the latter is better.

Poul-Henning Kamp phk at FreeBSD.org
Thu Aug 21 12:04:14 CEST 2014


commit 8eea87d13377c3b4a75392866aa5e9e850e123b2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Aug 21 10:03:58 2014 +0000

    Be consistent about size_t and ssize_t, the latter is better.

diff --git a/bin/varnishd/cache/cache.h b/bin/varnishd/cache/cache.h
index 1608454..f5fc9e3 100644
--- a/bin/varnishd/cache/cache.h
+++ b/bin/varnishd/cache/cache.h
@@ -929,8 +929,9 @@ void VGZ_Ibuf(struct vgz *, const void *, ssize_t len);
 int VGZ_IbufEmpty(const struct vgz *vg);
 void VGZ_Obuf(struct vgz *, void *, ssize_t len);
 int VGZ_ObufFull(const struct vgz *vg);
-enum vgzret_e VGZ_Gzip(struct vgz *, const void **, size_t *len, enum vgz_flag);
-enum vgzret_e VGZ_Gunzip(struct vgz *, const void **, size_t *len);
+enum vgzret_e VGZ_Gzip(struct vgz *, const void **, ssize_t *len,
+    enum vgz_flag);
+enum vgzret_e VGZ_Gunzip(struct vgz *, const void **, ssize_t *len);
 enum vgzret_e VGZ_Destroy(struct vgz **);
 void VGZ_UpdateObj(const struct vfp_ctx *, const struct vgz*);
 vdp_bytes VDP_gunzip;
diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index b3551ca..55c8901 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -257,7 +257,7 @@ ESI_Deliver(struct req *req)
 	uint8_t tailbuf[8 + 5];
 	int isgzip;
 	struct vgz *vgz = NULL;
-	size_t dl;
+	ssize_t dl;
 	const void *dp;
 	int i;
 	struct objiter *oi;
diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index 119be81..5433fa4 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -193,7 +193,7 @@ VGZ_ObufFull(const struct vgz *vg)
 /*--------------------------------------------------------------------*/
 
 enum vgzret_e
-VGZ_Gunzip(struct vgz *vg, const void **pptr, size_t *plen)
+VGZ_Gunzip(struct vgz *vg, const void **pptr, ssize_t *plen)
 {
 	int i;
 	ssize_t l;
@@ -226,7 +226,7 @@ VGZ_Gunzip(struct vgz *vg, const void **pptr, size_t *plen)
 /*--------------------------------------------------------------------*/
 
 enum vgzret_e
-VGZ_Gzip(struct vgz *vg, const void **pptr, size_t *plen, enum vgz_flag flags)
+VGZ_Gzip(struct vgz *vg, const void **pptr, ssize_t *plen, enum vgz_flag flags)
 {
 	int i;
 	int zflg;
@@ -288,7 +288,7 @@ int __match_proto__(vdp_bytes)
 VDP_gunzip(struct req *req, enum vdp_action act, const void *ptr, ssize_t len)
 {
 	enum vgzret_e vr;
-	size_t dl;
+	ssize_t dl;
 	const void *dp;
 	struct worker *wrk;
 	struct vgz *vg;
@@ -336,7 +336,7 @@ VGZ_WrwGunzip(struct req *req, struct vgz *vg, const void *ibuf,
     ssize_t ibufl)
 {
 	enum vgzret_e vr;
-	size_t dl;
+	ssize_t dl;
 	const void *dp;
 	struct worker *wrk;
 
@@ -509,7 +509,7 @@ vfp_gunzip_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
 	struct vgz *vg;
 	enum vgzret_e vr = VGZ_ERROR;
 	const void *dp;
-	size_t dl;
+	ssize_t dl;
 	enum vfp_status vp = VFP_OK;
 
 	CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
@@ -563,7 +563,7 @@ vfp_gzip_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
 	struct vgz *vg;
 	enum vgzret_e vr = VGZ_ERROR;
 	const void *dp;
-	size_t dl;
+	ssize_t dl;
 	enum vfp_status vp = VFP_ERROR;
 
 	CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);
@@ -617,7 +617,7 @@ vfp_testgunzip_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *p,
 	struct vgz *vg;
 	enum vgzret_e vr = VGZ_ERROR;
 	const void *dp;
-	size_t dl;
+	ssize_t dl;
 	enum vfp_status vp;
 
 	CHECK_OBJ_NOTNULL(vc, VFP_CTX_MAGIC);



More information about the varnish-commit mailing list