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 !
Before it would be done manually, I recently wrote a tool based on clang libtooling to automate this process. http://cgit.freedesktop.org/libreoffice/contrib/dev-tools/tree/clang has the code and documentation on how to do it, basically in this case (because this class is internal to the sot module) it's a matter of running: make -sr COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=find-unprefixed-members-wrapper RENAME_ARGS="-class-name=StgStrm" to generate a .csv file, then: make -sr COMPILER_EXTERNAL_TOOL=1 CCACHE_PREFIX=rename-wrapper RENAME_ARGS="-csv=$HOME/rename.csv" to generate .new files where the members are prefixed, finally: for i in $(find . -name "*.new"); do mv -f $i ${i%%.new}; done to overwrite the original files with the .new ones. All these commands have to be invoked in the sot/ directory of a build tree where clang is the configured compiler.
melikeyurtoglu committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=30b3676624685e260e2ec1909486b971fac129f7 tdf#94879 add 'm' suffixes to member variables It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Forgot to mark this one as resolved.
Migrating Whiteboard tags to Keywords: (easyHack difficultyBeginner skillCpp topicCleanup ) [NinjaEdit]