mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-03 06:59:21 +00:00
tools: Add coccinelle script to check if bool functions return bool type
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
1781124916
commit
17fe9bb6e5
21
scripts/coccinelle/bool_function.cocci
Normal file
21
scripts/coccinelle/bool_function.cocci
Normal file
@ -0,0 +1,21 @@
|
||||
@@
|
||||
identifier fn;
|
||||
typedef bool;
|
||||
symbol false;
|
||||
symbol true;
|
||||
@@
|
||||
|
||||
bool fn ( ... )
|
||||
{
|
||||
<...
|
||||
return
|
||||
(
|
||||
- 0
|
||||
+ false
|
||||
|
|
||||
- 1
|
||||
+ true
|
||||
)
|
||||
;
|
||||
...>
|
||||
}
|
Loading…
Reference in New Issue
Block a user