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

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.
Previous: Patrick SteinhardtNext: Phillip Wood
Message 4 of 9 in “Fix type conversion Warings from msvc”
  1. 0/4 Fix type conversion Warings from msvcSören Krecker, Jan 26, 2025
  2. 1/4 add-patch: Fix type conversion warnings from msvcSören Krecker, Jan 26, 2025
  3. Patrick SteinhardtJan 27, 2025
  4. Junio C HamanoJan 27, 2025
  5. Phillip WoodJan 29, 2025
  6. Junio C HamanoJan 29, 2025
  7. Phillip WoodJan 30, 2025
  8. Junio C HamanoJan 30, 2025
  9. Patrick SteinhardtJan 27, 2025

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.