@@ -951,13 +951,13 @@ static int *fuzzy_find_matching_lines(struct blame_origin *parent,
951
951
max_search_distance_b = ((2 * max_search_distance_a + 1 ) * length_b
952
952
- 1 ) / length_a ;
953
953
954
- result = xcalloc ( sizeof ( int ) , length_b );
955
- second_best_result = xcalloc ( sizeof ( int ) , length_b );
956
- certainties = xcalloc ( sizeof ( int ) , length_b );
954
+ CALLOC_ARRAY ( result , length_b );
955
+ CALLOC_ARRAY ( second_best_result , length_b );
956
+ CALLOC_ARRAY ( certainties , length_b );
957
957
958
958
/* See get_similarity() for details of similarities. */
959
959
similarity_count = length_b * (max_search_distance_a * 2 + 1 );
960
- similarities = xcalloc ( sizeof ( int ) , similarity_count );
960
+ CALLOC_ARRAY ( similarities , similarity_count );
961
961
962
962
for (i = 0 ; i < length_b ; ++ i ) {
963
963
result [i ] = -1 ;
@@ -995,7 +995,7 @@ static void fill_origin_fingerprints(struct blame_origin *o)
995
995
return ;
996
996
o -> num_lines = find_line_starts (& line_starts , o -> file .ptr ,
997
997
o -> file .size );
998
- o -> fingerprints = xcalloc ( sizeof ( struct fingerprint ) , o -> num_lines );
998
+ CALLOC_ARRAY ( o -> fingerprints , o -> num_lines );
999
999
get_line_fingerprints (o -> fingerprints , o -> file .ptr , line_starts ,
1000
1000
0 , o -> num_lines );
1001
1001
free (line_starts );
@@ -1853,8 +1853,7 @@ static void blame_chunk(struct blame_entry ***dstq, struct blame_entry ***srcq,
1853
1853
diffp = NULL ;
1854
1854
1855
1855
if (ignore_diffs && same - tlno > 0 ) {
1856
- line_blames = xcalloc (sizeof (struct blame_line_tracker ),
1857
- same - tlno );
1856
+ CALLOC_ARRAY (line_blames , same - tlno );
1858
1857
guess_line_blames (parent , target , tlno , offset , same ,
1859
1858
parent_len , line_blames );
1860
1859
}
@@ -2216,7 +2215,7 @@ static struct blame_list *setup_blame_list(struct blame_entry *unblamed,
2216
2215
for (e = unblamed , num_ents = 0 ; e ; e = e -> next )
2217
2216
num_ents ++ ;
2218
2217
if (num_ents ) {
2219
- blame_list = xcalloc ( num_ents , sizeof ( struct blame_list ) );
2218
+ CALLOC_ARRAY ( blame_list , num_ents );
2220
2219
for (e = unblamed , i = 0 ; e ; e = e -> next )
2221
2220
blame_list [i ++ ].ent = e ;
2222
2221
}
@@ -2428,7 +2427,7 @@ static void pass_blame(struct blame_scoreboard *sb, struct blame_origin *origin,
2428
2427
else if (num_sg < ARRAY_SIZE (sg_buf ))
2429
2428
memset (sg_buf , 0 , sizeof (sg_buf ));
2430
2429
else
2431
- sg_origin = xcalloc ( num_sg , sizeof ( * sg_origin ) );
2430
+ CALLOC_ARRAY ( sg_origin , num_sg );
2432
2431
2433
2432
/*
2434
2433
* The first pass looks for unrenamed path to optimize for
0 commit comments