mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-05-30 00:19:28 +00:00
tools: Add coccinelle script to convert int to bool if returning value is bool
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
This commit is contained in:
parent
f06c4576b7
commit
d8b01b013b
19
scripts/coccinelle/bool_function_type.cocci
Normal file
19
scripts/coccinelle/bool_function_type.cocci
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
@@
|
||||||
|
identifier fn;
|
||||||
|
typedef bool;
|
||||||
|
symbol false;
|
||||||
|
symbol true;
|
||||||
|
@@
|
||||||
|
|
||||||
|
- int
|
||||||
|
+ bool
|
||||||
|
fn (...)
|
||||||
|
{
|
||||||
|
?...
|
||||||
|
return
|
||||||
|
(
|
||||||
|
true
|
||||||
|
|
|
||||||
|
false
|
||||||
|
);
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user