Cppcheck: uselessAssignmentPtrArg in wrapper.cxx (sdext module)

julien2412 serval2412 at yahoo.fr
Sun May 12 09:20:08 PDT 2013


Hello,

Cppcheck reported this an useless assignment in
sdext/source/pdfimport/wrapper/wrapper.cxx, line 475
    462 int Parser::parseFontCheckForString( const sal_Unicode* pCopy, const
char* s, sal_Int32& nLen,
    463         FontAttributes& aResult, bool bItalic, bool bBold)
    464 {
    465     int l = strlen(s);
    466     if (nLen < l)
    467         return 0;
    468     for (int i = 0; i < l; i++)
    469         if (tolower(pCopy[i]) != s[i]
    470             && toupper(pCopy[i]) != s[i])
    471             return 0;
    472     aResult.isItalic = bItalic;
    473     aResult.isBold = bBold;
    474         nLen -= l;
    475         pCopy += l;
    476     return l;
    477 }

Looking at git history, it's been like this since commit
16fcdbceedcdbf77e07da780581df83f38305dbd (28/04/2010)

Should line 475 simply removed or should something else be done?

Julien



--
View this message in context: http://nabble.documentfoundation.org/Cppcheck-uselessAssignmentPtrArg-in-wrapper-cxx-sdext-module-tp4055514.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list