From 72927f810ac2e6343a2fe78c39c286104ef80d9e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 30 Mar 2015 16:47:25 +0200 Subject: Turn macros into functions Change-Id: I390fc815c32fa0eeeabf4d80a17bc4deedad2d2c --- .../source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx | 76 +++++++++++++--------- 1 file changed, 45 insertions(+), 31 deletions(-) (limited to 'bridges/source') diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx index 205d776f3809..d5cf312a754d 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx @@ -40,7 +40,9 @@ using namespace ::com::sun::star::uno; -// Macros for easier insertion of values to registers or stack +namespace { + +// Functions for easier insertion of values to registers or stack // pSV - pointer to the source // nr - order of the value [will be increased if stored to register] // pFPR, pGPR - pointer to the registers @@ -48,38 +50,50 @@ using namespace ::com::sun::star::uno; // The value in %xmm register is already prepared to be retrieved as a float, // thus we treat float and double the same -#define INSERT_FLOAT_DOUBLE( pSV, nr, pFPR, pDS ) \ - if ( nr < x86_64::MAX_SSE_REGS ) \ - pFPR[nr++] = *reinterpret_cast( pSV ); \ - else \ - *pDS++ = *reinterpret_cast( pSV ); // verbatim! - -#define INSERT_INT64( pSV, nr, pGPR, pDS ) \ - if ( nr < x86_64::MAX_GPR_REGS ) \ - pGPR[nr++] = *reinterpret_cast( pSV ); \ - else \ - *pDS++ = *reinterpret_cast( pSV ); - -#define INSERT_INT32( pSV, nr, pGPR, pDS ) \ - if ( nr < x86_64::MAX_GPR_REGS ) \ - pGPR[nr++] = *reinterpret_cast( pSV ); \ - else \ - *pDS++ = *reinterpret_cast( pSV ); - -#define INSERT_INT16( pSV, nr, pGPR, pDS ) \ - if ( nr < x86_64::MAX_GPR_REGS ) \ - pGPR[nr++] = *reinterpret_cast( pSV ); \ - else \ - *pDS++ = *reinterpret_cast( pSV ); - -#define INSERT_INT8( pSV, nr, pGPR, pDS ) \ - if ( nr < x86_64::MAX_GPR_REGS ) \ - pGPR[nr++] = *reinterpret_cast( pSV ); \ - else \ - *pDS++ = *reinterpret_cast( pSV ); +void INSERT_FLOAT_DOUBLE( + void const * pSV, sal_uInt32 & nr, double * pFPR, sal_uInt64 *& pDS) +{ + if ( nr < x86_64::MAX_SSE_REGS ) + pFPR[nr++] = *static_cast( pSV ); + else + *pDS++ = *static_cast( pSV ); // verbatim! +} +void INSERT_INT64( + void const * pSV, sal_uInt32 & nr, sal_uInt64 * pGPR, sal_uInt64 *& pDS) +{ + if ( nr < x86_64::MAX_GPR_REGS ) + pGPR[nr++] = *static_cast( pSV ); + else + *pDS++ = *static_cast( pSV ); +} -namespace { +void INSERT_INT32( + void const * pSV, sal_uInt32 & nr, sal_uInt64 * pGPR, sal_uInt64 *& pDS) +{ + if ( nr < x86_64::MAX_GPR_REGS ) + pGPR[nr++] = *static_cast( pSV ); + else + *pDS++ = *static_cast( pSV ); +} + +void INSERT_INT16( + void const * pSV, sal_uInt32 & nr, sal_uInt64 * pGPR, sal_uInt64 *& pDS) +{ + if ( nr < x86_64::MAX_GPR_REGS ) + pGPR[nr++] = *static_cast( pSV ); + else + *pDS++ = *static_cast( pSV ); +} + +void INSERT_INT8( + void const * pSV, sal_uInt32 & nr, sal_uInt64 * pGPR, sal_uInt64 *& pDS) +{ + if ( nr < x86_64::MAX_GPR_REGS ) + pGPR[nr++] = *static_cast( pSV ); + else + *pDS++ = *static_cast( pSV ); +} void appendCString(OUStringBuffer & buffer, char const * text) { if (text != 0) { -- cgit