[master] fe97d31c4 Partially reapply return.cocci
Nils Goroll
nils.goroll at uplex.de
Tue Jul 26 10:32:05 UTC 2022
commit fe97d31c4b3c7388a4f33b5b1130f13b4639f8c5
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Tue Jul 26 12:09:07 2022 +0200
Partially reapply return.cocci
diff --git a/bin/varnishd/cache/cache_http.c b/bin/varnishd/cache/cache_http.c
index 7d08808bb..7c6a127f6 100644
--- a/bin/varnishd/cache/cache_http.c
+++ b/bin/varnishd/cache/cache_http.c
@@ -141,22 +141,22 @@ http_hdr_flags(const char *b, const char *e)
struct http_hdrflg *retval;
if (e == NULL)
- return(NULL);
+ return (NULL);
assert(e > b);
u = (unsigned)(e - b);
assert(b + u == e);
if (u < 2 || u > 19) // MIN_WORD_LENGTH & MAX_WORD_LENGTH
- return(NULL);
+ return (NULL);
if (u > 3)
u += http_asso_values[((const uint8_t*)b)[3]];
if (u > 38) // MAX_HASH_VALUE
- return(NULL);
+ return (NULL);
retval = &http_hdrflg[u];
if (retval->hdr == NULL)
- return(NULL);
+ return (NULL);
if (!http_hdr_at(retval->hdr + 1, b, e - b))
- return(NULL);
- return(retval);
+ return (NULL);
+ return (retval);
}
/*--------------------------------------------------------------------*/
diff --git a/bin/varnishd/cache/cache_vrt_filter.c b/bin/varnishd/cache/cache_vrt_filter.c
index becac9dc2..1cfedc449 100644
--- a/bin/varnishd/cache/cache_vrt_filter.c
+++ b/bin/varnishd/cache/cache_vrt_filter.c
@@ -124,7 +124,7 @@ vrt_addfilter(VRT_CTX, const struct vfp *vfp, const struct vdp *vdp)
vp->name = name;
vp->nlen = strlen(name);
VTAILQ_INSERT_TAIL(hd, vp, list);
- return(err);
+ return (err);
}
const char *
diff --git a/bin/varnishd/http1/cache_http1_vfp.c b/bin/varnishd/http1/cache_http1_vfp.c
index 7d057fe2e..d10df7ac5 100644
--- a/bin/varnishd/http1/cache_http1_vfp.c
+++ b/bin/varnishd/http1/cache_http1_vfp.c
@@ -130,8 +130,7 @@ v1f_chunked_pull(struct vfp_ctx *vc, struct vfp_entry *vfe, void *ptr,
do {
lr = v1f_read(vc, htc, buf + u, 1);
if (lr <= 0)
- return (VFP_Error(vc,
- "chunked read err"));
+ return (VFP_Error(vc, "chunked read err"));
} while (u == 1 && buf[0] == '0' && buf[u] == '0');
if (!vct_ishex(buf[u]))
break;
diff --git a/lib/libvarnish/vnum.c b/lib/libvarnish/vnum.c
index 88c688f08..8b90b97c8 100644
--- a/lib/libvarnish/vnum.c
+++ b/lib/libvarnish/vnum.c
@@ -119,7 +119,7 @@ SF_Parse_Integer(const char **ipp, const char **errtxt)
int sign;
retval = sf_parse_int(ipp, errtxt, &sign, 15);
- return(retval * sign);
+ return (retval * sign);
}
/**********************************************************************
@@ -182,7 +182,7 @@ SF_Parse_Decimal(const char **ipp, int strict, const char **errtxt)
retval = SF_Parse_Number(ipp, strict, errtxt);
if (errno)
- return(retval);
+ return (retval);
if (retval < VRT_DECIMAL_MIN || retval > VRT_DECIMAL_MAX)
BAIL(err_fatnum);
return (retval);
@@ -345,9 +345,9 @@ VNUM_2bytes(const char *p, uintmax_t *r, uintmax_t rel)
fval = SF_Parse_Number(&p, 1, &errtxt);
if (errno)
- return(errtxt);
+ return (errtxt);
if (fval < 0)
- return(err_invalid_num);
+ return (err_invalid_num);
fval = VNUM_bytes_unit(fval, p, NULL, rel, &errtxt);
if (errno)
diff --git a/lib/libvcc/vcc_source.c b/lib/libvcc/vcc_source.c
index a0a93cdc0..f717e1192 100644
--- a/lib/libvcc/vcc_source.c
+++ b/lib/libvcc/vcc_source.c
@@ -161,7 +161,7 @@ vcc_lex_include(struct vcc *tl, const struct source *src_sp, struct token *t)
} else {
VSB_cat(tl->sb, "Unknown include flag:\n");
vcc_ErrWhere(tl, t);
- return(t);
+ return (t);
}
tok1 = VTAILQ_NEXT(t, src_list);
AN(tok1);
@@ -196,7 +196,7 @@ vcc_lex_include(struct vcc *tl, const struct source *src_sp, struct token *t)
"include \"./xxxxx\"; needs absolute "
"filename of including file.\n");
vcc_ErrWhere(tl, tok1);
- return(t);
+ return (t);
}
vsb = VSB_new_auto();
AN(vsb);
diff --git a/lib/libvcc/vcc_token.c b/lib/libvcc/vcc_token.c
index 82ab2885f..580b6cb2f 100644
--- a/lib/libvcc/vcc_token.c
+++ b/lib/libvcc/vcc_token.c
@@ -502,7 +502,7 @@ vcc_lex_number(struct vcc *tl, struct source *sp, const char *p)
if (q - p > 13 || r - q > 3) {
VSB_cat(tl->sb, "Too many digits for real.\n");
vcc_ErrWhere(tl, tl->t);
- return(NULL);
+ return (NULL);
}
tl->t->num = strtod(p, &s);
assert(s == tl->t->e);
diff --git a/lib/libvcc/vcc_vmod.c b/lib/libvcc/vcc_vmod.c
index 4394a52ed..3de227b21 100644
--- a/lib/libvcc/vcc_vmod.c
+++ b/lib/libvcc/vcc_vmod.c
@@ -260,7 +260,7 @@ vcc_VmodLoad(const struct vcc *tl, struct vmod_import *vim)
if (err != NULL)
return (-1);
- return(0);
+ return (0);
}
static void v_matchproto_(vcc_do_stanza_f)
diff --git a/vmod/vmod_debug_acl.c b/vmod/vmod_debug_acl.c
index 30a35df2e..b7b772593 100644
--- a/vmod/vmod_debug_acl.c
+++ b/vmod/vmod_debug_acl.c
@@ -183,7 +183,7 @@ xyzzy_sweep_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip0, VCL_IP ip1, VCL_INT step)
AN(ip1);
assert(step > 0);
if (setup_sweep(ctx, asw, ip0, ip1, step))
- return(NULL);
+ return (NULL);
vsb = VSB_new_auto();
AN(vsb);
@@ -247,7 +247,7 @@ xyzzy_time_acl(VRT_CTX, VCL_ACL acl, VCL_IP ip0, VCL_IP ip1,
assert(turnus > 0);
if (setup_sweep(ctx, asw, ip0, ip1, step))
- return(-1);
+ return (-1);
do {
(void)VRT_acl_match(ctx, acl, asw->probe);
} while (step_sweep(asw) <= 0);
More information about the varnish-commit
mailing list