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

Re: [PATCH 0/2] utf8: change return type of some helpers from int to size_t

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 17, 2024, 16:51 UTC
Message-ID
<xmqq7ci0n6mx.fsf@gitster.g>
In-Reply-To
<pull.1690.git.1710664071.gitgitgadget@gmail.com>
"Mohit Marathe via GitGitGadget" <gitgitgadget@gmail.com> writes:
> There are lot of places in the codebase where int is used to store size of
> an object instead of size_t (which is better alternative due to reasons like
> portability, readability, etc). This patch series accomplishes one such
> #TODO comment, which addresses this issue.
Nice. In principle this is the right thing to do.

To reviewers, if I were reviewing this series (which I will not in the next 24 hours), I'd pay particular attention to the callers that currently accept "int" and use negative return value as an sign of a failure. Moving to "size_t" from "int" will break such callers.

Thanks.
Previous: Mohit Marathe via GitGitGadgetNext: Patrick Steinhardt
Message 5 of 6 in “utf8: change return type of some helpers from int to size_t”
  1. 0/2 utf8: change return type of some helpers from int to size_tMohit Marathe via GitGitGadget, Mar 17, 2024
  2. 1/2 utf8: change type from int to size_tMohit Marathe via GitGitGadget, Mar 17, 2024
  3. Patrick SteinhardtMar 21, 2024
  4. 2/2 utf8: make utf8_strnwidth & utf8_strwidth return size_t instead of intMohit Marathe via GitGitGadget, Mar 17, 2024
  5. Junio C HamanoMar 17, 2024
  6. Patrick SteinhardtMar 21, 2024

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.