Re: [AD] TRUE and FALSE

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On 2003-04-22, Hein Zelle <hein@xxxxxxxxxx> wrote:
> *hit self on head*
> 
> I knew when I wrote if (x == TRUE) that that was one of the problem
> cases, just forgot why. Anyway, you got my point about writing
> "proper" conditionals. I tend to always write "if (x)" anyway, I
> dislike even things like "if (set_gfx_mode() < 0)".

/me guilty

> Unfortunately with multiple return values that can't always be helped.

If only C had a boolean type to begin with...

> > Oh, and just to say, I'm perfectly happy to see TRUE and FALSE removed 
> > entirely.
...
> Sounds like removing them completely would be the most consistent,
> except it may cause unwanted breakage of backward compatibility. Are
> TRUE and FALSE used in the allegro internals at all?

All over the place.  Besides, they are used by heaps of user code.
I suppose they could be depreciated (i.e. not defined if you define
ALLEGRO_NO_COMPATIBILITY before including allegro.h).

About Allegro 5: We're using C99/C++ bool.  Apparently, that's a whole
other can of worms.

-- 
王浩禎




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/