[master] c8ec10c Whitespace OCD

Federico G. Schwindt fgsch at lodoss.net
Sat Mar 25 03:38:05 CET 2017


commit c8ec10cad82917f714ef90cc513cae854788e858
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date:   Fri Mar 24 19:30:56 2017 -0700

    Whitespace OCD

diff --git a/bin/varnishd/cache/cache_backend_tcp.c b/bin/varnishd/cache/cache_backend_tcp.c
index 425a7de..681834f 100644
--- a/bin/varnishd/cache/cache_backend_tcp.c
+++ b/bin/varnishd/cache/cache_backend_tcp.c
@@ -89,7 +89,7 @@ tcp_handle(struct waited *w, enum wait_event ev, double now)
 
 	Lck_Lock(&tp->mtx);
 
-	switch(vbc->state) {
+	switch (vbc->state) {
 	case VBC_STATE_STOLEN:
 		vbc->state = VBC_STATE_USED;
 		VTAILQ_REMOVE(&tp->connlist, vbc, list);
diff --git a/bin/varnishd/cache/cache_esi_deliver.c b/bin/varnishd/cache/cache_esi_deliver.c
index 97bfd63..17682da 100644
--- a/bin/varnishd/cache/cache_esi_deliver.c
+++ b/bin/varnishd/cache/cache_esi_deliver.c
@@ -615,7 +615,7 @@ ved_objiterate(void *priv, int flush, const void *ptr, ssize_t len)
 		foo->ll++;
 		len--;
 		pp++;
-		switch((int)(foo->stop & 7)) {
+		switch ((int)(foo->stop & 7)) {
 		case 1: /*
 			 * x000....
 			 * 00000000 00000000 11111111 11111111
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 4aa3dd2..670dc8f 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -971,7 +971,7 @@ vbf_fetch_thread(struct worker *wrk, void *priv)
 	while (stp != F_STP_DONE) {
 		CHECK_OBJ_NOTNULL(bo, BUSYOBJ_MAGIC);
 		assert(bo->fetch_objcore->boc->refcount >= 1);
-		switch(stp) {
+		switch (stp) {
 #define FETCH_STEP(l, U, arg)						\
 		case F_STP_##U:						\
 			stp = vbf_stp_##l arg;				\
@@ -1022,7 +1022,7 @@ VBF_Fetch(struct worker *wrk, struct req *req, struct objcore *oc,
 	CHECK_OBJ_ORNULL(oldoc, OBJCORE_MAGIC);
 
 
-	switch(mode) {
+	switch (mode) {
 	case VBF_PASS:		how = "pass"; break;
 	case VBF_NORMAL:	how = "fetch"; break;
 	case VBF_BACKGROUND:	how = "bgfetch"; break;
diff --git a/bin/varnishd/cache/cache_gzip.c b/bin/varnishd/cache/cache_gzip.c
index deb3b21..3657376 100644
--- a/bin/varnishd/cache/cache_gzip.c
+++ b/bin/varnishd/cache/cache_gzip.c
@@ -255,7 +255,7 @@ VGZ_Gzip(struct vgz *vg, const void **pptr, ssize_t *plen, enum vgz_flag flags)
 	AN(vg->vz.next_out);
 	AN(vg->vz.avail_out);
 	before = vg->vz.next_out;
-	switch(flags) {
+	switch (flags) {
 	case VGZ_NORMAL:	zflg = Z_NO_FLUSH; break;
 	case VGZ_ALIGN:		zflg = Z_SYNC_FLUSH; break;
 	case VGZ_RESET:		zflg = Z_FULL_FLUSH; break;
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index d261c2d..8c3df12 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -67,7 +67,7 @@ static void pan_sess(struct vsb *, const struct sess *);
 const char *
 body_status_2str(enum body_status e)
 {
-	switch(e) {
+	switch (e) {
 #define BODYSTATUS(U,l)	case BS_##U: return (#l);
 #include "tbl/body_status.h"
 	default:
@@ -597,7 +597,7 @@ pan_ic(const char *func, const char *file, int line, const char *cond,
 	   desired effect */
 	(void)sigaction(SIGABRT, &sa, NULL);
 
-	switch(kind) {
+	switch (kind) {
 	case VAS_WRONG:
 		VSB_printf(pan_vsb,
 		    "Wrong turn at %s:%d:\n%s\n", file, line, cond);
diff --git a/bin/varnishd/cache/cache_req_body.c b/bin/varnishd/cache/cache_req_body.c
index a27e4b4..3cda426 100644
--- a/bin/varnishd/cache/cache_req_body.c
+++ b/bin/varnishd/cache/cache_req_body.c
@@ -177,7 +177,7 @@ VRB_Iterate(struct req *req, objiterate_f *func, void *priv)
 	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
 	AN(func);
 
-	switch(req->req_body_status) {
+	switch (req->req_body_status) {
 	case REQ_BODY_CACHED:
 		if (req->req_bodybytes > 0 &&
 		    ObjIterate(req->wrk, req->body_oc, priv, func, 0))
@@ -284,7 +284,7 @@ VRB_Cache(struct req *req, ssize_t maxsize)
 		return (-1);
 
 	assert (req->req_step == R_STP_RECV);
-	switch(req->req_body_status) {
+	switch (req->req_body_status) {
 	case REQ_BODY_CACHED:
 		return (req->req_bodybytes);
 	case REQ_BODY_FAIL:
diff --git a/bin/varnishd/cache/cache_req_fsm.c b/bin/varnishd/cache/cache_req_fsm.c
index 2086966..3963625 100644
--- a/bin/varnishd/cache/cache_req_fsm.c
+++ b/bin/varnishd/cache/cache_req_fsm.c
@@ -848,7 +848,7 @@ cnt_recv(struct worker *wrk, struct req *req)
 		assert(wrk->handling == VCL_RET_LOOKUP);
 	SHA256_Final(req->digest, &sha256ctx);
 
-	switch(recv_handling) {
+	switch (recv_handling) {
 	case VCL_RET_VCL:
 		VSLb(req->vsl, SLT_VCL_Error,
 		    "Illegal return(vcl): %s",
diff --git a/bin/varnishd/cache/cache_vcl.c b/bin/varnishd/cache/cache_vcl.c
index 4c2e2c6..2d5de6b 100644
--- a/bin/varnishd/cache/cache_vcl.c
+++ b/bin/varnishd/cache/cache_vcl.c
@@ -661,7 +661,7 @@ vcl_set_state(VRT_CTX, const char *state)
 	AZ(errno=pthread_rwlock_wrlock(&vcl->temp_rwl));
 	AN(vcl->temp);
 
-	switch(state[0]) {
+	switch (state[0]) {
 	case '0':
 		assert(vcl->temp != VCL_TEMP_COLD);
 		if (vcl->busy == 0 && VCL_WARM(vcl)) {
diff --git a/bin/varnishd/http1/cache_http1_fetch.c b/bin/varnishd/http1/cache_http1_fetch.c
index 15cf047..5d3933a 100644
--- a/bin/varnishd/http1/cache_http1_fetch.c
+++ b/bin/varnishd/http1/cache_http1_fetch.c
@@ -167,7 +167,7 @@ V1F_FetchRespHdr(struct busyobj *bo)
 	if (hs != HTC_S_COMPLETE) {
 		bo->acct.beresp_hdrbytes +=
 		    htc->rxbuf_e - htc->rxbuf_b;
-		switch(hs) {
+		switch (hs) {
 		case HTC_S_JUNK:
 			VSLb(bo->vsl, SLT_FetchError, "Received junk");
 			htc->doclose = SC_RX_JUNK;
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index 5a7c958..5bd4429 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -144,7 +144,7 @@ http1_req_body(struct req *req)
 {
 
 	CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
-	switch(req->htc->body_status) {
+	switch (req->htc->body_status) {
 	case BS_EOF:
 	case BS_LENGTH:
 	case BS_CHUNKED:
@@ -404,7 +404,7 @@ HTTP1_Session(struct worker *wrk, struct req *req)
 				    req->htc->rxbuf_e - req->htc->rxbuf_b;
 				CNT_AcctLogCharge(wrk->stats, req);
 				Req_Release(req);
-				switch(hs) {
+				switch (hs) {
 				case HTC_S_CLOSE:
 					SES_Delete(sp, SC_REM_CLOSE, NAN);
 					return;
diff --git a/bin/varnishd/http1/cache_http1_vfp.c b/bin/varnishd/http1/cache_http1_vfp.c
index 50a2123..715a110 100644
--- a/bin/varnishd/http1/cache_http1_vfp.c
+++ b/bin/varnishd/http1/cache_http1_vfp.c
@@ -264,7 +264,7 @@ V1F_Setup_Fetch(struct vfp_ctx *vfc, struct http_conn *htc)
 	CHECK_OBJ_NOTNULL(vfc, VFP_CTX_MAGIC);
 	CHECK_OBJ_NOTNULL(htc, HTTP_CONN_MAGIC);
 
-	switch(htc->body_status) {
+	switch (htc->body_status) {
 	case BS_EOF:
 		assert(htc->content_length == -1);
 		vfe = VFP_Push(vfc, &v1f_eof, 0);
diff --git a/bin/varnishd/http2/cache_http2_panic.c b/bin/varnishd/http2/cache_http2_panic.c
index 6506436..b0f1a12 100644
--- a/bin/varnishd/http2/cache_http2_panic.c
+++ b/bin/varnishd/http2/cache_http2_panic.c
@@ -49,7 +49,7 @@ h2_sess_panic(struct vsb *vsb, const struct sess *sp)
 	VSB_indent(vsb, 2);
 	VTAILQ_FOREACH(r2, &h2->streams, list) {
 		VSB_printf(vsb, "0x%08x", r2->stream);
-		switch(r2->state) {
+		switch (r2->state) {
 #define H2_STREAM(U,sd,d) case H2_S_##U: VSB_printf(vsb, " %-6s", sd); break;
 #include <tbl/h2_stream.h>
 		default:
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index e53e0cc..fa59e28 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -68,7 +68,7 @@ static const char *
 h2_framename(enum h2frame h2f)
 {
 
-	switch(h2f) {
+	switch (h2f) {
 #define H2_FRAME(l,u,t,f,...)	case H2F_##u: return #u;
 #include "tbl/h2_frames.h"
 	default:
diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 896d6e0..1c45b32 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -831,7 +831,7 @@ main(int argc, char * const *argv)
 	if (VTAILQ_EMPTY(&heritage.socks))
 		MAC_Arg(":80");
 
-	assert(! VTAILQ_EMPTY(&heritage.socks));
+	assert(!VTAILQ_EMPTY(&heritage.socks));
 
 	HSH_config(h_arg);
 
diff --git a/bin/varnishd/proxy/cache_proxy_proto.c b/bin/varnishd/proxy/cache_proxy_proto.c
index f890b81..14e186a 100644
--- a/bin/varnishd/proxy/cache_proxy_proto.c
+++ b/bin/varnishd/proxy/cache_proxy_proto.c
@@ -192,7 +192,7 @@ vpx_proto2(const struct worker *wrk, struct req *req)
 	}
 
 	/* Command @12 bottom half */
-	switch(p[12] & 0x0f) {
+	switch (p[12] & 0x0f) {
 	case 0x0:
 		/* Local connection from proxy, ignore addresses */
 		return (0);
@@ -206,7 +206,7 @@ vpx_proto2(const struct worker *wrk, struct req *req)
 	}
 
 	/* Address family & protocol @13 */
-	switch(p[13]) {
+	switch (p[13]) {
 	case 0x00:
 		/* UNSPEC|UNSPEC, ignore proxy header */
 		VSL(SLT_ProxyGarbage, req->sp->vxid,
diff --git a/include/vqueue.h b/include/vqueue.h
index fc9fb88..f5d39ea 100644
--- a/include/vqueue.h
+++ b/include/vqueue.h
@@ -233,7 +233,7 @@ struct {								\
 #define	VSTAILQ_FIRST(head)	((head)->vstqh_first)
 
 #define	VSTAILQ_FOREACH(var, head, field)				\
-	for((var) = VSTAILQ_FIRST((head));				\
+	for ((var) = VSTAILQ_FIRST((head));				\
 	   (var);							\
 	   (var) = VSTAILQ_NEXT((var), field))
 
diff --git a/lib/libvarnish/vav.c b/lib/libvarnish/vav.c
index e1de1b1..d39932f 100644
--- a/lib/libvarnish/vav.c
+++ b/lib/libvarnish/vav.c
@@ -55,7 +55,7 @@ VAV_BackSlash(const char *s, char *res)
 
 	assert(*s == '\\');
 	r = c = 0;
-	switch(s[1]) {
+	switch (s[1]) {
 	case 'n':
 		c = '\n';
 		r = 2;
diff --git a/lib/libvarnish/vsa.c b/lib/libvarnish/vsa.c
index 3909e81..c6fcac2 100644
--- a/lib/libvarnish/vsa.c
+++ b/lib/libvarnish/vsa.c
@@ -188,18 +188,18 @@ VRT_VSA_GetPtr(const struct suckaddr *sua, const unsigned char ** dst)
 		return (-1);
 	CHECK_OBJ_NOTNULL(sua, SUCKADDR_MAGIC);
 
-	switch(sua->sa.sa_family) {
-		case PF_INET:
-			assert(sua->sa.sa_family == sua->sa4.sin_family);
-			*dst = (const unsigned char *)&sua->sa4.sin_addr;
-			return (sua->sa4.sin_family);
-		case PF_INET6:
-			assert(sua->sa.sa_family == sua->sa6.sin6_family);
-			*dst = (const unsigned char *)&sua->sa6.sin6_addr;
-			return (sua->sa6.sin6_family);
-		default:
-			*dst = NULL;
-			return (-1);
+	switch (sua->sa.sa_family) {
+	case PF_INET:
+		assert(sua->sa.sa_family == sua->sa4.sin_family);
+		*dst = (const unsigned char *)&sua->sa4.sin_addr;
+		return (sua->sa4.sin_family);
+	case PF_INET6:
+		assert(sua->sa.sa_family == sua->sa6.sin6_family);
+		*dst = (const unsigned char *)&sua->sa6.sin6_addr;
+		return (sua->sa6.sin6_family);
+	default:
+		*dst = NULL;
+		return (-1);
 	}
 }
 
@@ -215,17 +215,17 @@ VSA_Malloc(const void *s, unsigned  sal)
 	unsigned l = 0;
 
 	AN(s);
-	switch(sa->sa_family) {
-		case PF_INET:
-			if (sal == sizeof sua->sa4)
-				l = sal;
-			break;
-		case PF_INET6:
-			if (sal == sizeof sua->sa6)
-				l = sal;
-			break;
-		default:
-			break;
+	switch (sa->sa_family) {
+	case PF_INET:
+		if (sal == sizeof sua->sa4)
+			l = sal;
+		break;
+	case PF_INET6:
+		if (sal == sizeof sua->sa6)
+			l = sal;
+		break;
+	default:
+		break;
 	}
 	if (l != 0) {
 		ALLOC_OBJ(sua, SUCKADDR_MAGIC);
@@ -245,17 +245,17 @@ VSA_Build(void *d, const void *s, unsigned sal)
 
 	AN(d);
 	AN(s);
-	switch(sa->sa_family) {
-		case PF_INET:
-			if (sal == sizeof sua->sa4)
-				l = sal;
-			break;
-		case PF_INET6:
-			if (sal == sizeof sua->sa6)
-				l = sal;
-			break;
-		default:
-			break;
+	switch (sa->sa_family) {
+	case PF_INET:
+		if (sal == sizeof sua->sa4)
+			l = sal;
+		break;
+	case PF_INET6:
+		if (sal == sizeof sua->sa6)
+			l = sal;
+		break;
+	default:
+		break;
 	}
 	if (l != 0) {
 		memset(sua, 0, sizeof *sua);
@@ -272,15 +272,15 @@ VSA_Get_Sockaddr(const struct suckaddr *sua, socklen_t *sl)
 
 	CHECK_OBJ_NOTNULL(sua, SUCKADDR_MAGIC);
 	AN(sl);
-	switch(sua->sa.sa_family) {
-		case PF_INET:
-			*sl = sizeof sua->sa4;
-			break;
-		case PF_INET6:
-			*sl = sizeof sua->sa6;
-			break;
-		default:
-			return (NULL);
+	switch (sua->sa.sa_family) {
+	case PF_INET:
+		*sl = sizeof sua->sa4;
+		break;
+	case PF_INET6:
+		*sl = sizeof sua->sa6;
+		break;
+	default:
+		return (NULL);
 	}
 	return (&sua->sa);
 }
@@ -298,12 +298,12 @@ VSA_Sane(const struct suckaddr *sua)
 {
 	CHECK_OBJ_NOTNULL(sua, SUCKADDR_MAGIC);
 
-	switch(sua->sa.sa_family) {
-		case PF_INET:
-		case PF_INET6:
-			return (1);
-		default:
-			return (0);
+	switch (sua->sa.sa_family) {
+	case PF_INET:
+	case PF_INET6:
+		return (1);
+	default:
+		return (0);
 	}
 }
 
@@ -326,13 +326,13 @@ VSA_Compare_IP(const struct suckaddr *sua1, const struct suckaddr *sua2)
 	if (sua1->sa.sa_family != sua2->sa.sa_family)
 		return (-1);
 
-	switch(sua1->sa.sa_family) {
-		case PF_INET:
-			return (memcmp(&sua1->sa4.sin_addr,
-			    &sua2->sa4.sin_addr, sizeof(struct in_addr)));
-		case PF_INET6:
-			return (memcmp(&sua1->sa6.sin6_addr,
-			    &sua2->sa6.sin6_addr, sizeof(struct in6_addr)));
+	switch (sua1->sa.sa_family) {
+	case PF_INET:
+		return (memcmp(&sua1->sa4.sin_addr,
+		    &sua2->sa4.sin_addr, sizeof(struct in_addr)));
+	case PF_INET6:
+		return (memcmp(&sua1->sa6.sin6_addr,
+		    &sua2->sa6.sin6_addr, sizeof(struct in6_addr)));
 	}
 
 	WRONG("Just plain insane");
@@ -356,12 +356,12 @@ VSA_Port(const struct suckaddr *sua)
 {
 
 	CHECK_OBJ_NOTNULL(sua, SUCKADDR_MAGIC);
-	switch(sua->sa.sa_family) {
-		case PF_INET:
-			return (ntohs(sua->sa4.sin_port));
-		case PF_INET6:
-			return (ntohs(sua->sa6.sin6_port));
-		default:
-			return (0);
+	switch (sua->sa.sa_family) {
+	case PF_INET:
+		return (ntohs(sua->sa4.sin_port));
+	case PF_INET6:
+		return (ntohs(sua->sa6.sin6_port));
+	default:
+		return (0);
 	}
 }
diff --git a/lib/libvarnishapi/vxp_parse.c b/lib/libvarnishapi/vxp_parse.c
index d39cdd7..0331bd3 100644
--- a/lib/libvarnishapi/vxp_parse.c
+++ b/lib/libvarnishapi/vxp_parse.c
@@ -371,7 +371,7 @@ vxp_expr_cmp(struct vxp *vxp, struct vex **pvex)
 	ERRCHK(vxp);
 
 	/* Value */
-	switch((*pvex)->tok) {
+	switch ((*pvex)->tok) {
 	case '\0':
 		WRONG("Missing token");
 		break;
diff --git a/lib/libvcc/vcc_acl.c b/lib/libvcc/vcc_acl.c
index 27614fc..b54f5ad 100644
--- a/lib/libvcc/vcc_acl.c
+++ b/lib/libvcc/vcc_acl.c
@@ -199,7 +199,7 @@ vcc_acl_try_getaddrinfo(struct vcc *tl, struct acl_e *ae)
 
 	i4 = i6 = 0;
 	for (res = res0; res != NULL; res = res->ai_next) {
-		switch(res->ai_family) {
+		switch (res->ai_family) {
 		case PF_INET:
 			assert(PF_INET < 256);
 			sin4 = (void*)res->ai_addr;
diff --git a/lib/libvcc/vcc_expr.c b/lib/libvcc/vcc_expr.c
index eab2453..344b831 100644
--- a/lib/libvcc/vcc_expr.c
+++ b/lib/libvcc/vcc_expr.c
@@ -301,7 +301,7 @@ vcc_expr_edit(vcc_type_t fmt, const char *p, struct expr *e1,
 			continue;
 		}
 		assert(*p == '\v');
-		switch(*++p) {
+		switch (*++p) {
 		case '+': VSB_cat(e->vsb, "\v+"); break;
 		case '-': VSB_cat(e->vsb, "\v-"); break;
 		case '1':
@@ -356,7 +356,7 @@ vcc_expr_fmt(struct vsb *d, int ind, const struct expr *e1)
 			continue;
 		}
 		p++;
-		switch(*p) {
+		switch (*p) {
 		case '+': ind += 2; break;
 		case '-': ind -= 2; break;
 		default:
@@ -772,7 +772,7 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
 		*e = vcc_expr_edit(e2->fmt, "(\v1)", e2, NULL);
 		return;
 	}
-	switch(tl->t->tok) {
+	switch (tl->t->tok) {
 	case ID:
 		/*
 		 * XXX: what if var and func/proc had same name ?
@@ -798,7 +798,7 @@ vcc_expr4(struct vcc *tl, struct expr **e, vcc_type_t fmt)
 			vcc_ErrWhere(tl, tl->t);
 			return;
 		}
-		switch(sym->kind) {
+		switch (sym->kind) {
 		case SYM_VAR:
 		case SYM_FUNC:
 		case SYM_ACL:
diff --git a/lib/libvcc/vcc_symb.c b/lib/libvcc/vcc_symb.c
index 10362a3..0d68e48 100644
--- a/lib/libvcc/vcc_symb.c
+++ b/lib/libvcc/vcc_symb.c
@@ -52,7 +52,7 @@ VCC_HandleKind(vcc_type_t fmt)
 const char *
 VCC_SymKind(struct vcc *tl, const struct symbol *s)
 {
-	switch(s->kind) {
+	switch (s->kind) {
 #define VCC_SYMB(uu, ll)	case SYM_##uu: return(#ll);
 #include "tbl/symbol_kind.h"
 	default:
diff --git a/lib/libvmod_directors/shard_dir.c b/lib/libvmod_directors/shard_dir.c
index 3388dd2..90a35fa 100644
--- a/lib/libvmod_directors/shard_dir.c
+++ b/lib/libvmod_directors/shard_dir.c
@@ -343,7 +343,7 @@ sharddir_pick_be(VRT_CTX, struct sharddir *shardd,
 		warmup = shardd->warmup;
 
 	/* short path for cases we dont want ramup/warmup or can't */
-	if (alt > 0 || healthy == IGNORE || (! rampup && warmup == 0) ||
+	if (alt > 0 || healthy == IGNORE || (!rampup && warmup == 0) ||
 	    shard_next(&state, 0, 0) == -1)
 		goto ok;
 



More information about the varnish-commit mailing list