[master] 5005595 Whitespace and related OCD

Federico G. Schwindt fgsch at lodoss.net
Tue Mar 27 18:40:11 UTC 2018


commit 5005595f263dcbc129b70e2445a393195cc9cc02
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Tue Mar 27 01:06:49 2018 -0300

    Whitespace and related OCD

diff --git a/bin/varnishd/cache/cache_backend.c b/bin/varnishd/cache/cache_backend.c
index 74b29d6..392baba 100644
--- a/bin/varnishd/cache/cache_backend.c
+++ b/bin/varnishd/cache/cache_backend.c
@@ -443,11 +443,11 @@ VRT_new_backend_clustered(VRT_CTX, struct vsmw_cluster *vc,
 	CHECK_OBJ_NOTNULL(ctx, VRT_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(vrt, VRT_BACKEND_MAGIC);
 	if (vrt->path == NULL)
-		assert(vrt->ipv4_suckaddr != NULL
-		       || vrt->ipv6_suckaddr != NULL);
+		assert(vrt->ipv4_suckaddr != NULL ||
+		    vrt->ipv6_suckaddr != NULL);
 	else
-		assert(vrt->ipv4_suckaddr == NULL
-		       && vrt->ipv6_suckaddr == NULL);
+		assert(vrt->ipv4_suckaddr == NULL &&
+		    vrt->ipv6_suckaddr == NULL);
 
 	vcl = ctx->vcl;
 	AN(vcl);
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 1db47c4..4c8fad0 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -186,9 +186,9 @@ cnt_deliver(struct worker *wrk, struct req *req)
 
 	assert(wrk->handling == VCL_RET_DELIVER);
 
-	if (req->esi_level == 0
-	    && http_IsStatus(req->resp, 200)
-	    && req->http->conds && RFC2616_Do_Cond(req))
+	if (req->esi_level == 0 &&
+	    http_IsStatus(req->resp, 200) &&
+	    req->http->conds && RFC2616_Do_Cond(req))
 		http_PutResponse(req->resp, "HTTP/1.1", 304, NULL);
 
 	req->req_step = R_STP_TRANSMIT;
diff --git a/bin/varnishd/cache/cache_tcp_pool.c b/bin/varnishd/cache/cache_tcp_pool.c
index e9fa812..86777ae 100644
--- a/bin/varnishd/cache/cache_tcp_pool.c
+++ b/bin/varnishd/cache/cache_tcp_pool.c
@@ -656,8 +656,8 @@ VTP_Ref(const struct suckaddr *ip4, const struct suckaddr *ip6, const char *uds,
 	struct vtp_cs vcs;
 	const struct cp_methods *methods;
 
-	assert((uds != NULL && ip4 == NULL && ip6 == NULL)
-	       || (uds == NULL && (ip4 != NULL || ip6 != NULL)));
+	assert((uds != NULL && ip4 == NULL && ip6 == NULL) ||
+	    (uds == NULL && (ip4 != NULL || ip6 != NULL)));
 	INIT_OBJ(&vcs, VTP_CS_MAGIC);
 	vcs.ip4 = ip4;
 	vcs.ip6 = ip6;
diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 12280e1..30adf54 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -1132,7 +1132,7 @@ vcl_call_method(struct worker *wrk, struct req *req, struct busyobj *bo,
 		ctx.ws = req->ws;
 	}
 	if (bo != NULL) {
-		if(req)
+		if (req)
 			assert(method == VCL_MET_PIPE);
 		CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
 		CHECK_OBJ_NOTNULL(bo->vcl, VCL_MAGIC);
diff --git a/bin/varnishd/cache/cache_vrt_priv.c b/bin/varnishd/cache/cache_vrt_priv.c
index 4e53969..9580a32 100644
--- a/bin/varnishd/cache/cache_vrt_priv.c
+++ b/bin/varnishd/cache/cache_vrt_priv.c
@@ -103,8 +103,8 @@ vrt_priv_dynamic(VRT_CTX, struct vrt_privs *vps, uintptr_t id,
 
 	VTAILQ_FOREACH(vp, &vps->privs, list) {
 		CHECK_OBJ_NOTNULL(vp, VRT_PRIV_MAGIC);
-		if (vp->vcl == ctx->vcl && vp->id == id
-		    && vp->vmod_id == vmod_id)
+		if (vp->vcl == ctx->vcl && vp->id == id &&
+		    vp->vmod_id == vmod_id)
 			return (vp->priv);
 	}
 	ALLOC_OBJ(vp, VRT_PRIV_MAGIC);
diff --git a/bin/varnishd/mgt/mgt_acceptor.c b/bin/varnishd/mgt/mgt_acceptor.c
index 8ef0f3a..fbf7f26 100644
--- a/bin/varnishd/mgt/mgt_acceptor.c
+++ b/bin/varnishd/mgt/mgt_acceptor.c
@@ -102,8 +102,8 @@ mac_opensocket(struct listen_sock *ls)
 		CHECK_OBJ(ls->perms, UDS_PERMS_MAGIC);
 		assert(ls->uds);
 		errno = 0;
-		if (ls->perms->mode != 0
-		    && chmod(ls->endpoint, ls->perms->mode) != 0)
+		if (ls->perms->mode != 0 &&
+		    chmod(ls->endpoint, ls->perms->mode) != 0)
 			return errno;
 		if (chown(ls->endpoint, ls->perms->uid, ls->perms->gid) != 0)
 			return errno;
@@ -265,8 +265,8 @@ MAC_Arg(const char *spec)
 	la->name = name;
 
 	if (*la->endpoint != '/' && strchr(la->endpoint, '/') != NULL)
-		ARGV_ERR("Unix domain socket addresses must be absolute paths "
-			 "in -a (%s)\n", la->endpoint);
+		ARGV_ERR("Unix domain socket addresses must be"
+		    " absolute paths in -a (%s)\n", la->endpoint);
 
 	if (*la->endpoint == '/' && heritage.min_vcl < 41)
 		heritage.min_vcl = 41;
@@ -277,16 +277,16 @@ MAC_Arg(const char *spec)
 
 		if ((eq = strchr(av[i], '=')) == NULL) {
 			if (xp != NULL)
-				ARGV_ERR("Too many protocol sub-args in -a "
-					 "(%s)\n", av[i]);
+				ARGV_ERR("Too many protocol sub-args"
+				    " in -a (%s)\n", av[i]);
 			xp = XPORT_Find(av[i]);
 			if (xp == NULL)
 				ARGV_ERR("Unknown protocol '%s'\n", av[i]);
 			continue;
 		}
 		if (la->endpoint[0] != '/')
-			ARGV_ERR("Invalid sub-arg %s for IP addresses in -a\n",
-				 av[i]);
+			ARGV_ERR("Invalid sub-arg %s for IP addresses"
+			    " in -a\n", av[i]);
 
 		val = eq + 1;
 		len = eq - av[i];
diff --git a/bin/varnishd/proxy/cache_proxy_proto.c b/bin/varnishd/proxy/cache_proxy_proto.c
index 9ec6f84..5f821ac 100644
--- a/bin/varnishd/proxy/cache_proxy_proto.c
+++ b/bin/varnishd/proxy/cache_proxy_proto.c
@@ -449,7 +449,7 @@ vpx_proto2(const struct worker *wrk, struct req *req)
 			    "PROXY2: Ignoring TLV");
 			return (0);
 		}
-		switch(d[0]) {
+		switch (d[0]) {
 		case PP2_TYPE_CRC32C:
 		{
 			uint32_t n_crc32c = vbe32dec(d+3);
diff --git a/bin/varnishtest/vtc.c b/bin/varnishtest/vtc.c
index 53d3232..62ac1d0 100644
--- a/bin/varnishtest/vtc.c
+++ b/bin/varnishtest/vtc.c
@@ -256,8 +256,7 @@ macro_expand(struct vtclog *vl, const char *text)
 				NEEDLESS(return (NULL));
 			}
 			VSB_printf(vsb, "${%.*s}", (int)(q - p), p);
-		}
-		else {
+		} else {
 			VSB_printf(vsb, "%s", m);
 			free(m);
 		}
diff --git a/lib/libvarnish/vsb.c b/lib/libvarnish/vsb.c
index d950608..0bc0925 100644
--- a/lib/libvarnish/vsb.c
+++ b/lib/libvarnish/vsb.c
@@ -544,8 +544,8 @@ VSB_quote_pfx(struct vsb *s, const char *pfx, const void *v, int len, int how)
 	}
 	if (!quote && !(how & (VSB_QUOTE_JSON|VSB_QUOTE_CSTR))) {
 		(void)VSB_bcat(s, p, len);
-		if ((how & (VSB_QUOTE_UNSAFE|VSB_QUOTE_NONL))
-		    && p[len-1] != '\n')
+		if ((how & (VSB_QUOTE_UNSAFE|VSB_QUOTE_NONL)) &&
+		    p[len-1] != '\n')
 			(void)VSB_putc(s, '\n');
 		return;
 	}
diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index 17209dc..032a6e9 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -491,7 +491,7 @@ vcc_func(struct vcc *tl, struct expr **e, const void *priv,
 	if (extra == NULL)
 		extra = "";
 	VTAILQ_INIT(&head);
-	for(;vv != NULL; vv = VTAILQ_NEXT(vv, list)) {
+	for (;vv != NULL; vv = VTAILQ_NEXT(vv, list)) {
 		assert(vv->type == VJSN_ARRAY);
 		fa = calloc(1, sizeof *fa);
 		AN(fa);
diff --git a/lib/libvmod_blob/url.c b/lib/libvmod_blob/url.c
index 8ba47fc..84f5d0f 100644
--- a/lib/libvmod_blob/url.c
+++ b/lib/libvmod_blob/url.c
@@ -150,8 +150,8 @@ url_decode(const enum encoding dec, char *restrict const buf,
 				}
 				break;
 			case PERCENT:
-				if (isoutofrange(*s)
-				    || (nib = nibble[*s - '0']) == ILL) {
+				if (isoutofrange(*s) ||
+				    (nib = nibble[*s - '0']) == ILL) {
 					errno = EINVAL;
 					return -1;
 				}
@@ -162,8 +162,8 @@ url_decode(const enum encoding dec, char *restrict const buf,
 					errno = ENOMEM;
 					return -1;
 				}
-				if (isoutofrange(*s)
-				    || (nib2 = nibble[*s - '0']) == ILL) {
+				if (isoutofrange(*s) ||
+				    (nib2 = nibble[*s - '0']) == ILL) {
 					errno = EINVAL;
 					return -1;
 				}
diff --git a/lib/libvmod_debug/vmod_debug_obj.c b/lib/libvmod_debug/vmod_debug_obj.c
index f053601..fcf74a7 100644
--- a/lib/libvmod_debug/vmod_debug_obj.c
+++ b/lib/libvmod_debug/vmod_debug_obj.c
@@ -128,6 +128,7 @@ xyzzy_obj_test_priv_call(VRT_CTX,
 	(void)o;
 	xyzzy_test_priv_call(ctx, priv);
 }
+
 VCL_VOID v_matchproto_()
 xyzzy_obj_test_priv_vcl(VRT_CTX,
     struct xyzzy_debug_obj *o, struct vmod_priv *priv)
@@ -135,6 +136,7 @@ xyzzy_obj_test_priv_vcl(VRT_CTX,
 	(void)o;
 	xyzzy_test_priv_vcl(ctx, priv);
 }
+
 VCL_STRING v_matchproto_()
 xyzzy_obj_test_priv_task(VRT_CTX,
     struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s)
@@ -142,6 +144,7 @@ xyzzy_obj_test_priv_task(VRT_CTX,
 	(void)o;
 	return (xyzzy_test_priv_task(ctx, priv, s));
 }
+
 VCL_STRING v_matchproto_()
 xyzzy_obj_test_priv_top(VRT_CTX,
     struct xyzzy_debug_obj *o, struct vmod_priv *priv, VCL_STRING s)


More information about the varnish-commit mailing list