Mailing List Archive

[master] f5b0b201f Coccinelle script to do remaining work to conclude the previous commit
commit f5b0b201fe29999d5ebc1458b354a7459eed9eac
Author: Nils Goroll <nils.goroll@uplex.de>
Date: Mon Feb 1 18:11:17 2021 +0100

Coccinelle script to do remaining work to conclude the previous commit

diff --git a/tools/coccinelle/archive/wrk_vpi.cocci b/tools/coccinelle/archive/wrk_vpi.cocci
new file mode 100644
index 000000000..bea1e285b
--- /dev/null
+++ b/tools/coccinelle/archive/wrk_vpi.cocci
@@ -0,0 +1,55 @@
+/*
+ * This patch was used to introduce struct wrk_vpi once
+ *
+ * Retained for reference only
+ */
+using "varnish.iso"
+
+@@
+idexpression struct worker *wrk;
+@@
+
+- wrk->handling
++ wrk->vpi->handling
+
+@@
+idexpression struct vrt_ctx *ctx;
+expression reqbo;
+@@
+
+- ctx->handling = &reqbo->wrk->handling;
++ ctx->vpi = reqbo->wrk->vpi;
+
+@@
+idexpression struct vrt_ctx *ctx;
+expression X;
+@@
+
+- *ctx->handling = X
++ ctx->vpi->handling = X
+
+/*
+ * not using idexpression for ctx behind this point
+ * because I failed to teach coccinelle VRT_CTX
+ * (which is not just an iso, but rather a macro
+ * also used in the argument list
+ */
+@@
+identifier F;
+@@
+
+- F(ctx->handling)
++ F(ctx->vpi)
+
+@@
+identifier F;
+@@
+
+- F(*ctx->handling)
++ F(ctx->vpi->handling)
+
+@@
+@@
+
+- *ctx->handling
++ ctx->vpi->handling
_______________________________________________
varnish-commit mailing list
varnish-commit@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-commit