[Libreoffice] Duplicate expression in vcl/win/source/app/salinst.cxx

julien2412 serval2412 at yahoo.fr
Sat Jan 28 04:59:07 PST 2012


Hello,

Cppchecks reports this :
core/vcl/win/source/app/salinst.cxx
335	duplicateBranch	style	Found duplicate branches for if and else.

Here are the lines :
    330 bool WinSalInstance::CheckYieldMutex()
    331 {
    332     bool bRet = true;
    333     SalData*    pSalData = GetSalData();
    334     DWORD       nCurThreadId = GetCurrentThreadId();
    335     if ( pSalData->mnAppThreadId != nCurThreadId )
    336     {
    337         if ( pSalData->mpFirstInstance )
    338         {
    339             SalYieldMutex* pYieldMutex =
pSalData->mpFirstInstance->mpSalYieldMutex;
    340             if ( pYieldMutex->mnThreadId != nCurThreadId )
    341             {
    342                 bRet = false;
    343             }
    344         }
    345     }
    346     else
    347     {
    348         if ( pSalData->mpFirstInstance )
    349         {
    350             SalYieldMutex* pYieldMutex =
pSalData->mpFirstInstance->mpSalYieldMutex;
    351             if ( pYieldMutex->mnThreadId != nCurThreadId )
    352             {
    353                 bRet = false;
    354             }
    355         }
    356     }
    357     return bRet;
    358 }

Any idea ? (just remove duplicate part ?)

Julien
PS : I can't test on Windows, so if you want me to do something about this,
be very precise :-)

--
View this message in context: http://nabble.documentfoundation.org/Duplicate-expression-in-vcl-win-source-app-salinst-cxx-tp3695749p3695749.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list