Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


On Sun, 2011-01-09 at 16:21 +0100, Julien Nabet wrote:
Hello,

Here is a patch for some cppcheck cleaning in sc
Compiling was ok

Looks good, so pushed. Thanks for this. 

I did decide afterwards to remove two of the methods that cppcheck said
could be "const" seeing as they were actually empty and nothing called
them.

PS : when cppcheck indicates that a boolean is not initialized, what is 
recommended to choose ? true, false or it depends on the context ?

Do you have an example, it *might* be a false positive because it might
be an overloaded operator that cppcheck doesn't know about, e.g.

sal_Bool bFoo;
if (aAny >>= bFoo)
{
   //use foo only if Any::operator>>= filled in bFoo successfully
   //cppcheck might think bFoo is used initialized
}

but in the general case sal_False is probably the right value. i.e. in
the above case I'd do sal_Bool bFoo(sal_False); anyway even if it is a
false positive.

C.


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.