[Libreoffice] FASTBOOL is dead ...

Michael Meeks michael.meeks at novell.com
Fri Oct 8 06:45:35 PDT 2010


Hi Norbert,

On Wed, 2010-10-06 at 03:03 -0500, Norbert Thiebaud wrote:
> The patches are attached to Bug 30642
> https://bugs.freedesktop.org/show_bug.cgi?id=30642

	Soo - I did some more spot review of the patches, and I liked what I
saw :-) things like this:

-    sal_uInt16 nColor = 0, nColCount = 16;
+    sal_uInt16 nColor = 0;
 
     static ColorData aColAry[] = {
.. 
-    while ( !bFound && nColor < nColCount )
+    while ( nColor < sizeof(aColAry)/sizeof(ColorData) &&
+            aColAry[nColor] != nColData )

	Are great cleanups in passing :-) - though they remind me of the need
for a SAL_N_ELEMENTS macro [ which I just added ], and a new
super-EasyHack to add to the wiki.

	The problem we saw in calc was down to this wonderfully unclear use of
FASTBOOL as a loop counter; this patch fixed it:

        // erst Atomaren-Items und dann die Sets schreiben (wichtig beim Laden)
-        for ( pImp->bInSetItem = FALSE; pImp->bInSetItem <= TRUE && !rStream.GetError(); ++pImp->bInSetItem )
+        for (int ft = 0 ; ft < 2 && !rStream.GetError(); ft++)
         {
+            pImp->bInSetItem = ft != 0;

> All FASTBOOL are converted into bool, except a couple of API that are
> left as int

	I saw you also fixed a few APIs that returned int instead of bool to
use bool instead: nice work.

	Phew - well, the binfilter still builds nicely for me - so I've pushed
it. Down to (mostly) three boolean types :-)

	Great work here,

	ATB,

		Michael.

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



More information about the LibreOffice mailing list