]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
DEV: coccinelle: Add xalloc_cast.cocci
authorTim Duesterhus <tim@bastelstu.be>
Wed, 15 Sep 2021 11:58:47 +0000 (13:58 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 17 Sep 2021 15:22:05 +0000 (17:22 +0200)
This remove's C++ style casts from the return value of malloc/calloc.

see 403fd722ace1d98d3cfe17bbee1382bf58040466

dev/coccinelle/xalloc_cast.cocci [new file with mode: 0644]

diff --git a/dev/coccinelle/xalloc_cast.cocci b/dev/coccinelle/xalloc_cast.cocci
new file mode 100644 (file)
index 0000000..75baa00
--- /dev/null
@@ -0,0 +1,11 @@
+@@
+type T;
+@@
+
+- (T*)
+(
+malloc
+|
+calloc
+)
+  (...)