summaryrefslogtreecommitdiff
path: root/contrib/coccinelle
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-03-19 15:25:39 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-03-19 15:25:39 -0700
commitbfcc6e2a68b95ee71fc606a2e3917af78f1130f9 (patch)
tree30a225e537754d8b2579304d9872b0374be18c73 /contrib/coccinelle
parentMerge branch 'ah/make-fuzz-all-doc-update' (diff)
parentfix xcalloc() argument order (diff)
downloadtgif-bfcc6e2a68b95ee71fc606a2e3917af78f1130f9.tar.xz
Merge branch 'rs/xcalloc-takes-nelem-first'
Code cleanup. * rs/xcalloc-takes-nelem-first: fix xcalloc() argument order
Diffstat (limited to 'contrib/coccinelle')
-rw-r--r--contrib/coccinelle/xcalloc.cocci10
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/coccinelle/xcalloc.cocci b/contrib/coccinelle/xcalloc.cocci
new file mode 100644
index 0000000000..c291011607
--- /dev/null
+++ b/contrib/coccinelle/xcalloc.cocci
@@ -0,0 +1,10 @@
+@@
+type T;
+T *ptr;
+expression n;
+@@
+ xcalloc(
++ n,
+ \( sizeof(T) \| sizeof(*ptr) \)
+- , n
+ )