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

Re: [PATCH v2 0/2] string-list.h: make "nr" and "alloc" a "size_t"

From
Derrick Stolee <derrickstolee@github.com>
Date
Mar 7, 2022, 15:55 UTC
Message-ID
<0b0802fb-c977-d8ab-092a-b8a576daf3c6@github.com>
In-Reply-To
<cover-v2-0.2-00000000000-20220307T152316Z-avarab@gmail.com>
On 3/7/2022 10:27 AM, Ævar Arnfjörð Bjarmason wrote:
Show 6 quoted lines
> Change the "struct string_list" to have a "size_t" for "nr" and
> "alloc", ensuring we won't overflow on platforms where size_t is 64
> bit, but "unsigned int" is 32 bit.
> 
> This replaces the v1 1/2 to get rid of the casts we use for Q_(), and
> the 2/2's addition of casts is then consistent with those.

This version looks a lot better, localizing the need for understanding cast implications into the implementation of Q_() instead of every caller.

Thanks, -Stolee

Previous: Philip Oakley
Message 15 of 15 in “string-list.h: make "nr" and "alloc" a "size_t"”
  1. 0/2 string-list.h: make "nr" and "alloc" a "size_t"Ævar Arnfjörð Bjarmason, Mar 7, 2022
  2. 1/2 gettext API users: correct use of casts for Q_()Ævar Arnfjörð Bjarmason, Mar 7, 2022
  3. Derrick StoleeMar 7, 2022
  4. Ævar Arnfjörð BjarmasonMar 7, 2022
  5. Derrick StoleeMar 7, 2022
  6. 2/2 string-list API: change "nr" and "alloc" to "size_t"Ævar Arnfjörð Bjarmason, Mar 7, 2022
  7. Derrick StoleeMar 7, 2022
  8. Ævar Arnfjörð BjarmasonMar 7, 2022
  9. 0/2 string-list.h: make "nr" and "alloc" a "size_t"Ævar Arnfjörð Bjarmason, Mar 7, 2022
  10. 1/2 gettext API users: don't explicitly cast ngettext()'s "n"Ævar Arnfjörð Bjarmason, Mar 7, 2022
  11. 2/2 string-list API: change "nr" and "alloc" to "size_t"Ævar Arnfjörð Bjarmason, Mar 7, 2022
  12. Philip OakleyMar 7, 2022
  13. Junio C HamanoMar 7, 2022
  14. Philip OakleyMar 7, 2022
  15. Derrick StoleeMar 7, 2022

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.