summaryrefslogtreecommitdiff
path: root/include/vcl/checksum.hxx
diff options
context:
space:
mode:
authorDaniel Robertson <danlrobertson89@gmail.com>2015-09-15 14:51:26 -0400
committerMichael Stahl <mstahl@redhat.com>2015-09-16 11:02:30 +0000
commit54045cc813c79e53abe608cc1a8d35ee7177465e (patch)
tree9d19529b3656428cb96e05813c66e6667d963a0e /include/vcl/checksum.hxx
parente4a8ae0bf54476e9a0c9e1f5348c05f3cd838899 (diff)
tdf#94228 vcl: replace BOOST_PP with templates
Replace BOOST_PP macros in Bitmap Checksum to Bitmap Checksum Octet Array with templates. Change-Id: Ia7cbc20c90b4d99d54760580e3db10afac9020f3 Reviewed-on: https://gerrit.libreoffice.org/18597 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'include/vcl/checksum.hxx')
-rw-r--r--include/vcl/checksum.hxx19
1 files changed, 9 insertions, 10 deletions
diff --git a/include/vcl/checksum.hxx b/include/vcl/checksum.hxx
index 7e1076fb3139..21674a8144de 100644
--- a/include/vcl/checksum.hxx
+++ b/include/vcl/checksum.hxx
@@ -26,23 +26,22 @@
#include <tools/solar.h>
#include <vcl/dllapi.h>
-#include <boost/preprocessor/arithmetic/inc.hpp>
-#include <boost/preprocessor/arithmetic/mul.hpp>
-#include <boost/preprocessor/repetition/repeat_from_to.hpp>
-
#define BITMAP_CHECKSUM_SIZE 8
-#define BITMAP_CHECKSUM_BITS BOOST_PP_MUL(BITMAP_CHECKSUM_SIZE, 8)
typedef sal_uInt64 BitmapChecksum;
typedef sal_uInt8 BitmapChecksumOctetArray[BITMAP_CHECKSUM_SIZE];
-#define BITMAP_CHECKSUM_SET_OCTET(z, i, unused) \
-p[i] = (sal_uInt8)(n >> BOOST_PP_MUL(8, i));
-
+template< sal_uInt8 N = 0 >
+inline void BCToBCOA( BitmapChecksum n, BitmapChecksumOctetArray p )
+{
+ p[N] = (sal_uInt8)(n >> ( 8 * N ));
+ return BCToBCOA< N + 1 >( n, p );
+}
-inline void BCToBCOA( BitmapChecksum n , BitmapChecksumOctetArray p )
+template<>
+inline void BCToBCOA< BITMAP_CHECKSUM_SIZE >( BitmapChecksum, BitmapChecksumOctetArray )
{
- BOOST_PP_REPEAT(BITMAP_CHECKSUM_SIZE , BITMAP_CHECKSUM_SET_OCTET, unused)
+ return;
}
#ifdef __cplusplus