[Libreoffice] if (foo == sal_True)

Michael Meeks michael.meeks at novell.com
Fri Apr 1 13:00:28 PDT 2011


On Fri, 2011-04-01 at 18:27 +0200, Lubos Lunak wrote:
> > 	sal_True is -1
> 
>  What makes you think so (besides possibly today's date, but then the rest of 
> your mail looks ok) ?

	;-) you know, I have no idea - someone told me that the other day & I
foolishly believed it (I guess).

> > 	- which is great for unsigned bit fields and all that - 
> 
>  Not really important, but you lost me there.

	struct A { int b : 1; }

	b can be zero or minus one; the one bit is the sign ;-)

>  Actually, converting to bool would have probably avoided any such possible 
> trouble, as converting to bool converts any non-zero to true (which has the 
> value of 1 with gcc, although I'm not quite sure the spec mandates this).

	So the risk is fairly small then; nevertheless it seems more or less
retarded to allow other states lurking around in our booleans :-)

	Thanks,

		Michael.

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




More information about the LibreOffice mailing list