summaryrefslogtreecommitdiff
path: root/coccinelle/empty-if.cocci
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2015-09-09 15:12:28 +0200
committerDaniel Mack <github@zonque.org>2015-09-09 15:12:28 +0200
commitd7acddde057d25a4fb7835943ef3c73f262ba54f (patch)
treecb6e0ab245a4ed43f1367b8164b8022f0e77fc13 /coccinelle/empty-if.cocci
parent02736a9abce02eb53b0d504f96fc7b3e4f077020 (diff)
parent57255510c95ca3369d241502f26d7bbd8fac30a6 (diff)
Merge pull request #1216 from poettering/coccinelle-fixes-2
Coccinelle fixes 2
Diffstat (limited to 'coccinelle/empty-if.cocci')
-rw-r--r--coccinelle/empty-if.cocci47
1 files changed, 42 insertions, 5 deletions
diff --git a/coccinelle/empty-if.cocci b/coccinelle/empty-if.cocci
index ebd0bfddce..026c461ee6 100644
--- a/coccinelle/empty-if.cocci
+++ b/coccinelle/empty-if.cocci
@@ -1,19 +1,56 @@
@@
-expression e, f;
+expression e, f, g, h, i, j;
statement s, t;
@@
(
if (e) {
-if (f) s
+(
+if (h) s
+|
+if (h) s else t
+|
+while (h) s
+|
+for (h; i; j) s
+)
}
|
-if (e) {
-if (f) s
-else t
+while (e) {
+(
+if (h) s
+|
+if (h) s else t
+|
+while (h) s
+|
+for (h; i; j) s
+)
+}
+|
+for (e; f; g) {
+(
+if (h) s
+|
+if (h) s else t
+|
+while (h) s
+|
+for (h; i; j) s
+)
}
|
- if (e) {
+ if (e)
s
- }
+|
+- while (e) {
++ while (e)
+s
+- }
+|
+- for (e; f; g) {
++ for (e; f; g)
+s
+- }
)