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


Hello,

Cppcheck reported this:
sc/source/core/tool/autoform.cxx
1105    redundantAssignment     style   Variable 'bRet' is reassigned a value before
the old one has been used.

   1102         bRet = (rStream.GetError() == 0);
   1103        
//-----------------------------------------------------------
   1104         rStream << (sal_uInt16)(maData.size() - 1);
   1105         bRet = (rStream.GetError() == 0);
   1106         MapType::iterator it = maData.begin(), itEnd = maData.end();
   1107         for (++it; bRet && it != itEnd; ++it) // Skip the first
item.
   1108             bRet = it->second->Save(rStream, fileVersion);

What should we do with bRet value, after line 1102?

Also, notice the line 1107 "++it" to skip the first item. Shouldn't we add a
wrapper if(it != itEnd) for the "for loop" to be sure?

see
http://opengrok.libreoffice.org/xref/core/sc/source/core/tool/autoform.cxx#1105

Julien 



--
View this message in context: 
http://nabble.documentfoundation.org/Cppcheck-Variable-bRet-is-reassigned-a-value-in-autoform-cxx-tp4030054.html
Sent from the Dev mailing list archive at Nabble.com.

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.