[6.0] f5420f4e9 Wrap the "if (ctx->handling) return; " check in a macro for readability
Dridi Boukelmoune
dridi.boukelmoune at gmail.com
Thu Jun 27 17:05:10 UTC 2019
commit f5420f4e9e849881d64c26e2421f94d13f556bff
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date: Wed Jan 9 09:32:31 2019 +0000
Wrap the "if (ctx->handling) return;" check in a macro for readability
diff --git a/lib/libvcc/vcc_compile.c b/lib/libvcc/vcc_compile.c
index bcfaadcab..c0ee7b0bb 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -580,6 +580,8 @@ vcc_CompileSource(struct vcc *tl, struct source *sp)
Fh(tl, 0, "/* ---===### VCC generated .h code ###===---*/\n");
Fc(tl, 0, "\n/* ---===### VCC generated .c code ###===---*/\n");
+ Fc(tl, 0, "\n#define END_ if (*ctx->handling) return\n");
+
vcc_Parse_Init(tl);
vcc_Expr_Init(tl);
diff --git a/lib/libvcc/vcc_parse.c b/lib/libvcc/vcc_parse.c
index 2b5075358..af8e6a45e 100644
--- a/lib/libvcc/vcc_parse.c
+++ b/lib/libvcc/vcc_parse.c
@@ -149,7 +149,7 @@ vcc_Compound(struct vcc *tl)
Fb(tl, 1, "{\n");
tl->indent += INDENT;
C(tl, ";");
- Fb(tl, 1, "if (*ctx->handling) return;\n");
+ Fb(tl, 1, "END_;\n");
while (1) {
ERRCHK(tl);
t = tl->t;
@@ -206,7 +206,7 @@ vcc_Compound(struct vcc *tl)
vcc_ErrWhere(tl, tl->t);
return;
}
- Fb(tl, 1, "if (*ctx->handling) return;\n");
+ Fb(tl, 1, "END_;\n");
}
}
More information about the varnish-commit
mailing list