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


On 07/14/2012 01:01 AM, julien2412 wrote:
Cppcheck reported this :
[sal/osl/unx/profile.c:1306] -> [sal/osl/unx/profile.c:1306]: (style) Same
expression on both sides of '|'
    1306         if ( Flags & (osl_Profile_WRITELOCK | osl_Profile_WRITELOCK
) )
    1307         {
    1308             OslProfile_lockFile(pFile, un_lock);
    1309         }

in comparison, there's on sal/osl/w32/profile.cxx this :
    1225     if ( ProfileFlags & (osl_Profile_WRITELOCK |
osl_Profile_READLOCK ) )
    1226     {
    1227 #ifdef DEBUG_OSL_PROFILE
    1228         OSL_TRACE("locking '%s' file",pszFilename);
    1229 #endif
    1230
    1231         lockFile(pFile, bWriteable ? write_lock : read_lock);
    1232     }

Should the if part in profile.c simply replaced by :
   if ( Flags & (osl_Profile_WRITELOCK | osl_Profile_READLOCK ) )
or is it less obvious ?

Looks like it should indeed be changed to WRITELOCK | READLOCK. (Note that that whole profile stuff is deprecated, so the broken code likely makes no difference in practice.)

Stephan

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.