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
Patrick Steinhardt <ps@pks.im>
Date
Mar 21, 2024, 10:30 UTC
Message-ID
<ZfwMQdzvyRMAIvtB@tanuki>
In-Reply-To
<pull.1690.git.1710664071.gitgitgadget@gmail.com>
On Sun, Mar 17, 2024 at 08:27:49AM +0000, Mohit Marathe via GitGitGadget wrote:
Show 8 quoted lines
> Hello,
> 
> 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.
> 
> I appreciate your review and feedback on this patch series.

I really appreciate you working on this -- our mismatch of types really irks me a ton, so I'm very happy to see some fixes. I've provided a bunch of feedback for your patch 1/2, where we need to be quite a bit more careful about the blast radius of each of the changes.

I'd recommend to split that patch up into multiple parts. While each of the changes is basically only changing some types around, it's rather involved to review as you have to also investigate the vicinity of each change quite vigorously. So at the very least I would recommend to split out patches for every change that requires further changes, e.g. to the return types of additional functions.

Thanks!
Patrick
Previous: Junio C Hamano
Message 6 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.