Re: [PATCH 2/9] xdiff: make xrecord_t.ptr a uint8_t instead of char
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 21, 2025, 08:33 UTC
- Message-ID
- <aPdFZp8GokGoshol@pks.im>
- In-Reply-To
- <7b9e8961d42e0f367ba0782e7d932607aa7e0b0a.1760563101.git.gitgitgadget@gmail.com>
On Wed, Oct 15, 2025 at 09:18:14PM +0000, Ezekiel Newren via GitGitGadget wrote:
Show 18 quoted lines
> 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