Skip to content

Commit ac67aa5

Browse files
committed
Merge branch 'rs/cocci-de-paren-call-params'
Code clean-up. * rs/cocci-de-paren-call-params: coccinelle: remove parentheses that become unnecessary
2 parents e46ebc2 + 9ca356f commit ac67aa5

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

contrib/coccinelle/array.cocci

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ T *dst;
44
T *src;
55
expression n;
66
@@
7-
- memcpy(dst, src, n * sizeof(*dst));
7+
- memcpy(dst, src, (n) * sizeof(*dst));
88
+ COPY_ARRAY(dst, src, n);
99

1010
@@
@@ -13,7 +13,7 @@ T *dst;
1313
T *src;
1414
expression n;
1515
@@
16-
- memcpy(dst, src, n * sizeof(*src));
16+
- memcpy(dst, src, (n) * sizeof(*src));
1717
+ COPY_ARRAY(dst, src, n);
1818

1919
@@
@@ -22,7 +22,7 @@ T *dst;
2222
T *src;
2323
expression n;
2424
@@
25-
- memcpy(dst, src, n * sizeof(T));
25+
- memcpy(dst, src, (n) * sizeof(T));
2626
+ COPY_ARRAY(dst, src, n);
2727

2828
@@
@@ -47,13 +47,13 @@ type T;
4747
T *ptr;
4848
expression n;
4949
@@
50-
- ptr = xmalloc(n * sizeof(*ptr));
50+
- ptr = xmalloc((n) * sizeof(*ptr));
5151
+ ALLOC_ARRAY(ptr, n);
5252

5353
@@
5454
type T;
5555
T *ptr;
5656
expression n;
5757
@@
58-
- ptr = xmalloc(n * sizeof(T));
58+
- ptr = xmalloc((n) * sizeof(T));
5959
+ ALLOC_ARRAY(ptr, n);

0 commit comments

Comments
 (0)