Re: [PATCH v3 1/4] add-patch: Fix type conversion warnings from msvc
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jan 27, 2025, 16:10 UTC
- Message-ID
- <xmqq1pwow83z.fsf@gitster.g>
- In-Reply-To
- <Z5c1EIXi7nsB2kJe@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 12 quoted lines
> Note: the word after the subject's subsystem should start with a > lower-case letter. > > On Sun, Jan 26, 2025 at 01:56:35PM +0100, Sören Krecker wrote: >> Fix some compiler warnings from msvc in add-patch.c for value truncation >> form 64 bit to 32 bit integers. Change unsigned long to size_t for >> correct variable size on linux and windows. >> Add macro str_to_size_t for converting a string to size_t. > > There shouldn't be a need for this macro, we already have `strtoumax()`. > And in case the platform doesn't provide it we know to provide our own > implementation.
Thanks for a detailed review; I'll omit them as I agree with all you said there.
If I pretend for a while that moving from ulong to size_t is a good change for line numbers and line counts in the first place, that is.
In other words, I agree with all the improvements your comments suggest to the _implementation_.
Thanks.