Re: [PATCH 01/12] diff-delta: widen `struct delta_index`' size fields to `size_t`
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 5, 2026, 13:51 UTC
- Message-ID
- <2f4a466a-82d0-5a21-d1a6-4482d4d3f841@gmx.de>
- In-Reply-To
- <anMA8QmycpIksrQ6@pks.im>
Hi Patrick,
On Wed, 5 Aug 2026, Patrick Steinhardt wrote:
Show 20 quoted lines
> On Thu, Jul 09, 2026 at 04:49:28PM +0000, Johannes Schindelin via GitGitGadget wrote:
> > diff --git a/diff-delta.c b/diff-delta.c
> > index 43c339f010..b6b65d7607 100644
> > --- a/diff-delta.c
> > +++ b/diff-delta.c
> > @@ -125,9 +125,9 @@ struct unpacked_index_entry {
> > };
> >
> > struct delta_index {
> > - unsigned long memsize;
> > + size_t memsize;
> > const void *src_buf;
> > - unsigned long src_size;
> > + size_t src_size;
> > unsigned int hash_mask;
> > struct index_entry *hash[FLEX_ARRAY];
> > };
>
> `sizeof_delta_index` returns `index->memsize`, so we'll also have to
> adapt that function's return value and its callers.Good call! Will fix.
Ciao, Johannes
Show 17 quoted lines
> > > @@ -140,7 +140,7 @@ struct delta_index * create_delta_index(const void *buf, unsigned long bufsize) > > I was about to complain that the input parameter here uses `unsigned > long`, too. But the next patch addresses that. > > > struct unpacked_index_entry *entry, **hash; > > struct index_entry *packed_entry, **packed_hash; > > void *mem; > > - unsigned long memsize; > > + size_t memsize; > > > > if (!buf || !bufsize) > > return NULL; > > Patrick >