mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 23:42:27 +00:00
tools: Add coccinelle script to check if bool expressions use short format
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
d87d4e5e0f
commit
1781124916
29
scripts/coccinelle/bool_expression.cocci
Normal file
29
scripts/coccinelle/bool_expression.cocci
Normal file
@ -0,0 +1,29 @@
|
||||
@@
|
||||
bool t;
|
||||
@@
|
||||
|
||||
(
|
||||
- t == true
|
||||
+ t
|
||||
|
|
||||
- true == t
|
||||
+ t
|
||||
|
|
||||
- t != true
|
||||
+ !t
|
||||
|
|
||||
- true != t
|
||||
+ !t
|
||||
|
|
||||
- t == false
|
||||
+ !t
|
||||
|
|
||||
- false == t
|
||||
+ !t
|
||||
|
|
||||
- t != false
|
||||
+ t
|
||||
|
|
||||
- false != t
|
||||
+ t
|
||||
)
|
Loading…
Reference in New Issue
Block a user