[master] 64e2ba279 Wrap the "if (ctx->handling) return; " check in a macro for readability
Poul-Henning Kamp
phk at FreeBSD.org
Wed Jan 9 10:47:07 UTC 2019
commit 64e2ba27932aefcd5ab4754bf11c28563fe5e7f4
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 adfee9579..6182eadea 100644
--- a/lib/libvcc/vcc_compile.c
+++ b/lib/libvcc/vcc_compile.c
@@ -579,6 +579,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