Merge branch 'jc/calloc-fix'
Code clean-up. * jc/calloc-fix: xcalloc: use CALLOC_ARRAY() when applicablemaint
commit
eabacfd9cb
|
@ -2313,11 +2313,9 @@ static void prepare_shallow_update(struct shallow_info *si)
|
||||||
ALLOC_ARRAY(si->used_shallow, si->shallow->nr);
|
ALLOC_ARRAY(si->used_shallow, si->shallow->nr);
|
||||||
assign_shallow_commits_to_refs(si, si->used_shallow, NULL);
|
assign_shallow_commits_to_refs(si, si->used_shallow, NULL);
|
||||||
|
|
||||||
si->need_reachability_test =
|
CALLOC_ARRAY(si->need_reachability_test, si->shallow->nr);
|
||||||
xcalloc(si->shallow->nr, sizeof(*si->need_reachability_test));
|
CALLOC_ARRAY(si->reachable, si->shallow->nr);
|
||||||
si->reachable =
|
CALLOC_ARRAY(si->shallow_ref, si->ref->nr);
|
||||||
xcalloc(si->shallow->nr, sizeof(*si->reachable));
|
|
||||||
si->shallow_ref = xcalloc(si->ref->nr, sizeof(*si->shallow_ref));
|
|
||||||
|
|
||||||
for (i = 0; i < si->nr_ours; i++)
|
for (i = 0; i < si->nr_ours; i++)
|
||||||
si->need_reachability_test[si->ours[i]] = 1;
|
si->need_reachability_test[si->ours[i]] = 1;
|
||||||
|
|
|
@ -69,7 +69,7 @@ int cmd__bloom(int argc, const char **argv)
|
||||||
struct bloom_filter filter;
|
struct bloom_filter filter;
|
||||||
int i = 2;
|
int i = 2;
|
||||||
filter.len = (settings.bits_per_entry + BITS_PER_WORD - 1) / BITS_PER_WORD;
|
filter.len = (settings.bits_per_entry + BITS_PER_WORD - 1) / BITS_PER_WORD;
|
||||||
filter.data = xcalloc(filter.len, sizeof(unsigned char));
|
CALLOC_ARRAY(filter.data, filter.len);
|
||||||
|
|
||||||
if (argc - 1 < i)
|
if (argc - 1 < i)
|
||||||
usage(bloom_usage);
|
usage(bloom_usage);
|
||||||
|
|
Loading…
Reference in New Issue