Subject: Re: [PATCH 0/9] Xdiff cleanup part2

From: Junio C Hamano <[email-masked]>
Date: Tue, 21 Oct 2025 06:41:06 -0700

Phillip Wood <[email-masked]> writes:

> Given that this series changes the types of all the "long" struct 
> members to "size_t" I was surprised to see that it adds so many "(long)" 
> casts. At the end of this series there are 38 lines in xdiff/ that 
> contain "(long)" compared to just 4 in master. I had expected that as 
> we'd converted all the members to "size_t" there would be no need to 
> keep using "long" in the code. As rust is going to be optional for quite 
> a while I think we should clean up the C code to avoid casting between 
> "long" and "size_t"

Either we cast here or have existing code that used to use long to
use another type, that needs to be done carefully as we would be
moving code that used signed type to now use unsigned.  While I
agree with you in principle that we shouldn't try to interface
between code pieces with impedance mismatch (for which the need to
cast is an indication), we'd need to draw a line somewhere.

Thanks.