From: Patrick Steinhardt Date: Wed, 05 Aug 2026 09:22:57 GMT Subject: Re: [PATCH 01/12] diff-delta: widen `struct delta_index`' size fields to `size_t` Message-ID: In-Reply-To: <69c2c21f05a2aec95f1ef61f861051c289b03dd4.1783615780.git.gitgitgadget@gmail.com> 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. > @@ -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