[master] 76007e33e Signed/Unsigned cleanup

Poul-Henning Kamp phk at FreeBSD.org
Thu Apr 18 08:55:08 UTC 2019


commit 76007e33e228406a2db84ca63fbab120e56a67ff
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Thu Apr 18 07:54:57 2019 +0000

    Signed/Unsigned cleanup

diff --git a/include/vfil.h b/include/vfil.h
index 25f3b3ac6..49369f57e 100644
--- a/include/vfil.h
+++ b/include/vfil.h
@@ -38,7 +38,7 @@ char *VFIL_readfile(const char *pfx, const char *fn, ssize_t *sz);
 int VFIL_writefile(const char *pfx, const char *fn, const char *buf, size_t sz);
 int VFIL_nonblocking(int fd);
 int VFIL_fsinfo(int fd, unsigned *pbs, uintmax_t *size, uintmax_t *space);
-int VFIL_allocate(int fd, off_t size, int insist);
+int VFIL_allocate(int fd, uintmax_t size, int insist);
 void VFIL_setpath(struct vfil_path**, const char *path);
 typedef int vfil_path_func_f(void *priv, const char *fn);
 int VFIL_searchpath(const struct vfil_path *, vfil_path_func_f *func,
diff --git a/lib/libvarnish/vev.c b/lib/libvarnish/vev.c
index dcb712a2e..dcace04f4 100644
--- a/lib/libvarnish/vev.c
+++ b/lib/libvarnish/vev.c
@@ -400,7 +400,8 @@ VEV_Once(struct vev_root *evb)
 {
 	double t;
 	struct vev *e;
-	int i, j, k, tmo, retval = 1;
+	int i, k, tmo, retval = 1;
+	unsigned u;
 
 	CHECK_OBJ_NOTNULL(evb, VEV_BASE_MAGIC);
 	assert(evb->thread == pthread_self());
@@ -440,21 +441,21 @@ VEV_Once(struct vev_root *evb)
 	}
 
 	k = 0;
-	for (j = 1; j < evb->lpfd; j++) {
-		evb->pev[j]->fd_events = evb->pfd[j].revents;
-		if (evb->pev[j]->fd_events)
+	for (u = 1; u < evb->lpfd; u++) {
+		evb->pev[u]->fd_events = evb->pfd[u].revents;
+		if (evb->pev[u]->fd_events)
 			k++;
 	}
 	assert(k == i);
 
 	DBG(evb, "EVENTS %d\n", i);
 	while (i > 0) {
-		for (j = BINHEAP_NOIDX + 1; j < evb->lpfd; j++) {
-			e = evb->pev[j];
+		for (u = BINHEAP_NOIDX + 1; u < evb->lpfd; u++) {
+			e = evb->pev[u];
 			if (e->fd_events == 0)
 				continue;
-			DBG(evb, "EVENT %p j=%d fd=%d ev=0x%x %d\n",
-			    e, j, e->fd, e->fd_events, i);
+			DBG(evb, "EVENT %p u=%u fd=%d ev=0x%x %d\n",
+			    e, u, e->fd, e->fd_events, i);
 			k = e->callback(e, e->fd_events);
 			e->fd_events = 0;
 			i--;
diff --git a/lib/libvarnish/vfil.c b/lib/libvarnish/vfil.c
index 8e34c9cb8..ad41c5644 100644
--- a/lib/libvarnish/vfil.c
+++ b/lib/libvarnish/vfil.c
@@ -224,7 +224,7 @@ VFIL_fsinfo(int fd, unsigned *pbs, uintmax_t *psize, uintmax_t *pspace)
  */
 
 int
-VFIL_allocate(int fd, off_t size, int insist)
+VFIL_allocate(int fd, uintmax_t size, int insist)
 {
 	struct stat st;
 	uintmax_t fsspace;
diff --git a/lib/libvarnish/vlu.c b/lib/libvarnish/vlu.c
index d7e163616..718ac3b86 100644
--- a/lib/libvarnish/vlu.c
+++ b/lib/libvarnish/vlu.c
@@ -144,19 +144,20 @@ VLU_File(int fd, vlu_f *func, void *priv, unsigned bufsize)
 int
 VLU_Feed(struct vlu *l, const char *ptr, int len)
 {
-	int i = 0, ll;
+	int i = 0;
+	unsigned u;
 
 	CHECK_OBJ_NOTNULL(l, LINEUP_MAGIC);
 	AN(ptr);
 	assert(len > 0);
 	while (len > 0) {
-		ll = len;
-		if (ll > l->bufl - l->bufp)
-			ll = l->bufl - l->bufp;
-		memcpy(l->buf + l->bufp, ptr, ll);
-		len -= ll;
-		ptr += ll;
-		l->bufp += ll;
+		u = len;
+		if (u > l->bufl - l->bufp)
+			u = l->bufl - l->bufp;
+		memcpy(l->buf + l->bufp, ptr, u);
+		len -= u;
+		ptr += u;
+		l->bufp += u;
 		i = LineUpProcess(l);
 		if (i)
 			return (i);


More information about the varnish-commit mailing list