diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-05 12:24:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-11-06 07:46:11 +0100 |
commit | 97ebc98f0e956712d242e13f15531742f844a738 (patch) | |
tree | f8f59969604c4cac28a3efba17c4c281752fa62f /tools/source | |
parent | 4b363760b9f196e139ee367d54252c4d6cbe25f3 (diff) |
convert some macros to local functions
Change-Id: If2c89f0f53615f6200b6cd1fb6267cc9b47df927
Reviewed-on: https://gerrit.libreoffice.org/62884
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools/source')
-rw-r--r-- | tools/source/stream/stream.cxx | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index e7d21d950e39..818726b2a619 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -34,11 +34,13 @@ #include <comphelper/fileformat.h> -#define SWAPNIBBLES(c) \ -unsigned char nSwapTmp=c; \ -nSwapTmp <<= 4; \ -c >>= 4; \ -c |= nSwapTmp; +static void swapNibbles(unsigned char &c) +{ + unsigned char nSwapTmp=c; + nSwapTmp <<= 4; + c >>= 4; + c |= nSwapTmp; +} #include <tools/debug.hxx> #include <tools/stream.hxx> @@ -1488,7 +1490,7 @@ std::size_t SvStream::CryptAndWriteBuffer( const void* pStart, std::size_t nLen) { unsigned char aCh = rn; aCh ^= nMask; - SWAPNIBBLES(aCh) + swapNibbles(aCh); rn = aCh; } // ************************* @@ -1507,7 +1509,7 @@ void SvStream::EncryptBuffer(void* pStart, std::size_t nLen) const for ( std::size_t n=0; n < nLen; n++, pTemp++ ) { unsigned char aCh = *pTemp; - SWAPNIBBLES(aCh) + swapNibbles(aCh); aCh ^= nMask; *pTemp = aCh; } |