summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-10-18 14:19:12 +0900
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-10-18 14:19:12 +0900
commitff35d2a9984189d6c92399004fd6a7bc4bd7c769 (patch)
tree4ae6d32a6cd7cf8d1e7f044b3fd8563aad60a49e
parentMerge branch 'ad/doc-markup-fix' into maint (diff)
parentcoccinelle: remove parentheses that become unnecessary (diff)
downloadtgif-ff35d2a9984189d6c92399004fd6a7bc4bd7c769.tar.xz
Merge branch 'rs/cocci-de-paren-call-params' into maint
Code clean-up. * rs/cocci-de-paren-call-params: coccinelle: remove parentheses that become unnecessary
-rw-r--r--contrib/coccinelle/array.cocci10
1 files changed, 5 insertions, 5 deletions
diff --git a/contrib/coccinelle/array.cocci b/contrib/coccinelle/array.cocci
index c61d1ca8dc..01586821dc 100644
--- a/contrib/coccinelle/array.cocci
+++ b/contrib/coccinelle/array.cocci
@@ -4,7 +4,7 @@ T *dst;
T *src;
expression n;
@@
-- memcpy(dst, src, n * sizeof(*dst));
+- memcpy(dst, src, (n) * sizeof(*dst));
+ COPY_ARRAY(dst, src, n);
@@
@@ -13,7 +13,7 @@ T *dst;
T *src;
expression n;
@@
-- memcpy(dst, src, n * sizeof(*src));
+- memcpy(dst, src, (n) * sizeof(*src));
+ COPY_ARRAY(dst, src, n);
@@
@@ -22,7 +22,7 @@ T *dst;
T *src;
expression n;
@@
-- memcpy(dst, src, n * sizeof(T));
+- memcpy(dst, src, (n) * sizeof(T));
+ COPY_ARRAY(dst, src, n);
@@
@@ -47,7 +47,7 @@ type T;
T *ptr;
expression n;
@@
-- ptr = xmalloc(n * sizeof(*ptr));
+- ptr = xmalloc((n) * sizeof(*ptr));
+ ALLOC_ARRAY(ptr, n);
@@
@@ -55,5 +55,5 @@ type T;
T *ptr;
expression n;
@@
-- ptr = xmalloc(n * sizeof(T));
+- ptr = xmalloc((n) * sizeof(T));
+ ALLOC_ARRAY(ptr, n);