diff options
| author | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-03-04 15:29:22 +0200 |
|---|---|---|
| committer | Donatas Abraitis <donatas.abraitis@gmail.com> | 2020-03-04 17:04:52 +0200 |
| commit | d8b01b013b6db7cfdeaaff2cd1baf42f8ce33fc5 (patch) | |
| tree | 44f0897f4eb68fd1d6a43ec0d53d033f58b782e6 | |
| parent | f06c4576b781a76bdc41031d5b97cf858cc2143a (diff) | |
tools: Add coccinelle script to convert int to bool if returning value is bool
Signed-off-by: Donatas Abraitis <donatas.abraitis@gmail.com>
| -rw-r--r-- | scripts/coccinelle/bool_function_type.cocci | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/coccinelle/bool_function_type.cocci b/scripts/coccinelle/bool_function_type.cocci new file mode 100644 index 0000000000..71bf4f53b8 --- /dev/null +++ b/scripts/coccinelle/bool_function_type.cocci @@ -0,0 +1,19 @@ +@@ +identifier fn; +typedef bool; +symbol false; +symbol true; +@@ + +- int ++ bool +fn (...) +{ +?... +return +( + true +| + false +); +} |
