git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter
@ 2025-09-04 17:58 René Scharfe
  2025-09-04 20:09 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: René Scharfe @ 2025-09-04 17:58 UTC (permalink / raw)
  To: Git List

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>
---
 object-name.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/object-name.c b/object-name.c
index 732056ff5e..1e0118e8a6 100644
--- a/object-name.c
+++ b/object-name.c
@@ -696,10 +696,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++;
-- 
2.51.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-09-08  4:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-04 17:58 [PATCH] object-name: declare pointer type of extend_abbrev_len()'s 2nd parameter René Scharfe
2025-09-04 20:09 ` Junio C Hamano
2025-09-07 16:22   ` René Scharfe
2025-09-08  4:17     ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).