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