mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-18 09:24:31 +00:00
63ee0e4c01
This commits the Coccinelle patch to clean up sizeof handling for malloc/calloc.
42 lines
302 B
Plaintext
42 lines
302 B
Plaintext
@@
|
|
type T;
|
|
expression E;
|
|
expression t;
|
|
@@
|
|
|
|
(
|
|
t = calloc(E, sizeof(*t))
|
|
|
|
|
- t = calloc(E, sizeof(T))
|
|
+ t = calloc(E, sizeof(*t))
|
|
)
|
|
|
|
@@
|
|
type T;
|
|
T *x;
|
|
@@
|
|
|
|
x = malloc(
|
|
- sizeof(T)
|
|
+ sizeof(*x)
|
|
)
|
|
|
|
@@
|
|
type T;
|
|
T *x;
|
|
@@
|
|
|
|
x = calloc(1,
|
|
- sizeof(T)
|
|
+ sizeof(*x)
|
|
)
|
|
|
|
@@
|
|
@@
|
|
|
|
calloc(
|
|
+ 1,
|
|
...
|
|
- ,1
|
|
)
|