https://bugs.documentfoundation.org/show_bug.cgi?id=94879

            Bug ID: 94879
           Summary: add 'm' suffixes to member variables ...
           Product: LibreOffice
           Version: 5.0.2.1 rc
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs@lists.freedesktop.org
          Reporter: michael.me...@collabora.com

The Storage code is currently really hard to read - since its missing 'm'
suffixes on its variables:

sot/source/sdstor.cxx:

bool StgStrm::Pos2Page( sal_Int32 nBytePos )

    if ( !pFat )
        return false;

    // Values < 0 seek to the end
    if( nBytePos < 0 || nBytePos >= nSize )
        nBytePos = nSize;
    // Adjust the position back to offset 0
    nPos -= nOffset;
    sal_Int32 nMask = ~( nPageSize - 1 );
    sal_Int32 nOld = nPos & nMask;
    sal_Int32 nNew = nBytePos & nMask;
    nOffset = (short) ( nBytePos & ~nMask );
...

Pretty quickly the 'nPos' (a member) gets mixed with the 'nNew' (a local) etc.

The usual convention is to use an 'm' prefix; so: 'mpFat' 'mnPos' 'mnOffset'
here to make this much more readable.

It'd be great to have a patch that adds that for members in this module;
perhaps separate patches for similar problems in other sot/ modules would be
good too.

Thanks !

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to