[Libreoffice] WaE patch for sc & filter

Kohei Yoshida kyoshida at novell.com
Tue Jan 18 12:52:16 PST 2011


On Tue, 2011-01-18 at 17:16 +0100, Christian Lohmaier wrote:
> Hi *,
> 
> some --enable-werror fixed needed to make the build compile on mac. As
> there area multiple ways to solve those "may not be initialized" and
> "comparing signed with unsigned" ones, I submit it here for comments
> (esp. the first one in the lotuswordpro one - casting tag to unsigned
> (as the only one where it could be negative (VO_INVALID) has been
> checked already, but still people might prefer to handle it
> differently)

Hello Christian,

Indeed there are several ways to solve this.  Since the original author
of this module has moved onto another project, I took the liberty to
make changes and commit the following:

http://cgit.freedesktop.org/libreoffice/filters/commit/?id=54c30e7f301c0879d48d60322be962d53840d264

for the lotuswordpro module.

For the first hunk, I've opted to cast the type of 'tag to sal_uInt32
since that's the type that gets returned by pObj->GetTag() on the right
hand side.  Plus I opted to use static_cast instead of C-style cast.

I had to think about what best to do in the second hunk in
GetChildStorageName(), but in the end opted to remove the whole method
since that method appeared to be unused.

In the 3rd hunk, it's probably more appropriate to initialize cLeader
with a numeric 0 as opposed to NULL, since sal_Unicode is not a pointer
type.  I used the hex zero (0x00) just to make it consistent with the
other values assigned to this variable.

In the 4th hunk, which is in writerperfect module, I simply replaced
with C-style cast with static_cast.  I'm putting Fridrich in CC to let
him know of this change since this is his area.

As for your other patch in sc, I applied as-is.  Normally for sal_Bool
type there is also sal_True and sal_False, and it's probably more
appropriate to use those values instead of the standard true and false,
but this variable will never be used uninitialized anyway, so it doesn't
matter all that much.  Still, if other compilers complain about
dangerous casting (MSVC may be picky on these types of implicit
conversions) I might later change that to sal_False.

All pushed to master.  Thanks a lot!

Kohei

-- 
Kohei Yoshida, LibreOffice hacker, Calc
<kyoshida at novell.com>



More information about the LibreOffice mailing list