lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


omg DON'T get me started on *that* mess (grin).

Even the !FALSE trick doesn't work:

if (x == TRUE)…
if (x) …

Still give different results, since !FALSE to the compiler is !0 which is 1, so the first if is really "if (x == 1) …" for most compilers.


On Jul 1, 2013, at 4:20 PM, Sean Conner <sean@conman.org> wrote:

 Actually, I've seen plenty of C code improperly define the value for true. 
In C, a value of 0 is considered false, and *anything but 0* is considered
true, so (in my not so humble opinion) the best definition of TRUE and FALSE
would be:

#define FALSE 0
#define TRUE !FALSE