[master] c5d810e Minor OCD here and there

Federico G. Schwindt fgsch at lodoss.net
Tue May 24 23:49:05 CEST 2016


commit c5d810e5729a90f47d8e02c42063f0c513d36f37
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Tue May 24 09:12:16 2016 +0100

    Minor OCD here and there

diff --git a/bin/varnishd/cache/cache_rfc2616.c b/bin/varnishd/cache/cache_rfc2616.c
index 884aad1..bc967d1 100644
--- a/bin/varnishd/cache/cache_rfc2616.c
+++ b/bin/varnishd/cache/cache_rfc2616.c
@@ -256,7 +256,7 @@ rfc2616_weak_compare(const char *p, const char *e)
 int
 RFC2616_Do_Cond(const struct req *req)
 {
-	const char *p, *e, *l;
+	const char *p, *e;
 	double ims, lm;
 
 	/*
@@ -276,8 +276,8 @@ RFC2616_Do_Cond(const struct req *req)
 		ims = VTIM_parse(p);
 		if (!ims || ims > req->t_req)	/* [RFC7232 3.3 p16] */
 			return (0);
-		if (http_GetHdr(req->resp, H_Last_Modified, &l)) {
-			lm = VTIM_parse(l);
+		if (http_GetHdr(req->resp, H_Last_Modified, &p)) {
+			lm = VTIM_parse(p);
 			if (!lm || lm > ims)
 				return (0);
 			return (1);
diff --git a/include/miniobj.h b/include/miniobj.h
index 95f3bef..901143f 100644
--- a/include/miniobj.h
+++ b/include/miniobj.h
@@ -55,13 +55,13 @@
 #define CAST_OBJ_NOTNULL(to, from, type_magic)				\
 	do {								\
 		(to) = (from);						\
-		assert((to) != NULL);					\
+		AN((to));						\
 		CHECK_OBJ((to), (type_magic));				\
 	} while (0)
 
-#define TAKE_OBJ_NOTNULL(to, pfrom, type_magic)			\
+#define TAKE_OBJ_NOTNULL(to, pfrom, type_magic)				\
 	do {								\
-		assert((pfrom) != NULL);				\
+		AN((pfrom));						\
 		(to) = *(pfrom);					\
 		*(pfrom) = NULL;					\
 		CHECK_OBJ_NOTNULL((to), (type_magic));			\
diff --git a/lib/libvmod_debug/vmod_debug.c b/lib/libvmod_debug/vmod_debug.c
index 32f0b11..5ca628c 100644
--- a/lib/libvmod_debug/vmod_debug.c
+++ b/lib/libvmod_debug/vmod_debug.c
@@ -352,9 +352,9 @@ event_function(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
 {
 
 	switch (e) {
-	case VCL_EVENT_LOAD: return event_load(ctx, priv);
-	case VCL_EVENT_WARM: return event_warm(ctx, priv);
-	case VCL_EVENT_COLD: return event_cold(ctx, priv);
+	case VCL_EVENT_LOAD: return (event_load(ctx, priv));
+	case VCL_EVENT_WARM: return (event_warm(ctx, priv));
+	case VCL_EVENT_COLD: return (event_cold(ctx, priv));
 	default: return (0);
 	}
 }
@@ -411,7 +411,7 @@ vmod_workspace_free(VRT_CTX, VCL_ENUM which)
 	WS_Assert(ws);
 	AZ(ws->r);
 
-	return pdiff(ws->f, ws->e);
+	return (pdiff(ws->f, ws->e));
 }
 
 VCL_BOOL



More information about the varnish-commit mailing list