Commit ee1f86d2 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Writing an article about the utility of asserts, I noticed some inconsistent

whitespace with asserts.
parent 1d588b3f
...@@ -500,7 +500,7 @@ VBP_Insert(struct backend *b, const struct vrt_backend_probe *p, ...@@ -500,7 +500,7 @@ VBP_Insert(struct backend *b, const struct vrt_backend_probe *p,
} }
VTAILQ_FOREACH(vcl, &vt->vcls, list) VTAILQ_FOREACH(vcl, &vt->vcls, list)
assert (vcl->probep != p); assert(vcl->probep != p);
vcl = vbp_new_vcl(p, hosthdr); vcl = vbp_new_vcl(p, hosthdr);
Lck_Lock(&vbp_mtx); Lck_Lock(&vbp_mtx);
......
...@@ -525,7 +525,7 @@ BAN_Reload(const uint8_t *ban, unsigned len) ...@@ -525,7 +525,7 @@ BAN_Reload(const uint8_t *ban, unsigned len)
VTAILQ_FOREACH(b, &ban_head, list) { VTAILQ_FOREACH(b, &ban_head, list) {
t1 = ban_time(b->spec); t1 = ban_time(b->spec);
assert (t1 < t2); assert(t1 < t2);
t2 = t1; t2 = t1;
if (t1 == t0) { if (t1 == t0) {
Lck_Unlock(&ban_mtx); Lck_Unlock(&ban_mtx);
......
...@@ -152,7 +152,7 @@ vrt_init_dir(struct cli *cli, struct director **bp, int idx, ...@@ -152,7 +152,7 @@ vrt_init_dir(struct cli *cli, struct director **bp, int idx,
te = t->members; te = t->members;
for (i = 0; i < t->nmember; i++, vh++, te++) { for (i = 0; i < t->nmember; i++, vh++, te++) {
vh->backend = bp[te->host]; vh->backend = bp[te->host];
AN (vh->backend); AN(vh->backend);
} }
vs->nhosts = t->nmember; vs->nhosts = t->nmember;
vs->next_host = 0; vs->next_host = 0;
......
...@@ -326,7 +326,7 @@ ESI_Deliver(struct sess *sp) ...@@ -326,7 +326,7 @@ ESI_Deliver(struct sess *sp)
p = e; p = e;
break; break;
} }
assert (i == VGZ_OK || i == VGZ_END); assert(i == VGZ_OK || i == VGZ_END);
} else { } else {
/* /*
* Ungzip'ed VEC, ungzip'ed ESI response * Ungzip'ed VEC, ungzip'ed ESI response
......
...@@ -424,7 +424,7 @@ EXP_NukeOne(struct busyobj *bo, struct lru *lru) ...@@ -424,7 +424,7 @@ EXP_NukeOne(struct busyobj *bo, struct lru *lru)
Lck_Lock(&exp_mtx); Lck_Lock(&exp_mtx);
VTAILQ_FOREACH(oc, &lru->lru_head, lru_list) { VTAILQ_FOREACH(oc, &lru->lru_head, lru_list) {
CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC); CHECK_OBJ_NOTNULL(oc, OBJCORE_MAGIC);
assert (oc->timer_idx != BINHEAP_NOIDX); assert(oc->timer_idx != BINHEAP_NOIDX);
/* /*
* It wont release any space if we cannot release the last * It wont release any space if we cannot release the last
* reference, besides, if somebody else has a reference, * reference, besides, if somebody else has a reference,
......
...@@ -666,7 +666,7 @@ FetchBody(struct worker *wrk, void *priv) ...@@ -666,7 +666,7 @@ FetchBody(struct worker *wrk, void *priv)
uu += st->len; uu += st->len;
if (bo->do_stream) if (bo->do_stream)
/* Streaming might have started freeing stuff */ /* Streaming might have started freeing stuff */
assert (uu <= obj->len); assert(uu <= obj->len);
else else
assert(uu == obj->len); assert(uu == obj->len);
......
...@@ -224,7 +224,7 @@ wslr(struct vsl_log *vsl, enum VSL_tag_e tag, int id, txt t) ...@@ -224,7 +224,7 @@ wslr(struct vsl_log *vsl, enum VSL_tag_e tag, int id, txt t)
/* Wrap if necessary */ /* Wrap if necessary */
if (VSL_END(vsl->wlp, l) >= vsl->wle) if (VSL_END(vsl->wlp, l) >= vsl->wle)
VSL_Flush(vsl, 1); VSL_Flush(vsl, 1);
assert (VSL_END(vsl->wlp, l) < vsl->wle); assert(VSL_END(vsl->wlp, l) < vsl->wle);
memcpy(VSL_DATA(vsl->wlp), t.b, l); memcpy(VSL_DATA(vsl->wlp), t.b, l);
vsl_hdr(tag, vsl->wlp, l, id); vsl_hdr(tag, vsl->wlp, l, id);
vsl->wlp = VSL_END(vsl->wlp, l); vsl->wlp = VSL_END(vsl->wlp, l);
......
...@@ -216,7 +216,7 @@ smp_open_segs(struct smp_sc *sc, struct smp_signctx *ctx) ...@@ -216,7 +216,7 @@ smp_open_segs(struct smp_sc *sc, struct smp_signctx *ctx)
} }
} }
assert (l >= sc->free_reserve); assert(l >= sc->free_reserve);
sg1 = NULL; sg1 = NULL;
......
...@@ -268,7 +268,7 @@ VTCP_close(int *s) ...@@ -268,7 +268,7 @@ VTCP_close(int *s)
i = close(*s); i = close(*s);
assert (VTCP_Check(i)); assert(VTCP_Check(i));
*s = -1; *s = -1;
} }
......
...@@ -352,7 +352,7 @@ vcc_ParseAction(struct vcc *tl) ...@@ -352,7 +352,7 @@ vcc_ParseAction(struct vcc *tl)
const struct symbol *sym; const struct symbol *sym;
at = tl->t; at = tl->t;
assert (at->tok == ID); 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 (vcc_IdIs(at, atp->name)) {
if (atp->bitmask != 0) if (atp->bitmask != 0)
......
...@@ -118,7 +118,7 @@ VCC_FindSymbol(struct vcc *tl, const struct token *t, enum symkind kind) ...@@ -118,7 +118,7 @@ VCC_FindSymbol(struct vcc *tl, const struct token *t, enum symkind kind)
if (sym->kind == SYM_WILDCARD && if (sym->kind == SYM_WILDCARD &&
(t->e - t->b > sym->nlen) && (t->e - t->b > sym->nlen) &&
!memcmp(sym->name, t->b, sym->nlen)) { !memcmp(sym->name, t->b, sym->nlen)) {
AN (sym->wildcard); AN(sym->wildcard);
return (sym->wildcard(tl, t, sym)); return (sym->wildcard(tl, t, sym));
} }
if (kind != SYM_NONE && kind != sym->kind) if (kind != SYM_NONE && kind != sym->kind)
......
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