RE: [PATCH v2 0/3] C99: declare bool experiment a success
- From
rsbecker@nexbridge.com <rsbecker@nexbridge.com>
- Date
- Jul 15, 2025, 18:23 UTC
- Message-ID
- <000001dbf5b5$8b316f00$a1944d00$@nexbridge.com>
- In-Reply-To
- <CABPp-BHoTxT1UQtgy2bH=mc1re_LPngKX-50GPh_wbtMMZZpyQ@mail.gmail.com>
On July 15, 2025 1:19 PM Elijah Newren wrote:
Show 57 quoted lines
>On Tue, Jul 15, 2025 at 6:53 AM Phillip Wood <phillip.wood123@gmail.com>
>wrote:
>>
>> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>>
>> We've had a test balloon for C99's bool type since 8277dbe987
>> (git-compat-util: convert skip_{prefix,suffix}{,_mem} to bool,
>> 2023-12-16). As it has been over 18 months since this was added and
>> there have been no complaints let's declare it a success and convert
>> the return type our other string predicates to match.
>>
>> Thank you to everyone who commented on V1, the only change here is to
>> fix the typos in the commit message for patch 2.
>>
>> Base-Commit: a30f80fde927d70950b3b4d1820813480968fb0d
>> Published-As:
>> https://github.com/phillipwood/git/releases/tag/pw%2Fuse-c99-bool%2Fv2
>> View-Changes-At:
>> https://github.com/phillipwood/git/compare/a30f80fde...669687147
>> Fetch-It-Via: git fetch https://github.com/phillipwood/git
>> pw/use-c99-bool/v2
>>
>>
>> Phillip Wood (3):
>> CodingGuildlines: allow the use of bool
>> git-compat-util: convert string predicates to return bool
>> strbuf: convert predicates to return bool
>>
>> Documentation/CodingGuidelines | 3 +++
>> git-compat-util.h | 12 ++++++------
>> strbuf.c | 28 ++++++++++++++--------------
>> strbuf.h | 12 ++++++------
>> 4 files changed, 29 insertions(+), 26 deletions(-)
>>
>> Range-diff against v1:
>> 1: 352f80c49b7 = 1: 352f80c49b7 CodingGuildlines: allow the use of
>> bool
>> 2: a0f9182aa20 ! 2: 0b2402e11cc git-compat-util: convert string predicates to
>return bool
>> @@ Commit message
>> git-compat-util: convert string predicates to return bool
>>
>> Since 8277dbe987 (git-compat-util: convert skip_{prefix,suffix}{,_mem}
>> - to bool, 2023-12-16) a number of our sting predicates have been
>> - returning bool instead of int. Now we've declared that experiment
>> - a success lets convert the return type the case independent
>> + to bool, 2023-12-16) a number of our string predicates have been
>> + returning bool instead of int. Now that we've declared that experiment
>> + a success, let's convert the return type of the case-independent
>> skip_iprefix() and skip_iprefix_mem() functions to match the return
>> - type of their case dependent equivalents. Returning bool instead of
>> + type of their case-dependent equivalents. Returning bool instead of
>> int makes it clear that these functions are predicates.
>>
>> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
>> 3: 7eaf8042061 = 3: 66968714739 strbuf: convert predicates to return
>> boolbool is not standard in all c99 implementations. I have to #include <stdbool.h> in order to use this type. Please make sure there is a mechanism for that.