Commit 5005595f authored by Federico G. Schwindt's avatar Federico G. Schwindt

Whitespace and related OCD

parent 77663a93
......@@ -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);
......
......@@ -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;
......
......@@ -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;
......
......@@ -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);
......
......@@ -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);
......
......@@ -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];
......
......@@ -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);
......
......@@ -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);
}
......
......@@ -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;
}
......
......@@ -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);
......
......@@ -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;
}
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment