On 09/08/2010 02:18 PM, Tor Didriksen wrote:
> On 2010-09-08 14:06, Mats Kindahl wrote:
>> On 09/08/2010 01:15 PM, Konstantin Osipov wrote:
>>
>>> * Davi Arnaut<davi.arnaut@stripped> [10/09/05 20:09]:
>>>
>>>
>>>> I haven't keep up with the thread, but I think the my_bool for C
>>>> code is a bit of silliness. We should just stick to int where
>>>> applicable and be done with it.
>>>>
>>>>
>>> Sticking to int leads to pollution of return value range.
>>> Our coding convention is that we always return 0/FALSE for
>>> success, 1/TRUE for failure.
>>>
>>>
>> One way to avoid the problems that Mark points out is to redefine
>> my_bool to be "int". This would work for all places where my_bool is
>> used and IIRC, there are no places in ABIs where my_bool is used. If
>> there are, it is easy to replace them with "unsigned char" to ensure
>> that the ABI does not change.
>>
> naah, I think we want sizeof(my_bool) == 1
Why?
/Matz
>
> -- didrik
>
>> Just my few cents,
>> Mats Kindahl
>>
>>
>>
>>
>
>
| Thread |
|---|
| • [STYLE] use true/false in C++, not TRUE/FALSE | Guilhem Bichot | 26 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Roy Lyseng | 26 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | MARK CALLAGHAN | 26 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Guilhem Bichot | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | MARK CALLAGHAN | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Guilhem Bichot | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Jay Pipes | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Davi Arnaut | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Jay Pipes | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Davi Arnaut | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | MARK CALLAGHAN | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Davi Arnaut | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | MARK CALLAGHAN | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Roy Lyseng | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | MARK CALLAGHAN | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Michael Widenius | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Jay Pipes | 8 Sep |
| • RE: [STYLE] use true/false in C++, not TRUE/FALSE | Vladislav Vaintroub | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Roy Lyseng | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Davi Arnaut | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Michael Widenius | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Davi Arnaut | 8 Sep |
| • RE: [STYLE] use true/false in C++, not TRUE/FALSE | Vladislav Vaintroub | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Michael Widenius | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Konstantin Osipov | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Mats Kindahl | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Tor Didriksen | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Mats Kindahl | 8 Sep |
| • RE: [STYLE] use true/false in C++, not TRUE/FALSE | Vladislav Vaintroub | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Mats Kindahl | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Tor Didriksen | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Mats Kindahl | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Jay Pipes | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Michael Widenius | 8 Sep |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | MARK CALLAGHAN | 31 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Mats Kindahl | 27 Aug |
| • Re: [STYLE] use true/false in C++, not TRUE/FALSE | Michael Widenius | 8 Sep |