Commit fda02024 authored by Dridi Boukelmoune's avatar Dridi Boukelmoune

cocci: Remove redundant AN() checks after REPLACE()

Except those present in varnishtest/vtest.
parent 1b0a51cc
...@@ -246,7 +246,6 @@ vsmw_delseg(struct vsmw *vsmw, struct vsmwseg *seg) ...@@ -246,7 +246,6 @@ vsmw_delseg(struct vsmw *vsmw, struct vsmwseg *seg)
} else { } else {
vsmw_mkent(vsmw, vsmw->idx); vsmw_mkent(vsmw, vsmw->idx);
REPLACE(t, VSB_data(vsmw->vsb)); REPLACE(t, VSB_data(vsmw->vsb));
AN(t);
fd = openat(vsmw->vdirfd, fd = openat(vsmw->vdirfd,
t, O_WRONLY|O_CREAT|O_EXCL, vsmw->mode); t, O_WRONLY|O_CREAT|O_EXCL, vsmw->mode);
assert(fd >= 0); assert(fd >= 0);
......
...@@ -137,7 +137,6 @@ mgt_vcl_import_vmod(struct vclprog *vp, const struct vjsn_val *vv) ...@@ -137,7 +137,6 @@ mgt_vcl_import_vmod(struct vclprog *vp, const struct vjsn_val *vv)
ALLOC_OBJ(vf, VMODFILE_MAGIC); ALLOC_OBJ(vf, VMODFILE_MAGIC);
AN(vf); AN(vf);
REPLACE(vf->fname, v_dst); REPLACE(vf->fname, v_dst);
AN(vf->fname);
VTAILQ_INIT(&vf->vcls); VTAILQ_INIT(&vf->vcls);
AZ(mgt_vcl_cache_vmod(v_name, v_file, v_dst)); AZ(mgt_vcl_cache_vmod(v_name, v_file, v_dst));
VTAILQ_INSERT_TAIL(&vmodhead, vf, list); VTAILQ_INSERT_TAIL(&vmodhead, vf, list);
......
...@@ -1122,7 +1122,6 @@ main(int argc, char * const *argv) ...@@ -1122,7 +1122,6 @@ main(int argc, char * const *argv)
if (format != NULL) if (format != NULL)
VUT_Error(vut, 1, "Format already set"); VUT_Error(vut, 1, "Format already set");
REPLACE(format, optarg); REPLACE(format, optarg);
AN(format);
break; break;
case 'f': case 'f':
if (format != NULL) if (format != NULL)
......
...@@ -10,3 +10,10 @@ expression ptr, val; ...@@ -10,3 +10,10 @@ expression ptr, val;
- ptr = strdup(val); - ptr = strdup(val);
- AN(ptr); - AN(ptr);
+ REPLACE(ptr, val); + REPLACE(ptr, val);
@@
expression ptr, val;
@@
REPLACE(ptr, val);
- AN(ptr);
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