Partially reapply return.cocci

parent 69ca9b7b
......@@ -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);
}
/*--------------------------------------------------------------------*/
......
......@@ -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 *
......
......@@ -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;
......
......@@ -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)
......
......@@ -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);
......
......@@ -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);
......
......@@ -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)
......
......@@ -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);
......
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