git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 6/7] packfile,delta: drop the `cast_size_t_to_ulong()` wrappers

From
Patrick Steinhardt <ps@pks.im>
Date
Jun 8, 2026, 13:53 UTC
Message-ID
<aibJYIPm1gvjNXGV@pks.im>
In-Reply-To
<460d733feeaf2a94fe28d7509cc4128e9c0a7610.1780570273.git.gitgitgadget@gmail.com>
On Thu, Jun 04, 2026 at 10:51:11AM +0000, Johannes Schindelin via GitGitGadget wrote:
Show 15 quoted lines
> From: Johannes Schindelin <johannes.schindelin@gmx.de>
> 
> When I started the transition from `unsigned long` to `size_t`, in the
> interest of keeping the patches reviewable, I introduced these calls to
> prevent data type narrowing from silently failing to handle large object
> sizes. I also introduced `*_sz()` variants that would allow most of the
> callers to keep using that `unsigned long` that the 90s kindly asked to
> be returned.
> 
> After the preceding commits, the only places that called the narrow
> wrappers either no longer exist or already use the `_sz` form
> internally, so the wrappers just narrow values back through
> `cast_size_t_to_ulong()` for no reason.
> 
> Drop them and rename the `_sz` variants back to the natural names.

Aha, so you already address my comment I had on one of the preceding patches :)

Patrick
Previous: Johannes Schindelin via GitGitGadgetNext: Johannes Schindelin via GitGitGadget
Message 14 of 29 in “More work supporting objects larger than 4GB on Windows”
  1. 0/7 More work supporting objects larger than 4GB on WindowsJohannes Schindelin via GitGitGadget, Jun 4, 2026
  2. 1/7 compat/msvc: use _chsize_s for ftruncateJohannes Schindelin via GitGitGadget, Jun 4, 2026
  3. 2/7 patch-delta: use size_t for sizesJohannes Schindelin via GitGitGadget, Jun 4, 2026
  4. Patrick SteinhardtJun 8, 2026
  5. Johannes SchindelinJun 15, 2026
  6. 3/7 pack-objects(check_pack_inflate()): use size_t instead of unsigned longJohannes Schindelin via GitGitGadget, Jun 4, 2026
  7. Patrick SteinhardtJun 8, 2026
  8. Johannes SchindelinJun 15, 2026
  9. 4/7 packfile: widen unpack_entry()'s size out-parameter to size_tJohannes Schindelin via GitGitGadget, Jun 4, 2026
  10. Patrick SteinhardtJun 8, 2026
  11. Johannes SchindelinJun 15, 2026
  12. 5/7 pack-objects: use size_t for in-core object sizesJohannes Schindelin via GitGitGadget, Jun 4, 2026
  13. 6/7 packfile,delta: drop the `cast_size_t_to_ulong()` wrappersJohannes Schindelin via GitGitGadget, Jun 4, 2026
  14. Patrick SteinhardtJun 8, 2026
  15. 7/7 odb: use size_t for object_info.sizep and the size APIsJohannes Schindelin via GitGitGadget, Jun 4, 2026
  16. Patrick SteinhardtJun 8, 2026
  17. Johannes SchindelinJun 15, 2026
  18. 0/7 More work supporting objects larger than 4GB on WindowsJohannes Schindelin via GitGitGadget, Jun 15, 2026
  19. 1/7 compat/msvc: use _chsize_s for ftruncateJohannes Schindelin via GitGitGadget, Jun 15, 2026
  20. 2/7 patch-delta: use size_t for sizesJohannes Schindelin via GitGitGadget, Jun 15, 2026
  21. Junio C HamanoJun 16, 2026
  22. 3/7 pack-objects(check_pack_inflate()): use size_t instead of unsigned longJohannes Schindelin via GitGitGadget, Jun 15, 2026
  23. 4/7 packfile: widen unpack_entry()'s size out-parameter to size_tJohannes Schindelin via GitGitGadget, Jun 15, 2026
  24. 5/7 pack-objects: use size_t for in-core object sizesJohannes Schindelin via GitGitGadget, Jun 15, 2026
  25. 6/7 packfile,delta: drop the `cast_size_t_to_ulong()` wrappersJohannes Schindelin via GitGitGadget, Jun 15, 2026
  26. 7/7 odb: use size_t for object_info.sizep and the size APIsJohannes Schindelin via GitGitGadget, Jun 15, 2026
  27. Junio C HamanoJun 15, 2026
  28. Patrick SteinhardtJun 18, 2026
  29. Junio C HamanoJun 18, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.