]> Kevux Git Server - rit/commit
packfile,delta: drop the `cast_size_t_to_ulong()` wrappers
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 15 Jun 2026 11:52:28 +0000 (11:52 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Jun 2026 14:45:41 +0000 (07:45 -0700)
commit7a3a78cc76da5e2eccf6fc2553a4803c56390ac5
tree130bdec31539c56356360be7169913ffad02d69f
parent188bac14f7258df67030dd3e244dd4a63a406df5
packfile,delta: drop the `cast_size_t_to_ulong()` wrappers

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.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
delta.h
packfile.c
packfile.h
patch-delta.c