From: Johannes Schindelin Date: Sun, 20 Jul 2025 01:39:44 GMT Subject: Re: [PATCH 4/7] xdiff: make fields of xrecord_t Rust friendly Message-ID: <295a911b-b461-e66d-5f9a-501b522f0e12@gmx.de> In-Reply-To: <6df9f50a8f4ca29b2c3ba1e39982b6d516146bb3.1752784344.git.gitgitgadget@gmail.com> Hi Ezekiel, On Thu, 17 Jul 2025, Ezekiel Newren via GitGitGadget wrote: > diff --git a/xdiff/xtypes.h b/xdiff/xtypes.h > index 8b8467360ecf..6e5f67ebf380 100644 > --- a/xdiff/xtypes.h > +++ b/xdiff/xtypes.h > @@ -39,9 +39,9 @@ typedef struct s_chastore { > } chastore_t; > > typedef struct s_xrecord { > - char const *ptr; > - long size; > - unsigned long ha; > + u8 const* ptr; > + usize size; > + u64 ha; > } xrecord_t; > > typedef struct s_xdfile { You cannot do this on its own, you'll also have to do the following (which incidentally fixes the linux32 failures as well as the win test and win+Meson test failures, see https://github.com/dscho/git/actions/runs/16394351471): -- snipsnap -- From 8693c83858a7c9308e54fb470cd7e82bcf67c758 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Sun, 20 Jul 2025 02:34:35 +0200 Subject: [PATCH] fixup! xdiff: make fields of xrecord_t Rust friendly To make `xdl_classify_record()` work, the `ha` attributes of `xrecord_t` and of `s_xdlclass` _must_ have the same range. Otherwise the function won't be able to recognize previously-classified records correctly when the `ha` recorded in the `xrecord_t` is so wide that it won't fit into the `s_xdlclass`' attribute and therefore they won't match when they need to match. Signed-off-by: Johannes Schindelin --- xdiff/xprepare.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xdiff/xprepare.c b/xdiff/xprepare.c index 5a2e52f102cf7..c0463bacd94b0 100644 --- a/xdiff/xprepare.c +++ b/xdiff/xprepare.c @@ -32,7 +32,7 @@ typedef struct s_xdlclass { struct s_xdlclass *next; - unsigned long ha; + u64 ha; char const *line; long size; long idx; -- 2.50.1.windows.1