maria-developers team mailing list archive
Mailing list archive
Re: TRUE vs true (was: [Commits] ac05f41: postreview fix)
I use TRUE/FALSE for my_bool in C and true/false for bool in C++.
With the only expection of return values where 0 conventionally means
success and non-zero means an error. As Mark Callaghan once commented
/* got an error */
/* finished successfully */
looks pretty weird. I agree that true for an error and false for a
success is kind of counter-intuitive. So in this case I use 1 and 0.
On Apr 23, Sergey Vojtovich wrote:
> According to MySQL coding guidelines:
> * In C code, use TRUE and FALSE rather than 1/0
> * In C++ code, it is OK to use true and false (do not use 1/0). You can use C++
> bool/true/false when calling C functions (values will be safely promoted to
> I'm aware of only one more or less good reason for not using true/false in C++:
> it's easier to convert it to C code. But that's rare: we mostly convert in the
> opposite direction.
> Also C99 now supports true/false, e.g. see nice description: