summaryrefslogtreecommitdiffstats
path: root/tools/coccinelle/bool_function.cocci
diff options
context:
space:
mode:
Diffstat (limited to 'tools/coccinelle/bool_function.cocci')
-rw-r--r--tools/coccinelle/bool_function.cocci21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/coccinelle/bool_function.cocci b/tools/coccinelle/bool_function.cocci
new file mode 100644
index 0000000..0328ecf
--- /dev/null
+++ b/tools/coccinelle/bool_function.cocci
@@ -0,0 +1,21 @@
+@@
+identifier fn;
+typedef bool;
+symbol false;
+symbol true;
+@@
+
+bool fn ( ... )
+{
+<...
+return
+(
+- 0
++ false
+|
+- 1
++ true
+)
+ ;
+...>
+}