]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: Coccinelle script to convert 0/1 to false/true if variable type is bool
authorDonatas Abraitis <donatas.abraitis@gmail.com>
Wed, 4 Mar 2020 16:47:09 +0000 (18:47 +0200)
committerDonatas Abraitis <donatas.abraitis@gmail.com>
Wed, 4 Mar 2020 16:47:09 +0000 (18:47 +0200)
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
scripts/coccinelle/bool_assignment.cocci [new file with mode: 0644]

diff --git a/scripts/coccinelle/bool_assignment.cocci b/scripts/coccinelle/bool_assignment.cocci
new file mode 100644 (file)
index 0000000..e6146ea
--- /dev/null
@@ -0,0 +1,13 @@
+@@
+bool b;
+@@
+
+(
+ b =
+- 0
++ false
+|
+ b =
+- 1
++ true
+)