From 6dd91b368298e3b3b264a5f2cb5647b2c5cb692b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 16 Oct 2018 15:57:40 +0200 Subject: tree-wide: CMP()ify all the things Let's employ coccinelle to fix everything up automatically for us. --- coccinelle/cmp.cocci | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 coccinelle/cmp.cocci (limited to 'coccinelle') diff --git a/coccinelle/cmp.cocci b/coccinelle/cmp.cocci new file mode 100644 index 0000000000..a34cbe5bf6 --- /dev/null +++ b/coccinelle/cmp.cocci @@ -0,0 +1,28 @@ +@@ +expression x, y; +@@ +- if (x < y) +- return -1; +- if (x > y) +- return 1; +- return 0; ++ return CMP(x, y); +@@ +expression x, y; +@@ +- if (x < y) +- return -1; +- else if (x > y) +- return 1; +- return 0; ++ return CMP(x, y); +@@ +expression x, y; +@@ +- if (x < y) +- return -1; +- else if (x > y) +- return 1; +- else +- return 0; ++ return CMP(x, y); -- cgit v1.2.1