[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Use true/false or TRUE/FALSE in KDE C++ programs?
From:       Benjamin Meyer <ben () meyerhome ! net>
Date:       2005-05-30 15:26:02
Message-ID: 200505301126.02798.ben () meyerhome ! net
[Download RAW message or body]

On Sunday 29 May 2005 9:43 am, Nicos Gollan wrote:
> On Sunday May 29 2005 13:27, Richard Dale wrote:
> > I was wondering if there was a more correct boolean literal to use. I
> > noticed that the Qt docs have upper case booleans, but when I searched
> > the sources in kdelibs there were more instances of lower case ones.
>
> The thing with Qt is that it doesn't assume any standard-C++ features like
> namespaces, a working STL implementation or the standard boolean type
> "bool" to be present, so it defines its own of everything (just have a look
> at the comments in the Qt sources for the declaration of the class "Qt" in
> qnamespace.h to get the idea of not using namespaces). By using the
> uppercase variety, it avoids ambiguities on systems which do have a "bool"
> type with true/false values.
>
> The correct literals by the C++ standard are the lowercase true/false
> values, but that might cause problems on systems with Really Old(TM)
> compilers unless you handle that somehow, e.g. with autotools.

I have added a test to the kdetestscripts 
(playground/base/kdetestscripts/true) that will check for TRUE and FALSE in 
code so developers will be aware of them.  It finds lots of them ... hehe.

It will be in tomarrows report: http://kde.icefox.net/tests/report.html

-Benjamin Meyer


-- 
aka icefox
Public Key: http://www.icefox.net/public_key.asc
 
>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic