Skip to content

Commit 069c15d

Browse files
rscharfegitster
authored andcommitted
object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter
Expose the expected type of the second parameter of extend_abbrev_len() instead of casting a void pointer internally. Just a single caller passes in a void pointer, the rest pass the correct type. Let the compiler help keeping it that way. Signed-off-by: René Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a1cf0cf commit 069c15d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

object-name.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -691,10 +691,9 @@ static inline char get_hex_char_from_oid(const struct object_id *oid,
691691
return hex[oid->hash[pos >> 1] & 0xf];
692692
}
693693

694-
static int extend_abbrev_len(const struct object_id *oid, void *cb_data)
694+
static int extend_abbrev_len(const struct object_id *oid,
695+
struct min_abbrev_data *mad)
695696
{
696-
struct min_abbrev_data *mad = cb_data;
697-
698697
unsigned int i = mad->init_len;
699698
while (mad->hex[i] && mad->hex[i] == get_hex_char_from_oid(oid, i))
700699
i++;

0 commit comments

Comments
 (0)