Re: [PATCH v2 02/10] xdiff: use ssize_t for dstart/dend, make them last in xdfile_t
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Nov 6, 2025, 09:55 UTC
- Message-ID
- <14496da7-3d9e-4e07-8893-0a5414fbbe70@gmail.com>
- In-Reply-To
- <9197903add26e5b8af0bb2dd25bf115670e18e8c.1761776388.git.gitgitgadget@gmail.com>
Hi Ezekiel
On 29/10/2025 22:19, Ezekiel Newren via GitGitGadget wrote:
> From: Ezekiel Newren <ezekielnewren@gmail.com> > > ssize_t is appropriate for dstart and dend because they both describe > positive or negative offsets relative to a pointer.
This paragraph and the subject need updating to match the change from ssize_t to ptrdiff_t.
> A future patch will move these fields to a different struct. Moving > them to the end of xdfile_t now, means the field order of xdfile_t will > be disturbed less.
I'm not sure why that matters but I also don't object
Thanks
Phillip
Show 21 quoted lines
> Signed-off-by: Ezekiel Newren <ezekielnewren@gmail.com>
> ---
> xdiff/xtypes.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/xdiff/xtypes.h b/xdiff/xtypes.h
> index f145abba3e..7c8c057bca 100644
> --- a/xdiff/xtypes.h
> +++ b/xdiff/xtypes.h
> @@ -47,10 +47,10 @@ typedef struct s_xrecord {
> typedef struct s_xdfile {
> xrecord_t *recs;
> long nrec;
> - long dstart, dend;
> bool *changed;
> long *rindex;
> long nreff;
> + ptrdiff_t dstart, dend;
> } xdfile_t;
>
> typedef struct s_xdfenv {