@@ -951,13 +951,13 @@ static int *fuzzy_find_matching_lines(struct blame_origin *parent,
951951 max_search_distance_b = ((2 * max_search_distance_a + 1 ) * length_b
952952 - 1 ) / length_a ;
953953
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 );
957957
958958 /* See get_similarity() for details of similarities. */
959959 similarity_count = length_b * (max_search_distance_a * 2 + 1 );
960- similarities = xcalloc ( sizeof ( int ) , similarity_count );
960+ CALLOC_ARRAY ( similarities , similarity_count );
961961
962962 for (i = 0 ; i < length_b ; ++ i ) {
963963 result [i ] = -1 ;
@@ -995,7 +995,7 @@ static void fill_origin_fingerprints(struct blame_origin *o)
995995 return ;
996996 o -> num_lines = find_line_starts (& line_starts , o -> file .ptr ,
997997 o -> file .size );
998- o -> fingerprints = xcalloc ( sizeof ( struct fingerprint ) , o -> num_lines );
998+ CALLOC_ARRAY ( o -> fingerprints , o -> num_lines );
999999 get_line_fingerprints (o -> fingerprints , o -> file .ptr , line_starts ,
10001000 0 , o -> num_lines );
10011001 free (line_starts );
@@ -1853,8 +1853,7 @@ static void blame_chunk(struct blame_entry ***dstq, struct blame_entry ***srcq,
18531853 diffp = NULL ;
18541854
18551855 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 );
18581857 guess_line_blames (parent , target , tlno , offset , same ,
18591858 parent_len , line_blames );
18601859 }
@@ -2216,7 +2215,7 @@ static struct blame_list *setup_blame_list(struct blame_entry *unblamed,
22162215 for (e = unblamed , num_ents = 0 ; e ; e = e -> next )
22172216 num_ents ++ ;
22182217 if (num_ents ) {
2219- blame_list = xcalloc ( num_ents , sizeof ( struct blame_list ) );
2218+ CALLOC_ARRAY ( blame_list , num_ents );
22202219 for (e = unblamed , i = 0 ; e ; e = e -> next )
22212220 blame_list [i ++ ].ent = e ;
22222221 }
@@ -2428,7 +2427,7 @@ static void pass_blame(struct blame_scoreboard *sb, struct blame_origin *origin,
24282427 else if (num_sg < ARRAY_SIZE (sg_buf ))
24292428 memset (sg_buf , 0 , sizeof (sg_buf ));
24302429 else
2431- sg_origin = xcalloc ( num_sg , sizeof ( * sg_origin ) );
2430+ CALLOC_ARRAY ( sg_origin , num_sg );
24322431
24332432 /*
24342433 * The first pass looks for unrenamed path to optimize for
0 commit comments