svtools/source/graphic/grfmgr2.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
New commits: commit 32c31ceb0da26c260661186b6c86831494902b58 Author: Stephan Bergmann <[email protected]> Date: Wed Jan 10 20:23:51 2018 +0100 Replace macro with function Change-Id: Ie565845ffa9c310a5920fc0689bbe1758bcc194d Reviewed-on: https://gerrit.libreoffice.org/47749 Tested-by: Jenkins <[email protected]> Reviewed-by: Stephan Bergmann <[email protected]> diff --git a/svtools/source/graphic/grfmgr2.cxx b/svtools/source/graphic/grfmgr2.cxx index f6dd8a198e82..268d008ce4f6 100644 --- a/svtools/source/graphic/grfmgr2.cxx +++ b/svtools/source/graphic/grfmgr2.cxx @@ -38,8 +38,14 @@ #define WATERMARK_LUM_OFFSET 50 #define WATERMARK_CON_OFFSET -70 -#define MAP( cVal0, cVal1, nFrac ) ((sal_uInt8)((((long)(cVal0)<<20)+nFrac*((long)(cVal1)-(cVal0)))>>20)) +namespace { + +constexpr sal_uInt8 MAP(long cVal0, long cVal1, long nFrac) { + return (sal_uInt8)(((cVal0<<20)+nFrac*(cVal1-cVal0))>>20); +} + +} GraphicManager::GraphicManager( sal_uLong nCacheSize, sal_uLong nMaxObjCacheSize ) : mnUsedSize(0), _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
