Advice needed about some cppcheck reports

Lubos Lunak l.lunak at suse.cz
Tue May 29 07:04:53 PDT 2012


On Tuesday 29 of May 2012, Michael Stahl wrote:
> On 28/05/12 18:03, julien2412 wrote:
> > Same thing here :
> > [sal/osl/w32/file.cxx:880] -> [sal/osl/w32/file.cxx:880]: (style) Same
> > expression on both sides of '-'.
> >     876         if (nSize > 0)
> >     877         {
> >     878             c ^= pData[0];
> >     879             pData += nSize;
> >     880             nSize -= nSize;
> >     881         }
> >
> > And here :
> > [filter/source/graphicfilter/icgm/cgm.cxx:269] ->
> > [filter/source/graphicfilter/icgm/cgm.cxx:269]: (style) Same expression
> > on both sides of '-'.
> >     267             if ( pLong[ nSwitch ] < 0 )
> >     268             {
> >     269                 nRetValue -= nRetValue;
> >     270             }
> >     271             nRetValue /= 65536;
>
> also makes sense

 This is not the same, it looks more to me like it should be 'nRetValue 
= -nRetValue;' to negate the value, especially given the abs() above.

-- 
 Lubos Lunak
 l.lunak at suse.cz


More information about the LibreOffice mailing list