mirror of
https://github.com/git/git
synced 2024-10-30 14:03:28 +00:00
241b5d3ebe
Pass the number of elements first and ther size second, as expected by xcalloc(). Provide a semantic patch, which was actually used to generate the rest of this patch. The semantic patch would generate flip-flop diffs if both arguments are sizeofs. We don't have such a case, and it's hard to imagine the usefulness of such an allocation. If it ever occurs then we could deal with it by duplicating the rule in the semantic patch to make it cancel itself out, or we could change the code to use CALLOC_ARRAY. Signed-off-by: René Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 lines
96 B
Text
10 lines
96 B
Text
@@
|
|
type T;
|
|
T *ptr;
|
|
expression n;
|
|
@@
|
|
xcalloc(
|
|
+ n,
|
|
\( sizeof(T) \| sizeof(*ptr) \)
|
|
- , n
|
|
)
|