[MPlayer-dev-eng] int vs. bool

Ingo Brückl ib at wupperonline.de
Mon Dec 3 21:53:19 CET 2012


Reimar Döffinger wrote on Sat, 1 Dec 2012 17:16:15 +0100:

> And a GUI_TRUE and GUI_FALSE define would avoid most of the issues,
> a few more if combined with an enum.
> I just have the feeling that it will at best make the code uglier.

These defines certainly would. They are too bulky.

(Just curious: What issues would be avoided with an enum in that case?)

> Otherwise the BOOL type name and TRUE/FALSE from Windows might be usable, I
> think it is simply defined to unsigned normally.

Well, rather than a data type (that couldn't force correct usage of the two
possible values in C anyway, so int would be ok) I'd be in need of nice and
short symbolic constants for 0 and 1.

TRUE/FALSE are defined in GLib, too, and I could use True/False from X11 as
well, but I don't want to make the whole GUI code (especially the future
"common" part) depend on GLib or X11 headers.

I cannot see a problem in defining true/false if checked with #ifdef first,
but I could warm to something like yes/no otherwise.

Ingo


More information about the MPlayer-dev-eng mailing list