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


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.

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.