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


Hello,

Cppcheck reported this:
[source/core/dataaccess/documentdefinition.cxx:211] ->
[source/core/dataaccess/documentdefinition.cxx:212]: (performance,
inconclusive) Variable 'm_bInChangingState' is reassigned a value before the
old one has been used if variable is no semaphore variable
Indeed:
    207     void SAL_CALL OEmbedObjectHolder::changingState( const
lang::EventObject& /*aEvent*/, ::sal_Int32 nOldState, ::sal_Int32 nNewState
) throw (embed::WrongStateException, uno::RuntimeException)
    208     {
    209         if ( !m_bInChangingState && nNewState ==
EmbedStates::RUNNING && nOldState == EmbedStates::ACTIVE && m_pDefinition )
    210         {
    211             m_bInChangingState = true;
    212             m_bInChangingState = false;
    213         }
    214     }

see
http://opengrok.libreoffice.org/xref/core/dbaccess/source/core/dataaccess/documentdefinition.cxx#207
Is there something lacking between both (like
OEmbedObjectHolder::stateChanged function, just some lines below)?
Or should one of them be kept? Or is it a semaphre? (in this case perhaps it
could be useful to tell it in variable declaration)?

Julien



--
View this message in context: 
http://nabble.documentfoundation.org/Cppcheck-reassignment-of-m-bInChangingState-dbaccess-module-tp4061157.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.