summaryrefslogtreecommitdiffstats
path: root/tools/coccinelle/int_to_bool_function.cocci
blob: f86fe70be2db16ec0c4a6a65f8adde7d36e6b26e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
@@
identifier fn;
typedef bool;
symbol false;
symbol true;
identifier I;
struct thread *thread;
@@

- int
+ bool
fn (...)
{
... when strict
    when != I = THREAD_ARG(thread);
(
- return 0;
+ return false;
|
- return 1;
+ return true;
)
?...
}