From: Mats Kindahl Date: September 8 2010 12:22pm Subject: Re: [STYLE] use true/false in C++, not TRUE/FALSE List-Archive: http://lists.mysql.com/internals/38066 Message-Id: <4C87800B.2000801@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 [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 >> >> >> >> > >