[Libreoffice] if (foo == sal_True)

Michael Meeks michael.meeks at novell.com
Fri Apr 1 08:34:06 PDT 2011


Hi guys,

	I see quite a staggering number of these things around the codebase:

$ g grep '== sal_True' | wc -l
744

	and the (less dangerous IMHO) '== sal_False' construct has ~400 (what
positive people we are ;-)

if( m_pDataContainer->IsModuleInstalled( E_SWRITER ) == sal_True )
if( IsModified() == sal_True )
if( m_bOwner == sal_True )
etc. etc.

	sal_True is -1 - which is great for unsigned bit fields and all that -
but - well, I am certain there are a whole host of creative errors
around where a supposedly boolean value is neither 0 nor -1, and of
course these create serious trouble were we to convert to using plain
'bool' more widely.

	The question is - are others concerned about this, and/or should we
have a (very) easy hack to fix it ?

	Thoughts ?

		Michael.

-- 
 michael.meeks at novell.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list