Re: [PATCH v3 00/13] Next size_t stop: pack-objects/delta
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 13, 2026, 16:49 UTC
- Message-ID
- <xmqqbjb6t179.fsf@gitster.g>
- In-Reply-To
- <pull.2175.v3.git.1786632952.gitgitgadget@gmail.com>
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 13 quoted lines
> This patch series continues the effort to stop using unsigned long where > size_t should have been used in the first place. This makes a difference on > 64-bit Windows, where unsigned long is 32-bit. > > With these fixes, the pack-objects machinery works as intended on 64-bit > Windows (and any other 64-bit platform where unsigned long isn't 64-bit). > > Changes since v2: > > * Now zlib_cap_buf() is also widened in this patch series (I had left this > for a later one, originally). > * The unpack_object_header_buffer() function is now also widened in this > here patch series.
Both changes relative to v1 are just as expected. Nicely corrected.
Show 20 quoted lines
> 7: ca928b4579 ! 7: e4528f9034 packfile, git-zlib: widen `use_pack()` and zstream avail fields to `size_t`
> @@ builtin/pack-objects.c: size_t oe_get_size_slow(struct packing_data *pack,
> if (e->type_ != OBJ_OFS_DELTA && e->type_ != OBJ_REF_DELTA) {
> size_t sz;
>
> + ## git-zlib.c ##
> +@@ git-zlib.c: static const char *zerr_to_string(int status)
> +
> + /* uLong is 32-bit on Windows, even on 64-bit systems */
> + #define ULONG_MAX_VALUE maximum_unsigned_value_of_type(uLong)
> +-static inline uInt zlib_buf_cap(unsigned long len)
> ++static inline uInt zlib_buf_cap(size_t len)
> + {
> + return (ZLIB_BUF_MAX < len) ? ZLIB_BUF_MAX : len;
> + }
> +
> ## git-zlib.h ##
> @@
>
> -: ---------- > 13: bc4a58336a packfile: widen `unpack_object_header_buffer()` to `size_t`IIRC, there are some topics in flight that have their own local workaround for some members this series fixes the type from ulong to size_t and they may need to be adjusted but in a good way ;-).
Thanks. Will replace.