diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:12 +0900 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-10-18 14:19:12 +0900 |
commit | ff35d2a9984189d6c92399004fd6a7bc4bd7c769 (patch) | |
tree | 4ae6d32a6cd7cf8d1e7f044b3fd8563aad60a49e | |
parent | Merge branch 'ad/doc-markup-fix' into maint (diff) | |
parent | coccinelle: remove parentheses that become unnecessary (diff) | |
download | tgif-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.cocci | 10 |
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); |