[master] 806a68b Minor polish for PCLint-Plus

Poul-Henning Kamp phk at FreeBSD.org
Sun Oct 22 12:24:09 UTC 2017


commit 806a68b3ff588963b2b97556de556305e0154ad3
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Sun Oct 22 12:21:24 2017 +0000

    Minor polish for PCLint-Plus

diff --git a/bin/varnishd/cache/cache_backend_cfg.c b/bin/varnishd/cache/cache_backend_cfg.c
index efb3dc0..5a30950 100644
--- a/bin/varnishd/cache/cache_backend_cfg.c
+++ b/bin/varnishd/cache/cache_backend_cfg.c
@@ -50,7 +50,7 @@
 
 #include "VSC_vbe.h"
 
-const char *vbe_proto_ident = "HTTP Backend";
+static const char *vbe_proto_ident = "HTTP Backend";
 
 static VTAILQ_HEAD(, backend) backends = VTAILQ_HEAD_INITIALIZER(backends);
 static VTAILQ_HEAD(, backend) cool_backends =
diff --git a/bin/varnishd/common/common_vsc.c b/bin/varnishd/common/common_vsc.c
index 95952ed..1ce53cd 100644
--- a/bin/varnishd/common/common_vsc.c
+++ b/bin/varnishd/common/common_vsc.c
@@ -118,15 +118,14 @@ VRT_VSC_Destroy(const char *nm, const void *p)
 		vsc_lock();
 
 	AN(heritage.proc_vsmw);
-	VTAILQ_FOREACH(vsg, &vsc_seglist, list) {
-		if (vsg->ptr != p)
-			continue;
-		assert(vsg->nm == nm);
-		VSMW_Free(heritage.proc_vsmw, &vsg->seg);
-		VTAILQ_REMOVE(&vsc_seglist, vsg, list);
-		FREE_OBJ(vsg);
-		break;
-	}
+	VTAILQ_FOREACH(vsg, &vsc_seglist, list)
+		if (vsg->ptr == p)
+			break;
+	AN(vsg);
+	assert(vsg->nm == nm);
+	VSMW_Free(heritage.proc_vsmw, &vsg->seg);
+	VTAILQ_REMOVE(&vsc_seglist, vsg, list);
+	FREE_OBJ(vsg);
 	if (vsc_unlock != NULL)
 		vsc_unlock();
 }
diff --git a/bin/varnishd/mgt/mgt_child.c b/bin/varnishd/mgt/mgt_child.c
index a6f944c..3174cde 100644
--- a/bin/varnishd/mgt/mgt_child.c
+++ b/bin/varnishd/mgt/mgt_child.c
@@ -470,7 +470,7 @@ mgt_reap_child(void)
 		r = waitpid(child_pid, &status, 0);
 	}
 	if (r != child_pid)
-		fprintf(stderr, "WAIT 0x%jx\n", (uintmax_t)r);
+		fprintf(stderr, "WAIT 0x%jd\n", (intmax_t)r);
 	assert(r == child_pid);
 
 	MAC_reopen_sockets();


More information about the varnish-commit mailing list