List:Internals« Previous MessageNext Message »
From:Vladislav Vaintroub Date:September 8 2010 12:42pm
Subject:RE: [STYLE] use true/false in C++, not TRUE/FALSE
View as plain text  

> -----Original Message-----
> From: Mats Kindahl [mailto:mats.kindahl@stripped]
> Sent: Wednesday, September 08, 2010 2:23 PM
> To: internals@stripped
> Subject: Re: [STYLE] use true/false in C++, not TRUE/FALSE

<skip>
> >>
> > naah, I think we want sizeof(my_bool) == 1
> 
> Why?

To save 7/8 of a CPU register (joking  :) )

Actually, I like what Davi proposed, sticking to int in the return code .  -1 for error
and 0 for success was used for several
decades on Unixes, and nobody came to complain about it expanded the error code space. 
I'm also ok with changing conventions to have BOOL type, and functions that return return
TRUE(==1) on success and FALSE(==0) on
error , like that is used by convention on Windows, but I'm afraid I'll be alone here :)
At least that convention is intuitive (TRUE
on success is simple to understand, while FALSE on success is obscurity)


> /Matz
> 
> >
> > -- didrik
> >
> >> Just my few cents,
> >> Mats Kindahl
> >>
> >>
> >>
> >>
> >
> >
> 
> 
> --
> MySQL Internals Mailing List
> For list archives: http://lists.mysql.com/internals
> To unsubscribe:    http://lists.mysql.com/internals?unsub=1


Thread
[STYLE] use true/false in C++, not TRUE/FALSEGuilhem Bichot26 Aug
  • Re: [STYLE] use true/false in C++, not TRUE/FALSERoy Lyseng26 Aug
  • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN26 Aug
    • Re: [STYLE] use true/false in C++, not TRUE/FALSEGuilhem Bichot31 Aug
      • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
        • Re: [STYLE] use true/false in C++, not TRUE/FALSEGuilhem Bichot31 Aug
          • Re: [STYLE] use true/false in C++, not TRUE/FALSEJay Pipes31 Aug
            • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut31 Aug
              • Re: [STYLE] use true/false in C++, not TRUE/FALSEJay Pipes31 Aug
                • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut31 Aug
                  • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
                    • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut31 Aug
                      • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
                        • Re: [STYLE] use true/false in C++, not TRUE/FALSERoy Lyseng31 Aug
                          • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
                            • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep
                              • Re: [STYLE] use true/false in C++, not TRUE/FALSEJay Pipes8 Sep
                          • RE: [STYLE] use true/false in C++, not TRUE/FALSEVladislav Vaintroub31 Aug
                            • Re: [STYLE] use true/false in C++, not TRUE/FALSERoy Lyseng31 Aug
                            • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut31 Aug
                              • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep
                                • Re: [STYLE] use true/false in C++, not TRUE/FALSEDavi Arnaut8 Sep
                                  • RE: [STYLE] use true/false in C++, not TRUE/FALSEVladislav Vaintroub8 Sep
                        • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep
                      • Re: [STYLE] use true/false in C++, not TRUE/FALSEKonstantin Osipov8 Sep
                        • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl8 Sep
                          • Re: [STYLE] use true/false in C++, not TRUE/FALSETor Didriksen8 Sep
                            • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl8 Sep
                              • RE: [STYLE] use true/false in C++, not TRUE/FALSEVladislav Vaintroub8 Sep
                                • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl8 Sep
                              • Re: [STYLE] use true/false in C++, not TRUE/FALSETor Didriksen8 Sep
                                • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl8 Sep
                  • Re: [STYLE] use true/false in C++, not TRUE/FALSEJay Pipes31 Aug
        • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep
      • Re: [STYLE] use true/false in C++, not TRUE/FALSEMARK CALLAGHAN31 Aug
  • Re: [STYLE] use true/false in C++, not TRUE/FALSEMats Kindahl27 Aug
    • Re: [STYLE] use true/false in C++, not TRUE/FALSEMichael Widenius8 Sep