[master] f9348e4 Whitespace OCD
Federico G. Schwindt
fgsch at lodoss.net
Sun Feb 26 19:56:05 CET 2017
commit f9348e45da476e0993ab995acb0311aac681e969
Author: Federico G. Schwindt <fgsch at lodoss.net>
Date: Sun Feb 26 18:25:49 2017 +0000
Whitespace OCD
diff --git a/bin/varnishd/cache/cache_acceptor.c b/bin/varnishd/cache/cache_acceptor.c
index 2f28418..1cb34f1 100644
--- a/bin/varnishd/cache/cache_acceptor.c
+++ b/bin/varnishd/cache/cache_acceptor.c
@@ -599,7 +599,7 @@ ccf_listen_address(struct cli *cli, const char * const *av, void *priv)
* a race where varnishtest::client would attempt to connect(2)
* before listen(2) has been called.
*/
- while(!pool_accepting)
+ while (!pool_accepting)
VTIM_sleep(.1);
VTAILQ_FOREACH(ls, &heritage.socks, list) {
diff --git a/bin/varnishd/cache/cache_backend_probe.c b/bin/varnishd/cache/cache_backend_probe.c
index 22a5d98..1d743f8 100644
--- a/bin/varnishd/cache/cache_backend_probe.c
+++ b/bin/varnishd/cache/cache_backend_probe.c
@@ -235,7 +235,7 @@ vbp_poke(struct vbp_target *vt)
i = VSA_Get_Proto(sa);
if (i == AF_INET)
vt->good_ipv4 |= 1;
- else if(i == AF_INET6)
+ else if (i == AF_INET6)
vt->good_ipv6 |= 1;
else
WRONG("Wrong probe protocol family");
@@ -455,7 +455,7 @@ vbp_build_req(struct vbp_target *vt, const struct vrt_backend_probe *vbp,
vsb = VSB_new_auto();
AN(vsb);
VSB_clear(vsb);
- if(vbp->request != NULL) {
+ if (vbp->request != NULL) {
VSB_cat(vsb, vbp->request);
} else {
VSB_printf(vsb, "GET %s HTTP/1.1\r\n",
diff --git a/bin/varnishd/cache/cache_ban_lurker.c b/bin/varnishd/cache/cache_ban_lurker.c
index f236b2c..638298c 100644
--- a/bin/varnishd/cache/cache_ban_lurker.c
+++ b/bin/varnishd/cache/cache_ban_lurker.c
@@ -288,7 +288,7 @@ ban_lurker_work(struct worker *wrk, struct vsl_log *vsl)
dt = 49.62; // Random, non-magic
if (cache_param->ban_lurker_sleep == 0) {
- (void) ban_cleantail(NULL);
+ (void)ban_cleantail(NULL);
return (dt);
}
diff --git a/bin/varnishd/cache/cache_cli.c b/bin/varnishd/cache/cache_cli.c
index fa8aba8..905dee5 100644
--- a/bin/varnishd/cache/cache_cli.c
+++ b/bin/varnishd/cache/cache_cli.c
@@ -100,7 +100,7 @@ CLI_Run(void)
do {
i = VCLS_Poll(cls, -1);
- } while(i > 0);
+ } while (i > 0);
VSL(SLT_CLI, 0, "EOF on CLI connection, worker stops");
}
diff --git a/bin/varnishd/cache/cache_expire.c b/bin/varnishd/cache/cache_expire.c
index b93cc59..cfe2122 100644
--- a/bin/varnishd/cache/cache_expire.c
+++ b/bin/varnishd/cache/cache_expire.c
@@ -150,7 +150,7 @@ EXP_Rearm(struct objcore *oc, double now, double ttl, double grace, double keep)
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
assert(oc->refcnt > 0);
- if (! (oc->exp_flags & OC_EF_REFD))
+ if (!(oc->exp_flags & OC_EF_REFD))
return;
if (!isnan(ttl))
diff --git a/bin/varnishd/cache/cache_fetch.c b/bin/varnishd/cache/cache_fetch.c
index 2b89ff4..2b701d4 100644
--- a/bin/varnishd/cache/cache_fetch.c
+++ b/bin/varnishd/cache/cache_fetch.c
@@ -829,7 +829,7 @@ vbf_stp_error(struct worker *wrk, struct busyobj *bo)
now = W_TIM_real(wrk);
VSLb_ts_busyobj(bo, "Error", now);
- if(bo->fetch_objcore->stobj->stevedore != NULL)
+ if (bo->fetch_objcore->stobj->stevedore != NULL)
ObjFreeObj(bo->wrk, bo->fetch_objcore);
// XXX: reset all beresp flags ?
diff --git a/bin/varnishd/cache/cache_fetch_proc.c b/bin/varnishd/cache/cache_fetch_proc.c
index cb094fd..afa8959 100644
--- a/bin/varnishd/cache/cache_fetch_proc.c
+++ b/bin/varnishd/cache/cache_fetch_proc.c
@@ -120,7 +120,7 @@ VFP_Close(struct vfp_ctx *vc)
struct vfp_entry *vfe;
VTAILQ_FOREACH(vfe, &vc->vfp, list) {
- if(vfe->vfp->fini != NULL)
+ if (vfe->vfp->fini != NULL)
vfe->vfp->fini(vc, vfe);
VSLb(vc->wrk->vsl, SLT_VfpAcct, "%s %ju %ju", vfe->vfp->name,
(uintmax_t)vfe->calls, (uintmax_t)vfe->bytes_out);
diff --git a/bin/varnishd/cache/cache_hash.c b/bin/varnishd/cache/cache_hash.c
index d5eeff7..5e08fc8 100644
--- a/bin/varnishd/cache/cache_hash.c
+++ b/bin/varnishd/cache/cache_hash.c
@@ -564,7 +564,7 @@ hsh_rush2(struct worker *wrk, struct rush *r)
CHECK_OBJ_NOTNULL(wrk, WORKER_MAGIC);
CHECK_OBJ_NOTNULL(r, RUSH_MAGIC);
- while(!VTAILQ_EMPTY(&r->reqs)) {
+ while (!VTAILQ_EMPTY(&r->reqs)) {
req = VTAILQ_FIRST(&r->reqs);
CHECK_OBJ_NOTNULL(req, REQ_MAGIC);
VTAILQ_REMOVE(&r->reqs, req, w_list);
diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index 873bd8a..d1396bf 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -507,7 +507,7 @@ http_GetHdrToken(const struct http *hp, const char *hdr,
return (0);
AN(h);
- while(http_split(&h, NULL, ",", &b, &e))
+ while (http_split(&h, NULL, ",", &b, &e))
if (http_istoken(&b, e, token))
break;
if (b == NULL)
@@ -543,7 +543,7 @@ http_GetHdrQ(const struct http *hp, const char *hdr, const char *field)
if (hb == NULL)
return (1.);
- while(http_split(&hb, he, ";", &b, &e)) {
+ while (http_split(&hb, he, ";", &b, &e)) {
if (*b != 'q')
continue;
for (b++; b < e && vct_issp(*b); b++)
diff --git a/bin/varnishd/cache/cache_panic.c b/bin/varnishd/cache/cache_panic.c
index f6446af..009c587 100644
--- a/bin/varnishd/cache/cache_panic.c
+++ b/bin/varnishd/cache/cache_panic.c
@@ -372,7 +372,7 @@ pan_busyobj(struct vsb *vsb, const struct busyobj *bo)
p = "";
/*lint -save -esym(438,p) */
#define BO_FLAG(l, r, w, d) \
- if(bo->l) { VSB_printf(vsb, "%s" #l, p); p = ", "; }
+ if (bo->l) { VSB_printf(vsb, "%s" #l, p); p = ", "; }
#include "tbl/bo_flags.h"
/*lint -restore */
VSB_printf(vsb, "},\n");
@@ -476,7 +476,7 @@ pan_req(struct vsb *vsb, const struct req *req)
VSB_printf(vsb, "flags = {\n");
VSB_indent(vsb, 2);
-#define REQ_FLAG(l, r, w, d) if(req->l) VSB_printf(vsb, #l ",\n");
+#define REQ_FLAG(l, r, w, d) if (req->l) VSB_printf(vsb, #l ",\n");
#include "tbl/req_flags.h"
VSB_indent(vsb, -2);
VSB_printf(vsb, "},\n");
@@ -555,7 +555,7 @@ pan_backtrace(struct vsb *vsb)
p += strlen(buf);
if (*p == ':')
p++;
- while(*p == ' ')
+ while (*p == ' ')
p++;
}
VSB_printf(vsb, "%s", p);
diff --git a/bin/varnishd/cache/cache_req_body.c b/bin/varnishd/cache/cache_req_body.c
index f92dbba..935a9fc 100644
--- a/bin/varnishd/cache/cache_req_body.c
+++ b/bin/varnishd/cache/cache_req_body.c
@@ -87,7 +87,7 @@ vrb_pull(struct req *req, ssize_t maxsize, objiterate_f *func, void *priv)
yet = req->htc->content_length;
if (yet != 0 && req->want100cont) {
req->want100cont = 0;
- (void) req->transport->minimal_response(req, 100);
+ (void)req->transport->minimal_response(req, 100);
}
if (yet < 0)
yet = 0;
diff --git a/bin/varnishd/cache/cache_vrt_var.c b/bin/varnishd/cache/cache_vrt_var.c
index a603ecc..000ae75 100644
--- a/bin/varnishd/cache/cache_vrt_var.c
+++ b/bin/varnishd/cache/cache_vrt_var.c
@@ -474,7 +474,7 @@ VRT_l_req_esi(VRT_CTX, unsigned process_esi)
* Only allow you to turn of esi in the main request
* else everything gets confused
*/
- if(ctx->req->esi_level == 0)
+ if (ctx->req->esi_level == 0)
ctx->req->disable_esi = !process_esi;
}
diff --git a/bin/varnishd/hash/hash_critbit.c b/bin/varnishd/hash/hash_critbit.c
index 97fa154..f29a815 100644
--- a/bin/varnishd/hash/hash_critbit.c
+++ b/bin/varnishd/hash/hash_critbit.c
@@ -210,7 +210,7 @@ hcb_insert(struct worker *wrk, struct hcb_root *root, const uint8_t *digest,
return (oh2);
}
- while(hcb_is_y(pp)) {
+ while (hcb_is_y(pp)) {
y = hcb_l_y(pp);
CHECK_OBJ_NOTNULL(y, HCB_Y_MAGIC);
assert(y->ptr < DIGEST_LEN);
@@ -253,7 +253,7 @@ hcb_insert(struct worker *wrk, struct hcb_root *root, const uint8_t *digest,
p = &root->origo;
AN(*p);
- while(hcb_is_y(*p)) {
+ while (hcb_is_y(*p)) {
y = hcb_l_y(*p);
CHECK_OBJ_NOTNULL(y, HCB_Y_MAGIC);
assert(y->critbit != y2->critbit);
@@ -287,7 +287,7 @@ hcb_delete(struct hcb_root *r, struct objhead *oh)
assert(hcb_is_y(*p));
y = NULL;
- while(1) {
+ while (1) {
assert(hcb_is_y(*p));
y = hcb_l_y(*p);
assert(y->ptr < DIGEST_LEN);
diff --git a/bin/varnishd/http1/cache_http1_fsm.c b/bin/varnishd/http1/cache_http1_fsm.c
index 526ebb3..a197cc5 100644
--- a/bin/varnishd/http1/cache_http1_fsm.c
+++ b/bin/varnishd/http1/cache_http1_fsm.c
@@ -230,7 +230,7 @@ http1_minimal_response(struct req *req, uint16_t status)
req->acct.resp_hdrbytes += wl;
if (wl != l) {
VTCP_Assert(1);
- if (! req->doclose)
+ if (!req->doclose)
req->doclose = SC_REM_CLOSE;
return (-1);
}
diff --git a/bin/varnishd/http1/cache_http1_vfp.c b/bin/varnishd/http1/cache_http1_vfp.c
index f987e3c..50a2123 100644
--- a/bin/varnishd/http1/cache_http1_vfp.c
+++ b/bin/varnishd/http1/cache_http1_vfp.c
@@ -137,7 +137,7 @@ v1f_pull_chunked(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr,
return (VFP_Error(vc, "chunked header too long"));
/* Skip trailing white space */
- while(vct_islws(buf[u]) && buf[u] != '\n') {
+ while (vct_islws(buf[u]) && buf[u] != '\n') {
lr = v1f_read(vc, htc, buf + u, 1);
if (lr <= 0)
return (VFP_Error(vc, "chunked read err"));
@@ -152,7 +152,7 @@ v1f_pull_chunked(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr,
if (q == NULL || *q != '\0')
return (VFP_Error(vc, "chunked header number syntax"));
cl = (ssize_t)cll;
- if((uintmax_t)cl != cll)
+ if ((uintmax_t)cl != cll)
return (VFP_Error(vc, "bogusly large chunk size"));
vfe->priv2 = cl;
diff --git a/bin/varnishd/http2/cache_http2_deliver.c b/bin/varnishd/http2/cache_http2_deliver.c
index 7682a31..dfe2aed 100644
--- a/bin/varnishd/http2/cache_http2_deliver.c
+++ b/bin/varnishd/http2/cache_http2_deliver.c
@@ -216,12 +216,12 @@ h2_deliver(struct req *req, struct boc *boc, int sendbody)
*p++ = (uint8_t)sz - 0x7f;
}
- for(sz1 = 0; sz1 < sz; sz1++)
+ for (sz1 = 0; sz1 < sz; sz1++)
*p++ = (uint8_t)tolower(hp->hd[u].b[sz1]);
}
- while(vct_islws(*++r))
+ while (vct_islws(*++r))
continue;
sz = hp->hd[u].e - r;
assert(sz <= 254);
diff --git a/bin/varnishd/http2/cache_http2_proto.c b/bin/varnishd/http2/cache_http2_proto.c
index abca18d..0c5a5e9 100644
--- a/bin/varnishd/http2/cache_http2_proto.c
+++ b/bin/varnishd/http2/cache_http2_proto.c
@@ -740,7 +740,7 @@ h2_b64url_settings(struct h2_sess *h2, struct req *req)
n = 0;
x = 0;
up = u;
- for(;*p; p++) {
+ for (;*p; p++) {
q = strchr(s, *p);
if (q == NULL)
return (-1);
diff --git a/bin/varnishd/mgt/mgt_jail_solaris.c b/bin/varnishd/mgt/mgt_jail_solaris.c
index 96d1cba..55d8b3b 100644
--- a/bin/varnishd/mgt/mgt_jail_solaris.c
+++ b/bin/varnishd/mgt/mgt_jail_solaris.c
@@ -255,7 +255,7 @@ jail_master_gen(enum jail_master_e e)
static int __match_proto__(jail_init_f)
vjs_init(char **args)
{
- (void) args;
+ (void)args;
return 0;
}
@@ -390,7 +390,7 @@ vjs_setup(enum jail_gen_e jge)
{
priv_set_t *priv_all;
- if (! (priv_all = priv_allocset())) {
+ if (!(priv_all = priv_allocset())) {
MGT_Complain(C_SECURITY,
"Solaris Jail warning: "
" vjs_setup - priv_allocset failed: errno=%d (%s)",
diff --git a/bin/varnishd/mgt/mgt_main.c b/bin/varnishd/mgt/mgt_main.c
index 538ba17..4ce28e0 100644
--- a/bin/varnishd/mgt/mgt_main.c
+++ b/bin/varnishd/mgt/mgt_main.c
@@ -780,7 +780,7 @@ main(int argc, char * const *argv)
(void)rmdir(Cn_arg);
exit(cli->result == CLIS_OK ? 0 : 2);
} else {
- while(!VTAILQ_EMPTY(&f_args)) {
+ while (!VTAILQ_EMPTY(&f_args)) {
fa = VTAILQ_FIRST(&f_args);
VTAILQ_REMOVE(&f_args, fa, list);
mgt_vcl_startup(cli, fa->src,
diff --git a/bin/varnishd/mgt/mgt_param_tweak.c b/bin/varnishd/mgt/mgt_param_tweak.c
index 643563a..12a7a52 100644
--- a/bin/varnishd/mgt/mgt_param_tweak.c
+++ b/bin/varnishd/mgt/mgt_param_tweak.c
@@ -420,7 +420,7 @@ tweak_poolparam(struct vsb *vsb, const struct parspec *par, const char *arg)
break;
}
*pp = px;
- } while(0);
+ } while (0);
VAV_Free(av);
}
return (retval);
diff --git a/bin/varnishd/mgt/mgt_util.c b/bin/varnishd/mgt/mgt_util.c
index 0870089..4c59a9e 100644
--- a/bin/varnishd/mgt/mgt_util.c
+++ b/bin/varnishd/mgt/mgt_util.c
@@ -147,7 +147,7 @@ const void *
MGT_Pick(const struct choice *cp, const char *which, const char *kind)
{
- for(; cp->name != NULL; cp++) {
+ for (; cp->name != NULL; cp++) {
if (!strcmp(cp->name, which))
return (cp->ptr);
}
diff --git a/bin/varnishd/mgt/mgt_vcl.c b/bin/varnishd/mgt/mgt_vcl.c
index b8ac355..7d9e52e 100644
--- a/bin/varnishd/mgt/mgt_vcl.c
+++ b/bin/varnishd/mgt/mgt_vcl.c
@@ -445,7 +445,7 @@ mgt_push_vcls_and_start(struct cli *cli, unsigned *status, char **p)
free(*p);
*p = NULL;
}
- } while(!done);
+ } while (!done);
if (mgt_cli_askchild(status, p, "vcl.use \"%s\"\n", active_vcl->name))
return (1);
diff --git a/bin/varnishd/storage/stevedore_utils.c b/bin/varnishd/storage/stevedore_utils.c
index dcf5e95..6225112 100644
--- a/bin/varnishd/storage/stevedore_utils.c
+++ b/bin/varnishd/storage/stevedore_utils.c
@@ -189,7 +189,7 @@ STV_FileSize(int fd, const char *size, unsigned *granularity, const char *ctx)
* just add OFF_MAX to <limits.h>...
*/
i = 0;
- while(1) {
+ while (1) {
o = l;
if (o == l && o > 0)
break;
diff --git a/bin/varnishd/storage/storage.h b/bin/varnishd/storage/storage.h
index 2c842d0..2b7ae53 100644
--- a/bin/varnishd/storage/storage.h
+++ b/bin/varnishd/storage/storage.h
@@ -127,7 +127,7 @@ extern struct stevedore *stv_transient;
/*--------------------------------------------------------------------*/
-#define STV_Foreach(arg) for(arg = NULL; STV__iter(&arg);)
+#define STV_Foreach(arg) for (arg = NULL; STV__iter(&arg);)
int STV__iter(struct stevedore ** const );
diff --git a/bin/varnishd/storage/storage_file.c b/bin/varnishd/storage/storage_file.c
index 1b8e364..143ab9d 100644
--- a/bin/varnishd/storage/storage_file.c
+++ b/bin/varnishd/storage/storage_file.c
@@ -379,7 +379,7 @@ smf_open_chunk(struct smf_sc *sc, off_t sz, off_t off, off_t *fail, off_t *sum)
p = mmap(NULL, sz, PROT_READ|PROT_WRITE,
MAP_NOCORE | MAP_NOSYNC | MAP_SHARED, sc->fd, off);
if (p != MAP_FAILED) {
- (void) madvise(p, sz, sc->advice);
+ (void)madvise(p, sz, sc->advice);
(*sum) += sz;
new_smf(sc, p, off, sz);
return;
diff --git a/bin/varnishd/storage/storage_persistent.c b/bin/varnishd/storage/storage_persistent.c
index fa0504d..ad2d2a1 100644
--- a/bin/varnishd/storage/storage_persistent.c
+++ b/bin/varnishd/storage/storage_persistent.c
@@ -232,7 +232,7 @@ smp_open_segs(struct smp_sc *sc, struct smp_signspace *spc)
sg1 = NULL;
sg2 = NULL;
- for(; ss <= se; ss++) {
+ for (; ss <= se; ss++) {
ALLOC_OBJ(sg, SMP_SEG_MAGIC);
AN(sg);
VTAILQ_INIT(&sg->objcores);
diff --git a/bin/varnishd/storage/storage_persistent_silo.c b/bin/varnishd/storage/storage_persistent_silo.c
index 1ee1c1d..5061188 100644
--- a/bin/varnishd/storage/storage_persistent_silo.c
+++ b/bin/varnishd/storage/storage_persistent_silo.c
@@ -440,7 +440,7 @@ smp_sml_getobj(struct worker *wrk, struct objcore *oc)
if (l != vbe64dec(o->fa_len))
bad |= 0x100;
- if(bad) {
+ if (bad) {
EXP_ZERO(oc);
EXP_ZERO(so);
}
diff --git a/bin/varnishd/waiter/cache_waiter_epoll.c b/bin/varnishd/waiter/cache_waiter_epoll.c
index 0a59592..23684b6 100644
--- a/bin/varnishd/waiter/cache_waiter_epoll.c
+++ b/bin/varnishd/waiter/cache_waiter_epoll.c
@@ -128,7 +128,7 @@ vwe_thread(void *priv)
Lck_Lock(&vwe->mtx);
active = Wait_HeapDelete(w, wp);
Lck_Unlock(&vwe->mtx);
- if (! active) {
+ if (!active) {
VSL(SLT_Debug, wp->fd, "epoll: spurious event");
continue;
}
diff --git a/bin/varnishd/waiter/cache_waiter_ports.c b/bin/varnishd/waiter/cache_waiter_ports.c
index a7b2e47..b7259bf 100644
--- a/bin/varnishd/waiter/cache_waiter_ports.c
+++ b/bin/varnishd/waiter/cache_waiter_ports.c
@@ -110,7 +110,7 @@ static inline void
vws_port_ev(struct vws *vws, struct waiter *w, port_event_t *ev, double now)
{
struct waited *wp;
- if(ev->portev_source == PORT_SOURCE_USER) {
+ if (ev->portev_source == PORT_SOURCE_USER) {
CAST_OBJ_NOTNULL(wp, ev->portev_user, WAITED_MAGIC);
assert(wp->fd >= 0);
vws->nwaited++;
diff --git a/bin/varnishtest/tests/d00015.vtc b/bin/varnishtest/tests/d00015.vtc
index c3aec0c..8e3aab6 100644
--- a/bin/varnishtest/tests/d00015.vtc
+++ b/bin/varnishtest/tests/d00015.vtc
@@ -21,33 +21,33 @@ varnish v1 -vcl+backend {
vd.debug(3);
std.log("-- invalid replicas");
- if (! vd.reconfigure(replicas=0)) {
+ if (!vd.reconfigure(replicas=0)) {
std.log("reconfigure failed");
}
std.log("-- no changes - no debug output");
- if (! vd.reconfigure(replicas=25)) {
+ if (!vd.reconfigure(replicas=25)) {
std.log("reconfigure failed");
}
std.log("-- no backends");
- if (! vd.clear()) {
+ if (!vd.clear()) {
std.log("clear failed");
}
- if (! vd.reconfigure(replicas=25)) {
+ if (!vd.reconfigure(replicas=25)) {
std.log("reconfigure failed");
}
std.log("-- one backend");
- if (! vd.add_backend(s1)) {
+ if (!vd.add_backend(s1)) {
std.log("add s1 failed");
}
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- no change - no output");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
@@ -59,7 +59,7 @@ varnish v1 -vcl+backend {
vd.add_backend(s1);
vd.add_backend(s2);
vd.clear();
- if (! vd.reconfigure()) {
+ if (!vd.reconfigure()) {
std.log("reconfigure failed");
}
@@ -68,7 +68,7 @@ varnish v1 -vcl+backend {
vd.add_backend(s1);
vd.add_backend(s2);
vd.add_backend(s1);
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
@@ -81,19 +81,19 @@ varnish v1 -vcl+backend {
vd.add_backend(s2, ident="s1");
vd.add_backend(s2, ident="s1_1");
vd.add_backend(s2, ident="s1_2");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- remove s1_2 specifically");
vd.remove_backend(ident="s1_2");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- remove all instances of s1");
vd.remove_backend(s1);
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
@@ -109,19 +109,19 @@ varnish v1 -vcl+backend {
vd.add_backend(s3, "7");
vd.add_backend(s3, "8");
vd.add_backend(s3, "9");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- remove second-last");
vd.remove_backend(ident="8");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- remove last");
vd.remove_backend(ident="9");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
diff --git a/bin/varnishtest/tests/d00016.vtc b/bin/varnishtest/tests/d00016.vtc
index 2e5406d..b58ea29 100644
--- a/bin/varnishtest/tests/d00016.vtc
+++ b/bin/varnishtest/tests/d00016.vtc
@@ -23,33 +23,33 @@ varnish v1 -vcl+backend {
sub vcl_recv {
std.log("-- invalid replicas");
- if (! vd.reconfigure(replicas=0)) {
+ if (!vd.reconfigure(replicas=0)) {
std.log("reconfigure failed");
}
std.log("-- no changes - no debug output");
- if (! vd.reconfigure(replicas=25)) {
+ if (!vd.reconfigure(replicas=25)) {
std.log("reconfigure failed");
}
std.log("-- no backends");
- if (! vd.clear()) {
+ if (!vd.clear()) {
std.log("clear failed");
}
- if (! vd.reconfigure(replicas=25)) {
+ if (!vd.reconfigure(replicas=25)) {
std.log("reconfigure failed");
}
std.log("-- one backend");
- if (! vd.add_backend(s1)) {
+ if (!vd.add_backend(s1)) {
std.log("add s1 failed");
}
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- no change - no output");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
@@ -61,7 +61,7 @@ varnish v1 -vcl+backend {
vd.add_backend(s1);
vd.add_backend(s2);
vd.clear();
- if (! vd.reconfigure()) {
+ if (!vd.reconfigure()) {
std.log("reconfigure failed");
}
@@ -70,7 +70,7 @@ varnish v1 -vcl+backend {
vd.add_backend(s1);
vd.add_backend(s2);
vd.add_backend(s1);
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
@@ -83,19 +83,19 @@ varnish v1 -vcl+backend {
vd.add_backend(s2, ident="s1");
vd.add_backend(s2, ident="s1_1");
vd.add_backend(s2, ident="s1_2");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- remove s1_2 specifically");
vd.remove_backend(ident="s1_2");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- remove all instances of s1");
vd.remove_backend(s1);
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
@@ -111,19 +111,19 @@ varnish v1 -vcl+backend {
vd.add_backend(s3, "7");
vd.add_backend(s3, "8");
vd.add_backend(s3, "9");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- remove second-last");
vd.remove_backend(ident="8");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
std.log("-- remove last");
vd.remove_backend(ident="9");
- if (! vd.reconfigure(replicas=1)) {
+ if (!vd.reconfigure(replicas=1)) {
std.log("reconfigure failed");
}
diff --git a/bin/varnishtest/tests/d00017.vtc b/bin/varnishtest/tests/d00017.vtc
index 808e23b..4d49563 100644
--- a/bin/varnishtest/tests/d00017.vtc
+++ b/bin/varnishtest/tests/d00017.vtc
@@ -29,16 +29,16 @@ varnish v1 -vcl+backend {
sub vcl_init {
new vd = directors.shard();
vd.debug(3);
- if (! vd.add_backend(s1)) {
+ if (!vd.add_backend(s1)) {
std.log("add s1 failed");
}
- if (! vd.add_backend(s2)) {
+ if (!vd.add_backend(s2)) {
std.log("add s2 failed");
}
- if (! vd.add_backend(s3)) {
+ if (!vd.add_backend(s3)) {
std.log("add s3 failed");
}
- if (! vd.reconfigure(replicas=25)) {
+ if (!vd.reconfigure(replicas=25)) {
std.log("reconfigure failed");
}
}
diff --git a/bin/varnishtest/tests/d00018.vtc b/bin/varnishtest/tests/d00018.vtc
index 3ca77be..a3f02e0 100644
--- a/bin/varnishtest/tests/d00018.vtc
+++ b/bin/varnishtest/tests/d00018.vtc
@@ -21,28 +21,28 @@ varnish v1 -vcl+backend {
sub vcl_init {
new vd = directors.shard();
- if (! vd.add_backend(s1)) {
+ if (!vd.add_backend(s1)) {
std.log("add s1 failed");
}
- if (! vd.add_backend(s2)) {
+ if (!vd.add_backend(s2)) {
std.log("add s2 failed");
}
- if (! vd.add_backend(s3)) {
+ if (!vd.add_backend(s3)) {
std.log("add s3 failed");
}
- if (! vd.reconfigure(replicas=25)) {
+ if (!vd.reconfigure(replicas=25)) {
std.log("reconfigure failed");
}
}
sub vcl_recv {
- if(req.url == "/1") {
+ if (req.url == "/1") {
set req.backend_hint = vd.backend(by=KEY, key=1);
}
- if(req.url == "/2") {
+ if (req.url == "/2") {
set req.backend_hint = vd.backend(by=KEY, key=2147483647);
}
- if(req.url == "/3") {
+ if (req.url == "/3") {
set req.backend_hint = vd.backend(by=KEY, key=4294967295);
}
return(pass);
diff --git a/bin/varnishtest/tests/d00021.vtc b/bin/varnishtest/tests/d00021.vtc
index 9258abb..627f717 100644
--- a/bin/varnishtest/tests/d00021.vtc
+++ b/bin/varnishtest/tests/d00021.vtc
@@ -36,7 +36,7 @@ varnish v1 -vcl+backend {
}
sub vcl_recv {
- if(req.url == "/1") {
+ if (req.url == "/1") {
set req.backend_hint = vd.backend(by=KEY,
key=vd.key(alg=CRC32, string="/eishoSu2"));
} else if (req.url == "/2") {
diff --git a/bin/varnishtest/tests/d00022.vtc b/bin/varnishtest/tests/d00022.vtc
index 0aa1fad..3d0e9e1 100644
--- a/bin/varnishtest/tests/d00022.vtc
+++ b/bin/varnishtest/tests/d00022.vtc
@@ -44,17 +44,17 @@ varnish v1 -vcl+backend {
alt=req.restarts,
healthy=ALL);
- if(req.url == "/2" && req.restarts > 0) {
+ if (req.url == "/2" && req.restarts > 0) {
unset req.http.vrstart;
}
- if(req.url == "/3" && req.restarts > 1) {
+ if (req.url == "/3" && req.restarts > 1) {
unset req.http.vrstart;
}
return(pass);
}
sub vcl_deliver {
- if(req.http.vrstart) {
+ if (req.http.vrstart) {
return(restart);
}
}
diff --git a/bin/varnishtest/tests/e00015.vtc b/bin/varnishtest/tests/e00015.vtc
index f5a948b..7d09441 100644
--- a/bin/varnishtest/tests/e00015.vtc
+++ b/bin/varnishtest/tests/e00015.vtc
@@ -24,7 +24,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_recv {
- if(req.url == "/") {
+ if (req.url == "/") {
set req.esi = false;
}
}
diff --git a/bin/varnishtest/tests/e00016.vtc b/bin/varnishtest/tests/e00016.vtc
index b760284..d256c28 100644
--- a/bin/varnishtest/tests/e00016.vtc
+++ b/bin/varnishtest/tests/e00016.vtc
@@ -32,7 +32,7 @@ varnish v1 -vcl+backend {
}
sub vcl_deliver {
set req.esi = true;
- if(req.url == "/body") {
+ if (req.url == "/body") {
set req.esi = false;
}
}
diff --git a/bin/varnishtest/tests/r01494.vtc b/bin/varnishtest/tests/r01494.vtc
index 38880c5..713ceb9 100644
--- a/bin/varnishtest/tests/r01494.vtc
+++ b/bin/varnishtest/tests/r01494.vtc
@@ -13,7 +13,7 @@ server s1 {
varnish v1 -vcl+backend {
sub vcl_backend_response {
- if(bereq.retries == 0) {
+ if (bereq.retries == 0) {
return(retry);
}
}
diff --git a/bin/varnishtest/vtc_h2_tbl.c b/bin/varnishtest/vtc_h2_tbl.c
index ae2ceca..209fa47 100644
--- a/bin/varnishtest/vtc_h2_tbl.c
+++ b/bin/varnishtest/vtc_h2_tbl.c
@@ -285,7 +285,7 @@ void
HPK_FreeCtx(struct hpk_ctx *ctx)
{
- while(!VTAILQ_EMPTY(&ctx->dyntbl))
+ while (!VTAILQ_EMPTY(&ctx->dyntbl))
pop_header(ctx);
free(ctx);
}
diff --git a/bin/varnishtest/vtc_http.c b/bin/varnishtest/vtc_http.c
index 60af496..b81bb70 100644
--- a/bin/varnishtest/vtc_http.c
+++ b/bin/varnishtest/vtc_http.c
@@ -595,13 +595,13 @@ http_rxchunk(struct http *hp)
l = hp->prxbuf;
if (http_rxchar(hp, 2, 0) < 0)
return (-1);
- if(!vct_iscrlf(hp->rxbuf + l)) {
+ if (!vct_iscrlf(hp->rxbuf + l)) {
vtc_log(hp->vl, hp->fatal,
"Wrong chunk tail[0] = %02x",
hp->rxbuf[l] & 0xff);
return (-1);
}
- if(!vct_iscrlf(hp->rxbuf + l + 1)) {
+ if (!vct_iscrlf(hp->rxbuf + l + 1)) {
vtc_log(hp->vl, hp->fatal,
"Wrong chunk tail[1] = %02x",
hp->rxbuf[l + 1] & 0xff);
@@ -708,7 +708,7 @@ cmd_http_rxresp(CMD_ARGS)
AZ(strcmp(av[0], "rxresp"));
av++;
- for(; *av != NULL; av++)
+ for (; *av != NULL; av++)
if (!strcmp(*av, "-no_obj"))
has_obj = 0;
else
@@ -745,7 +745,7 @@ cmd_http_rxresphdrs(CMD_ARGS)
AZ(strcmp(av[0], "rxresphdrs"));
av++;
- for(; *av != NULL; av++)
+ for (; *av != NULL; av++)
vtc_fatal(hp->vl, "Unknown http rxresp spec: %s\n", *av);
http_rxhdr(hp);
http_splitheader(hp, 0);
@@ -876,7 +876,7 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp,
(void)vl;
nullbody = body;
- for(; *av != NULL; av++) {
+ for (; *av != NULL; av++) {
if (!strcmp(*av, "-nolen")) {
nolen = 1;
} else if (!strcmp(*av, "-hdr")) {
@@ -885,7 +885,7 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp,
} else
break;
}
- for(; *av != NULL; av++) {
+ for (; *av != NULL; av++) {
if (!strcmp(*av, "-body")) {
assert(body == nullbody);
REPLACE(body, av[1]);
@@ -894,9 +894,9 @@ http_tx_parse_args(char * const *av, struct vtclog *vl, struct http *hp,
av++;
bodylen = strlen(body);
for (b = body; *b != '\0'; b++) {
- if(*b == '\\' && b[1] == '0') {
+ if (*b == '\\' && b[1] == '0') {
*b = '\0';
- for(c = b+1; *c != '\0'; c++) {
+ for (c = b+1; *c != '\0'; c++) {
*c = c[1];
}
b++;
@@ -1022,7 +1022,7 @@ cmd_http_txresp(CMD_ARGS)
VSB_clear(hp->vsb);
- for(; *av != NULL; av++) {
+ for (; *av != NULL; av++) {
if (!strcmp(*av, "-proto")) {
proto = av[1];
av++;
@@ -1109,7 +1109,7 @@ cmd_http_rxreq(CMD_ARGS)
AZ(strcmp(av[0], "rxreq"));
av++;
- for(; *av != NULL; av++)
+ for (; *av != NULL; av++)
vtc_fatal(vl, "Unknown http rxreq spec: %s\n", *av);
http_rxhdr(hp);
http_splitheader(hp, 1);
@@ -1136,7 +1136,7 @@ cmd_http_rxreqhdrs(CMD_ARGS)
AZ(strcmp(av[0], "rxreqhdrs"));
av++;
- for(; *av != NULL; av++)
+ for (; *av != NULL; av++)
vtc_fatal(hp->vl, "Unknown http rxreq spec: %s\n", *av);
http_rxhdr(hp);
http_splitheader(hp, 1);
@@ -1162,7 +1162,7 @@ cmd_http_rxreqbody(CMD_ARGS)
AZ(strcmp(av[0], "rxreqbody"));
av++;
- for(; *av != NULL; av++)
+ for (; *av != NULL; av++)
vtc_fatal(hp->vl, "Unknown http rxreq spec: %s\n", *av);
http_swallow_body(hp, hp->req, 0);
vtc_log(hp->vl, 4, "bodylen = %s", hp->bodylen);
@@ -1186,7 +1186,7 @@ cmd_http_rxrespbody(CMD_ARGS)
AZ(strcmp(av[0], "rxrespbody"));
av++;
- for(; *av != NULL; av++)
+ for (; *av != NULL; av++)
vtc_fatal(hp->vl, "Unknown http rxrespbody spec: %s\n", *av);
http_swallow_body(hp, hp->resp, 0);
vtc_log(hp->vl, 4, "bodylen = %s", hp->bodylen);
@@ -1240,7 +1240,7 @@ cmd_http_txreq(CMD_ARGS)
VSB_clear(hp->vsb);
- for(; *av != NULL; av++) {
+ for (; *av != NULL; av++) {
if (!strcmp(*av, "-url")) {
url = av[1];
av++;
@@ -1740,7 +1740,7 @@ cmd_http_settings(CMD_ARGS)
CAST_OBJ_NOTNULL(hp, priv, HTTP_MAGIC);
- for(; *av != NULL; av++) {
+ for (; *av != NULL; av++) {
if (!strcmp(*av, "-dectbl")) {
n = strtoul(av[1], &p, 0);
if (*p != '\0')
@@ -1946,7 +1946,7 @@ xxx(void)
memset(&vz, 0, sizeof vz);
- for(n = 0; n < 999999999; n++) {
+ for (n = 0; n < 999999999; n++) {
*ibuf = 0;
for (j = 0; j < 7; j++) {
snprintf(strchr(ibuf, 0), 5, "%x",
diff --git a/bin/varnishtest/vtc_http2.c b/bin/varnishtest/vtc_http2.c
index 745490c..15fe757 100644
--- a/bin/varnishtest/vtc_http2.c
+++ b/bin/varnishtest/vtc_http2.c
@@ -1775,7 +1775,7 @@ cmd_txprio(CMD_ARGS)
s->weight = weight & 0xff;
s->dependency = stid;
- if(exclusive)
+ if (exclusive)
exclusive_stream_dependency(s);
vbe32enc(buf, (stid | exclusive));
diff --git a/bin/varnishtest/vtc_main.c b/bin/varnishtest/vtc_main.c
index f4ed03e..f8057f5 100644
--- a/bin/varnishtest/vtc_main.c
+++ b/bin/varnishtest/vtc_main.c
@@ -666,7 +666,7 @@ main(int argc, char * const *argv)
vb = vev_new_base();
i = 0;
- while(!VTAILQ_EMPTY(&tst_head) || i) {
+ while (!VTAILQ_EMPTY(&tst_head) || i) {
if (!VTAILQ_EMPTY(&tst_head) && njob < npar) {
start_test();
njob++;
diff --git a/bin/varnishtest/vtc_varnish.c b/bin/varnishtest/vtc_varnish.c
index 7c5a7a0..544a63c 100644
--- a/bin/varnishtest/vtc_varnish.c
+++ b/bin/varnishtest/vtc_varnish.c
@@ -227,7 +227,7 @@ varnishlog_thread(void *priv)
opt = VSL_COPT_TAIL;
- while(1) {
+ while (1) {
i = VSL_Next(c);
if (i != 1)
break;
@@ -815,7 +815,7 @@ do_stat_dump_cb(void *priv, const struct VSC_point * const pt)
dp = priv;
v = dp->v;
- if(strcmp(pt->desc->ctype, "uint64_t"))
+ if (strcmp(pt->desc->ctype, "uint64_t"))
return (0);
u = *(const volatile uint64_t*)pt->ptr;
diff --git a/include/vapi/vsm.h b/include/vapi/vsm.h
index 4aebe1f..18d809b 100644
--- a/include/vapi/vsm.h
+++ b/include/vapi/vsm.h
@@ -160,7 +160,7 @@ void VSM__iter0(const struct VSM_data *vd, struct VSM_fantom *vf);
int VSM__itern(const struct VSM_data *vd, struct VSM_fantom *vf);
#define VSM_FOREACH(vf, vd) \
- for(VSM__iter0((vd), (vf)); VSM__itern((vd), (vf));)
+ for (VSM__iter0((vd), (vf)); VSM__itern((vd), (vf));)
/*
* Iterate over all chunks in shared memory
* vf = "struct VSM_fantom *"
diff --git a/include/vtree.h b/include/vtree.h
index b88d9d2..777f234 100644
--- a/include/vtree.h
+++ b/include/vtree.h
@@ -170,7 +170,7 @@ name##_VSPLAY_INSERT(struct name *head, struct type *elm) \
int __comp; \
name##_VSPLAY(head, elm); \
__comp = (cmp)(elm, (head)->sph_root); \
- if(__comp < 0) { \
+ if (__comp < 0) { \
VSPLAY_LEFT(elm, field) = VSPLAY_LEFT((head)->sph_root, field);\
VSPLAY_RIGHT(elm, field) = (head)->sph_root; \
VSPLAY_LEFT((head)->sph_root, field) = NULL; \
diff --git a/lib/libvarnish/vcli_proto.c b/lib/libvarnish/vcli_proto.c
index ee36362..8027fa6 100644
--- a/lib/libvarnish/vcli_proto.c
+++ b/lib/libvarnish/vcli_proto.c
@@ -64,7 +64,7 @@ VCLI_AuthResponse(int S_fd, const char *challenge,
SHA256_Update(&ctx, challenge, 32);
SHA256_Update(&ctx, "\n", 1);
SHA256_Final(buf, &ctx);
- for(i = 0; i < SHA256_LEN; i++)
+ for (i = 0; i < SHA256_LEN; i++)
assert(snprintf(response + 2 * i, 3, "%02x", buf[i]) == 2);
}
@@ -189,7 +189,7 @@ VCLI_ReadResult(int fd, unsigned *status, char **ptr, double tmo)
else
*ptr = p;
return (0);
- } while(0);
+ } while (0);
free(p);
*status = CLIS_COMMS;
diff --git a/lib/libvarnish/vev.c b/lib/libvarnish/vev.c
index e124ba3..e4ad629 100644
--- a/lib/libvarnish/vev.c
+++ b/lib/libvarnish/vev.c
@@ -431,7 +431,7 @@ vev_schedule_one(struct vev_base *evb)
}
k = 0;
- for(j = 1; j < evb->lpfd; j++) {
+ for (j = 1; j < evb->lpfd; j++) {
evb->pev[j]->fd_events = evb->pfd[j].revents;
if (evb->pev[j]->fd_events)
k++;
@@ -440,7 +440,7 @@ vev_schedule_one(struct vev_base *evb)
DBG(evb, "EVENTS %d\n", i);
while (i > 0) {
- for(j = BINHEAP_NOIDX + 1; j < evb->lpfd; j++) {
+ for (j = BINHEAP_NOIDX + 1; j < evb->lpfd; j++) {
e = evb->pev[j];
if (e->fd_events == 0)
continue;
diff --git a/lib/libvarnish/vtim.c b/lib/libvarnish/vtim.c
index 1af791c..0c06f41 100644
--- a/lib/libvarnish/vtim.c
+++ b/lib/libvarnish/vtim.c
@@ -193,7 +193,7 @@ VTIM_format(double t, char *p)
#define WEEKDAY() \
do { \
int i; \
- for(i = 0; i < 7; i++) { \
+ for (i = 0; i < 7; i++) { \
if (!memcmp(p, weekday_name[i], 3)) { \
weekday = i; \
break; \
@@ -208,7 +208,7 @@ VTIM_format(double t, char *p)
#define MONTH() \
do { \
int i; \
- for(i = 0; i < 12; i++) { \
+ for (i = 0; i < 12; i++) { \
if (!memcmp(p, month_name[i], 3)) { \
month = i + 1; \
break; \
diff --git a/lib/libvcc/vcc_acl.c b/lib/libvcc/vcc_acl.c
index 532d1bf..27614fc 100644
--- a/lib/libvcc/vcc_acl.c
+++ b/lib/libvcc/vcc_acl.c
@@ -198,7 +198,7 @@ vcc_acl_try_getaddrinfo(struct vcc *tl, struct acl_e *ae)
}
i4 = i6 = 0;
- for(res = res0; res != NULL; res = res->ai_next) {
+ for (res = res0; res != NULL; res = res->ai_next) {
switch(res->ai_family) {
case PF_INET:
assert(PF_INET < 256);
diff --git a/lib/libvcc/vcc_action.c b/lib/libvcc/vcc_action.c
index 39cabe1..924e3ed 100644
--- a/lib/libvcc/vcc_action.c
+++ b/lib/libvcc/vcc_action.c
@@ -385,7 +385,7 @@ vcc_ParseAction(struct vcc *tl)
at = tl->t;
assert(at->tok == ID);
- for(atp = action_table; atp->name != NULL; atp++) {
+ for (atp = action_table; atp->name != NULL; atp++) {
if (vcc_IdIs(at, atp->name)) {
if (atp->bitmask != 0)
vcc_AddUses(tl, at, atp->bitmask,
diff --git a/lib/libvcc/vcc_storage.c b/lib/libvcc/vcc_storage.c
index ba2f33f..442f02e 100644
--- a/lib/libvcc/vcc_storage.c
+++ b/lib/libvcc/vcc_storage.c
@@ -93,7 +93,7 @@ vcc_stevedore(struct vcc *vcc, const char *stv_name)
sym->rname = TlDup(vcc, buf);
sym->r_methods = ~0;
- for(sv = stvars; sv->name != NULL; sv++) {
+ for (sv = stvars; sv->name != NULL; sv++) {
bprintf(buf, "storage.%s.%s", stv_name, sv->name);
sym = VCC_Symbol(vcc, NULL, buf, NULL, SYM_VAR, 1);
AN(sym);
diff --git a/lib/libvmod_debug/vmod_debug_obj.c b/lib/libvmod_debug/vmod_debug_obj.c
index f503943..ea758ed 100644
--- a/lib/libvmod_debug/vmod_debug_obj.c
+++ b/lib/libvmod_debug/vmod_debug_obj.c
@@ -125,27 +125,27 @@ VCL_VOID __match_proto__()
vmod_obj_test_priv_call(VRT_CTX,
struct vmod_debug_obj *o, struct vmod_priv *priv)
{
- (void) o;
+ (void)o;
vmod_test_priv_call(ctx, priv);
}
VCL_VOID __match_proto__()
vmod_obj_test_priv_vcl(VRT_CTX,
struct vmod_debug_obj *o, struct vmod_priv *priv)
{
- (void) o;
+ (void)o;
vmod_test_priv_vcl(ctx, priv);
}
VCL_STRING __match_proto__()
vmod_obj_test_priv_task(VRT_CTX,
struct vmod_debug_obj *o, struct vmod_priv *priv, VCL_STRING s)
{
- (void) o;
+ (void)o;
return (vmod_test_priv_task(ctx, priv, s));
}
VCL_STRING __match_proto__()
vmod_obj_test_priv_top(VRT_CTX,
struct vmod_debug_obj *o, struct vmod_priv *priv, VCL_STRING s)
{
- (void) o;
+ (void)o;
return (vmod_test_priv_top(ctx, priv, s));
}
diff --git a/lib/libvmod_directors/shard_cfg.c b/lib/libvmod_directors/shard_cfg.c
index 7114cae..7db0f88 100644
--- a/lib/libvmod_directors/shard_cfg.c
+++ b/lib/libvmod_directors/shard_cfg.c
@@ -353,7 +353,7 @@ shardcfg_backend_lookup(const struct backend_reconfig *re,
const struct shard_backend *bb = re->shardd->backend;
for (i = 0; i < max; i++)
- if (! shardcfg_backend_cmp(b, &bb[i]))
+ if (!shardcfg_backend_cmp(b, &bb[i]))
return &bb[i];
return NULL;
@@ -400,7 +400,7 @@ shardcfg_backend_add(struct backend_reconfig *re,
i = re->shardd->n_backend;
} else {
do {
- if (! bb[re->hole_i].backend)
+ if (!bb[re->hole_i].backend)
break;
} while (++(re->hole_i) < re->shardd->n_backend + re->hole_n);
assert(re->hole_i < re->shardd->n_backend + re->hole_n);
@@ -464,7 +464,7 @@ shardcfg_backend_finalize(struct backend_reconfig *re)
assert(re->hole_i < i);
do {
- if (! bb[re->hole_i].backend)
+ if (!bb[re->hole_i].backend)
break;
} while (++(re->hole_i) <= i);
diff --git a/lib/libvmod_directors/shard_dir.c b/lib/libvmod_directors/shard_dir.c
index f801798..3388dd2 100644
--- a/lib/libvmod_directors/shard_dir.c
+++ b/lib/libvmod_directors/shard_dir.c
@@ -139,7 +139,7 @@ shard_next(struct shard_state *state, VCL_INT skip, VCL_BOOL healthy)
c = state->shardd->hashcircle[state->idx].host;
- if (! vbit_test(state->picklist, c)) {
+ if (!vbit_test(state->picklist, c)) {
vbit_set(state->picklist, c);
state->pickcount++;
@@ -303,7 +303,7 @@ sharddir_pick_be(VRT_CTX, struct sharddir *shardd,
init_state(&state, ctx, shardd, vbit_init(picklist_spc, picklist_sz));
sharddir_rdlock(shardd);
- if(shardd->n_backend == 0) {
+ if (shardd->n_backend == 0) {
shard_err0(ctx, shardd, "no backends");
goto err;
}
@@ -369,7 +369,7 @@ sharddir_pick_be(VRT_CTX, struct sharddir *shardd,
* - no change if alternative host is also in rampup or the dice
* has rolled in favour of the chosen host
*/
- if (! rampup ||
+ if (!rampup ||
ctx->now - state.last.changed < alt_r ||
VRND_RandomTestableDouble() * chosen_r <
(ctx->now - state.previous.changed))
diff --git a/lib/libvmod_directors/shard_hash.c b/lib/libvmod_directors/shard_hash.c
index 27dd7b4..365f86b 100644
--- a/lib/libvmod_directors/shard_hash.c
+++ b/lib/libvmod_directors/shard_hash.c
@@ -96,7 +96,7 @@ shard_hash_rs(VCL_STRING s)
static uint32_t __match_proto__(hash_func)
_shard_hash_invalid(VCL_STRING s)
{
- (void) s;
+ (void)s;
WRONG("invalid hash fp _ALG_E_ENVALID");
NEEDLESS(return(0));
}
diff --git a/lib/libvmod_directors/vmod_shard.c b/lib/libvmod_directors/vmod_shard.c
index 25ad12d..8765ef9 100644
--- a/lib/libvmod_directors/vmod_shard.c
+++ b/lib/libvmod_directors/vmod_shard.c
@@ -62,7 +62,7 @@ vmod_shard__init(VRT_CTX, struct vmod_directors_shard **vshardp,
t2b = (uint32_t)t1;
assert(t2a == t2b);
- (void) ctx;
+ (void)ctx;
AN(vshardp);
AZ(*vshardp);
ALLOC_OBJ(vshard, VMOD_SHARD_SHARD_MAGIC);
@@ -95,8 +95,8 @@ VCL_INT __match_proto__(td_directors_shard_key)
enum alg_e alg = parse_alg_e(alg_s);
hash_func hash_fp = shard_hash_f[alg];
- (void) ctx;
- (void) vshard;;
+ (void)ctx;
+ (void)vshard;;
return (VCL_INT)hash_fp(s ? s : "");
}
@@ -118,7 +118,7 @@ VCL_VOID __match_proto__(td_directors_set_rampup)
vmod_shard_set_rampup(VRT_CTX, struct vmod_directors_shard *vshard,
VCL_DURATION duration)
{
- (void) ctx;
+ (void)ctx;
CHECK_OBJ_NOTNULL(vshard, VMOD_SHARD_SHARD_MAGIC);
shardcfg_set_rampup(vshard->shardd, duration);
}
@@ -270,6 +270,6 @@ vmod_shard_debug(VRT_CTX, struct vmod_directors_shard *vshard,
{
CHECK_OBJ_NOTNULL(vshard, VMOD_SHARD_SHARD_MAGIC);
- (void) ctx;
+ (void)ctx;
sharddir_debug(vshard->shardd, i & UINT32_MAX);
}
diff --git a/lib/libvmod_std/vmod_std_conversions.c b/lib/libvmod_std/vmod_std_conversions.c
index bd746bd..7fb736c 100644
--- a/lib/libvmod_std/vmod_std_conversions.c
+++ b/lib/libvmod_std/vmod_std_conversions.c
@@ -53,7 +53,7 @@ vmod_duration(VRT_CTX, VCL_STRING p, VCL_DURATION d)
if (p == NULL)
return (d);
- while(isspace(*p))
+ while (isspace(*p))
p++;
if (*p != '+' && *p != '-' && !isdigit(*p))
@@ -66,7 +66,7 @@ vmod_duration(VRT_CTX, VCL_STRING p, VCL_DURATION d)
if (isnan(r) || e == NULL)
return (d);
- while(isspace(*e))
+ while (isspace(*e))
e++;
/* NB: Keep this list synchronized with VCC */
@@ -87,7 +87,7 @@ vmod_duration(VRT_CTX, VCL_STRING p, VCL_DURATION d)
return (d);
}
- while(isspace(*e))
+ while (isspace(*e))
e++;
if (*e != '\0')
diff --git a/lib/libvmod_std/vmod_std_querysort.c b/lib/libvmod_std/vmod_std_querysort.c
index 2fae3a1..1d7f5af 100644
--- a/lib/libvmod_std/vmod_std_querysort.c
+++ b/lib/libvmod_std/vmod_std_querysort.c
@@ -43,7 +43,7 @@ compa(const void *a, const void *b)
const char * const *pb = b;
const char *a1, *b1;
- for(a1 = pa[0], b1 = pb[0]; a1 < pa[1] && b1 < pb[1]; a1++, b1++)
+ for (a1 = pa[0], b1 = pb[0]; a1 < pa[1] && b1 < pb[1]; a1++, b1++)
if (*a1 != *b1)
return (*a1 - *b1);
return (0);
@@ -100,7 +100,7 @@ vmod_querysort(VRT_CTX, VCL_STRING url)
}
pp[np++] = cq;
/* Skip trivially empty params */
- while(cq[1] == '&')
+ while (cq[1] == '&')
cq++;
pp[np++] = cq + 1;
}
More information about the varnish-commit
mailing list