Subject: Re: [PATCH 2/9] xdiff: make xrecord_t.ptr a uint8_t instead of char

From: Patrick Steinhardt <[email-masked]>
Date: Tue, 21 Oct 2025 10:33:42 +0200

On Wed, Oct 15, 2025 at 09:18:14PM +0000, Ezekiel Newren via GitGitGadget wrote:
> diff --git a/xdiff/xdiffi.c b/xdiff/xdiffi.c
> index 6f3998ee54..411a8aa69f 100644
> --- a/xdiff/xdiffi.c
> +++ b/xdiff/xdiffi.c
> @@ -993,11 +993,11 @@ static void xdl_mark_ignorable_lines(xdchange_t *xscr, xdfenv_t *xe, long flags)
>  
>  		rec = &xe->xdf1.recs[xch->i1];
>  		for (i = 0; i < xch->chg1 && ignore; i++)
> -			ignore = xdl_blankline(rec[i].ptr, rec[i].size, flags);
> +			ignore = xdl_blankline((const char *)rec[i].ptr, rec[i].size, flags);
>  
>  		rec = &xe->xdf2.recs[xch->i2];
>  		for (i = 0; i < xch->chg2 && ignore; i++)
> -			ignore = xdl_blankline(rec[i].ptr, rec[i].size, flags);
> +			ignore = xdl_blankline((const char *)rec[i].ptr, rec[i].size, flags);
>  
>  		xch->ignore = ignore;
>  	}

Okay. Seemingly, we convert the structure itself, but we don't convert
any of the functions to accept an `uint8_t`. I guess you drew the line
here so that we don't have to also touch up dozens of function
signatures?

And how did you end up verifying that you added all casts? Does the
compiler flag those as warnings?

In any case, it might be nice to explain both of these details in the
commit message.

Patrick