-
Notifications
You must be signed in to change notification settings - Fork 195
Next size_t stop: pack-objects/delta
#2175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
0012c10
75500c5
5b54041
9850de1
c301958
cfbf6c9
e4528f9
4521a41
f0765f6
c91b4d7
f4f2fa7
b4004b1
bc4a583
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,9 +125,9 @@ struct unpacked_index_entry { | |
| }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Patrick Steinhardt wrote on the Git mailing list (how to reply to this email): 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;
PatrickThere was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Johannes Schindelin wrote on the Git mailing list (how to reply to this email): Hi Patrick,
On Wed, 5 Aug 2026, Patrick Steinhardt wrote:
> 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
>
> > @@ -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
> |
||
|
|
||
| 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]; | ||
| }; | ||
|
|
@@ -140,7 +140,7 @@ struct delta_index * create_delta_index(const void *buf, unsigned long bufsize) | |
| 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; | ||
|
|
@@ -302,7 +302,7 @@ void free_delta_index(struct delta_index *index) | |
| free(index); | ||
| } | ||
|
|
||
| unsigned long sizeof_delta_index(struct delta_index *index) | ||
| size_t sizeof_delta_index(struct delta_index *index) | ||
| { | ||
| if (index) | ||
| return index->memsize; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patrick Steinhardt wrote on the Git mailing list (how to reply to this email):