diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-11 14:18:32 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-11 14:18:32 -0700 |
commit | a813b19190a75e44b6ebd1ea5317ef5ed914cde0 (patch) | |
tree | 57781b3d45acf013b4e1b506ad324572f0c82e42 /contrib | |
parent | f7e2e592cf9bad03bc3adc44dcbe498b876dc808 (diff) | |
parent | 45ccef87b3cc0ab09ec5fd1186aa0b33298ee8d4 (diff) | |
download | git-a813b19190a75e44b6ebd1ea5317ef5ed914cde0.tar.gz git-a813b19190a75e44b6ebd1ea5317ef5ed914cde0.tar.xz |
Merge branch 'rs/copy-array' into maint
Code cleanup.
* rs/copy-array:
use COPY_ARRAY
add COPY_ARRAY
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/coccinelle/array.cocci | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/contrib/coccinelle/array.cocci b/contrib/coccinelle/array.cocci new file mode 100644 index 000000000..2d7f25d99 --- /dev/null +++ b/contrib/coccinelle/array.cocci @@ -0,0 +1,26 @@ +@@ +type T; +T *dst; +T *src; +expression n; +@@ +- memcpy(dst, src, n * sizeof(*dst)); ++ COPY_ARRAY(dst, src, n); + +@@ +type T; +T *dst; +T *src; +expression n; +@@ +- memcpy(dst, src, n * sizeof(*src)); ++ COPY_ARRAY(dst, src, n); + +@@ +type T; +T *dst; +T *src; +expression n; +@@ +- memcpy(dst, src, n * sizeof(T)); ++ COPY_ARRAY(dst, src, n); |