]> git.ipfire.org Git - thirdparty/git.git/commitdiff
object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter
authorRené Scharfe <l.s.r@web.de>
Thu, 4 Sep 2025 17:58:25 +0000 (19:58 +0200)
committerJunio C Hamano <gitster@pobox.com>
Thu, 4 Sep 2025 20:25:46 +0000 (13:25 -0700)
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 <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
object-name.c

index 88d1313028cf0bda9a9d888abb04defed0ea7ed7..6c6c38d3ccaad1fff556cae4fcea20aa8987f0ab 100644 (file)
@@ -691,10 +691,9 @@ static inline char get_hex_char_from_oid(const struct object_id *oid,
                return hex[oid->hash[pos >> 1] & 0xf];
 }
 
-static int extend_abbrev_len(const struct object_id *oid, void *cb_data)
+static int extend_abbrev_len(const struct object_id *oid,
+                            struct min_abbrev_data *mad)
 {
-       struct min_abbrev_data *mad = cb_data;
-
        unsigned int i = mad->init_len;
        while (mad->hex[i] && mad->hex[i] == get_hex_char_from_oid(oid, i))
                i++;