summaryrefslogtreecommitdiffstats
path: root/bridges
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-01-02 14:36:44 +0100
committerJulien Nabet <serval2412@yahoo.fr>2021-01-02 14:47:03 +0100
commitdd91d3389c26645459d3b80649941d65efa4f63f (patch)
treeb2c1527da6aa409fd77d7bf7b24aabc379af8165 /bridges
parentdrop deprecated GtkAlignment, move left/top-padding into child margin-start/top (diff)
downloadcore-dd91d3389c26645459d3b80649941d65efa4f63f.tar.gz
core-dd91d3389c26645459d3b80649941d65efa4f63f.zip
Fix some warnings for Raspberry pi 4 (part3)
fix for these kinds of things: /home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:494:17: error: C-style cast from 'sal_uInt32 *' (aka 'unsigned long *') to 'double *' (BitCast) [loplugin:cstylecast] INSERT_DOUBLE( pCppArgs[nPos], nGPR, pGPR, pStack, pStackStart ); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:365:14: note: expanded from macro 'INSERT_DOUBLE' *(double *)pDS = *reinterpret_cast<double *>( pSV );\ ^~~~~~~~~~~~~ /home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:645:18: error: C-style cast from 'const typelib_TypeDescription *' (aka 'const _typelib_TypeDescription *') to 'typelib_InterfaceAttributeTypeDescription *' (aka '_typelib_InterfaceAttributeTypeDescription *') (BitCast) [loplugin:cstylecast] ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ /home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:655:31: error: use 'true' instead of 'sal_True' [loplugin:fakebool] aParam.bIn = sal_True; ^~~~~~~~ /home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:656:31: error: use 'false' instead of 'sal_False' [loplugin:fakebool] aParam.bOut = sal_False; /home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:112:47: error: NullToPointer ValueDependentIsNotNull ZeroLiteral -> nullptr [loplugin:nullptr] typelib_TypeDescription * t = 0; ^ /home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:123:40: error: NullToPointer ValueDependentIsNotNull ZeroLiteral -> nullptr [loplugin:nullptr] if (p->pBaseTypeDescription != 0) ^ /home/pi/lo/libreoffice/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx:148:52: error: NullToPointer ValueDependentIsNotNull ZeroLiteral -> nullptr [loplugin:nullptr] typelib_TypeDescription * pTypeDescr = 0; ^ Change-Id: Ibca65077131277380ddeefa994b52c7c1193c1f4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108570 Tested-by: Julien Nabet <serval2412@yahoo.fr> Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/call.hxx28
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx95
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx82
3 files changed, 117 insertions, 88 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/call.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/call.hxx
new file mode 100644
index 000000000000..dde56f6f59f0
--- /dev/null
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/call.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#pragma once
+
+#include <sal/config.h>
+
+#include <sal/types.h>
+
+extern "C" sal_Int64 cpp_vtable_call(long* pFunctionAndOffset, void** pCallStack);
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
index 7abaed395488..aaba8ffb7b6d 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
@@ -33,6 +33,7 @@
#include <vtablefactory.hxx>
#include "share.hxx"
+#include "call.hxx"
#include <dlfcn.h>
@@ -46,7 +47,7 @@ using namespace ::com::sun::star::uno;
namespace
{
- static typelib_TypeClass cpp2uno_call(
+ typelib_TypeClass cpp2uno_call(
bridges::cpp_uno::shared::CppInterfaceProxy* pThis,
const typelib_TypeDescription * pMemberTypeDescr,
typelib_TypeDescriptionReference * pReturnTypeRef,
@@ -55,21 +56,21 @@ namespace
sal_Int64 * pRegisterReturn /* space for register return */ )
{
// pCallStack: ret, [return ptr], this, params
- char * pTopStack = (char *)(pCallStack + 0);
+ char * pTopStack = reinterpret_cast<char *>(pCallStack + 0);
char * pCppStack = pTopStack;
#ifdef __ARM_PCS_VFP
int dc = 0;
- char * pFloatArgs = (char *)(pCppStack - 64);
+ char * pFloatArgs = reinterpret_cast<char *>(pCppStack - 64);
#endif
// return
- typelib_TypeDescription * pReturnTypeDescr = 0;
+ typelib_TypeDescription * pReturnTypeDescr = nullptr;
if (pReturnTypeRef)
TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
- void * pUnoReturn = 0;
+ void * pUnoReturn = nullptr;
// complex return ptr: if != 0 && != pUnoReturn, reconversion need
- void * pCppReturn = 0;
+ void * pCppReturn = nullptr;
if (pReturnTypeDescr)
{
@@ -77,7 +78,7 @@ namespace
pUnoReturn = pRegisterReturn; // direct way for simple types
else // complex return via ptr (pCppReturn)
{
- pCppReturn = *(void **)pCppStack;
+ pCppReturn = *reinterpret_cast<void **>(pCppStack);
pCppStack += sizeof(void *);
pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType(
@@ -93,21 +94,21 @@ namespace
static_assert(sizeof(void *) == sizeof(sal_Int32),
"### unexpected size!");
// parameters
- void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams );
+ void ** pUnoArgs = static_cast<void **>(alloca( 4 * sizeof(void *) * nParams ));
void ** pCppArgs = pUnoArgs + nParams;
// indices of values this have to be converted (interface conversion
// cpp<=>uno)
- sal_Int32 * pTempIndices = (sal_Int32 *)(pUnoArgs + (2 * nParams));
+ sal_Int32 * pTempIndices = reinterpret_cast<sal_Int32 *>(pUnoArgs + (2 * nParams));
// type descriptions for reconversions
typelib_TypeDescription ** ppTempParamTypeDescr =
- (typelib_TypeDescription **)(pUnoArgs + (3 * nParams));
+ reinterpret_cast<typelib_TypeDescription **>(pUnoArgs + (3 * nParams));
sal_Int32 nTempIndices = 0;
for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
{
const typelib_MethodParameter & rParam = pParams[nPos];
- typelib_TypeDescription * pParamTypeDescr = 0;
+ typelib_TypeDescription * pParamTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
if (!rParam.bOut &&
@@ -166,7 +167,7 @@ namespace
}
else // ptr to complex value | ref
{
- pCppArgs[nPos] = *(void **)pCppStack;
+ pCppArgs[nPos] = *reinterpret_cast<void **>(pCppStack);
if (! rParam.bIn) // is pure out
{
@@ -182,7 +183,7 @@ namespace
{
uno_copyAndConvertData( pUnoArgs[nPos] =
alloca( pParamTypeDescr->nSize ),
- *(void **)pCppStack, pParamTypeDescr,
+ *reinterpret_cast<void **>(pCppStack), pParamTypeDescr,
pThis->getBridge()->getCpp2Uno() );
pTempIndices[nTempIndices] = nPos; // has to be reconverted
// will be released at reconversion
@@ -190,7 +191,7 @@ namespace
}
else // direct way
{
- pUnoArgs[nPos] = *(void **)pCppStack;
+ pUnoArgs[nPos] = *reinterpret_cast<void **>(pCppStack);
// no longer needed
TYPELIB_DANGER_RELEASE( pParamTypeDescr );
}
@@ -223,7 +224,7 @@ namespace
if (pParams[nIndex].bIn) // is in/inout => was constructed
uno_destructData( pUnoArgs[nIndex],
- ppTempParamTypeDescr[nTempIndices], 0 );
+ ppTempParamTypeDescr[nTempIndices], nullptr );
TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] );
}
if (pReturnTypeDescr)
@@ -252,7 +253,7 @@ namespace
pParamTypeDescr, pThis->getBridge()->getUno2Cpp() );
}
// destroy temp uno param
- uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 );
+ uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, nullptr );
TYPELIB_DANGER_RELEASE( pParamTypeDescr );
}
@@ -264,15 +265,15 @@ namespace
uno_copyAndConvertData( pCppReturn, pUnoReturn,
pReturnTypeDescr, pThis->getBridge()->getUno2Cpp() );
// destroy temp uno return
- uno_destructData( pUnoReturn, pReturnTypeDescr, 0 );
+ uno_destructData( pUnoReturn, pReturnTypeDescr, nullptr );
}
// complex return ptr is set to eax
- *(void **)pRegisterReturn = pCppReturn;
+ *reinterpret_cast<void **>(pRegisterReturn) = pCppReturn;
}
if (pReturnTypeDescr)
{
typelib_TypeClass eRet =
- (typelib_TypeClass)pReturnTypeDescr->eTypeClass;
+ static_cast<typelib_TypeClass>(pReturnTypeDescr->eTypeClass);
TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
return eRet;
}
@@ -282,7 +283,7 @@ namespace
}
- static typelib_TypeClass cpp_mediate(
+ typelib_TypeClass cpp_mediate(
sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset,
void ** pCallStack,
sal_Int64 * pRegisterReturn /* space for register return */ )
@@ -320,7 +321,7 @@ namespace
("illegal " + OUString::unacquired(&pTypeDescr->aBase.pTypeName)
+ " vtable index " + OUString::number(nFunctionIndex) + "/"
+ OUString::number(pTypeDescr->nMapFunctionIndexToMemberIndex)),
- (XInterface *)pCppI);
+ reinterpret_cast<XInterface *>(pCppI));
}
// determine called method
@@ -342,8 +343,8 @@ namespace
// is GET method
eRet = cpp2uno_call(
pCppI, aMemberDescr.get(),
- ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef,
- 0, 0, // no params
+ reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>(aMemberDescr.get())->pAttributeTypeRef,
+ 0, nullptr, // no params
pCallStack, pRegisterReturn );
}
else
@@ -351,13 +352,13 @@ namespace
// is SET method
typelib_MethodParameter aParam;
aParam.pTypeRef =
- ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef;
- aParam.bIn = sal_True;
- aParam.bOut = sal_False;
+ reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>(aMemberDescr.get())->pAttributeTypeRef;
+ aParam.bIn = true;
+ aParam.bOut = false;
eRet = cpp2uno_call(
pCppI, aMemberDescr.get(),
- 0, // indicates void return
+ nullptr, // indicates void return
1, &aParam,
pCallStack, pRegisterReturn );
}
@@ -378,16 +379,16 @@ namespace
break;
case 0: // queryInterface() opt
{
- typelib_TypeDescription * pTD = 0;
+ typelib_TypeDescription * pTD = nullptr;
TYPELIB_DANGER_GET(&pTD,
reinterpret_cast<Type *>(pCallStack[2])->getTypeLibType());
if (pTD)
{
- XInterface * pInterface = 0;
+ XInterface * pInterface = nullptr;
(*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)(
pCppI->getBridge()->getCppEnv(),
- (void **)&pInterface, pCppI->getOid().pData,
- (typelib_InterfaceTypeDescription *)pTD );
+ reinterpret_cast<void **>(&pInterface), pCppI->getOid().pData,
+ reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD) );
if (pInterface)
{
@@ -396,7 +397,7 @@ namespace
&pInterface, pTD, cpp_acquire );
pInterface->release();
TYPELIB_DANGER_RELEASE( pTD );
- *(void **)pRegisterReturn = pCallStack[0];
+ *reinterpret_cast<void **>(pRegisterReturn) = pCallStack[0];
eRet = typelib_TypeClass_ANY;
break;
}
@@ -406,16 +407,16 @@ namespace
default:
eRet = cpp2uno_call(
pCppI, aMemberDescr.get(),
- ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pReturnTypeRef,
- ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->nParams,
- ((typelib_InterfaceMethodTypeDescription *)aMemberDescr.get())->pParams,
+ reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(aMemberDescr.get())->pReturnTypeRef,
+ reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(aMemberDescr.get())->nParams,
+ reinterpret_cast<typelib_InterfaceMethodTypeDescription *>(aMemberDescr.get())->pParams,
pCallStack, pRegisterReturn );
}
break;
}
default:
{
- throw RuntimeException( "no member description found!", (XInterface *)pCppI );
+ throw RuntimeException( "no member description found!", reinterpret_cast<XInterface *>(pCppI) );
}
}
@@ -428,7 +429,7 @@ namespace
* (called by asm snippets)
*/
-extern "C" sal_Int64 cpp_vtable_call( long *pFunctionAndOffset,
+sal_Int64 cpp_vtable_call( long *pFunctionAndOffset,
void **pCallStack )
{
sal_Int64 nRegReturn;
@@ -439,17 +440,17 @@ extern "C" sal_Int64 cpp_vtable_call( long *pFunctionAndOffset,
{
case typelib_TypeClass_BOOLEAN:
case typelib_TypeClass_BYTE:
- nRegReturn = (unsigned long)(*(unsigned char *)&nRegReturn);
+ nRegReturn = static_cast<unsigned long>(*reinterpret_cast<unsigned char *>(&nRegReturn));
break;
case typelib_TypeClass_CHAR:
case typelib_TypeClass_UNSIGNED_SHORT:
case typelib_TypeClass_SHORT:
- nRegReturn = (unsigned long)(*(unsigned short *)&nRegReturn);
+ nRegReturn = static_cast<unsigned long>(*reinterpret_cast<unsigned short *>(&nRegReturn));
break;
case typelib_TypeClass_ENUM:
case typelib_TypeClass_UNSIGNED_LONG:
case typelib_TypeClass_LONG:
- nRegReturn = (unsigned long)(*(unsigned int *)&nRegReturn);
+ nRegReturn = static_cast<unsigned long>(*reinterpret_cast<unsigned int *>(&nRegReturn));
break;
case typelib_TypeClass_VOID:
default:
@@ -469,16 +470,16 @@ namespace
if (bHasHiddenParam)
functionIndex |= 0x80000000;
- unsigned long * p = (unsigned long *)code;
+ unsigned long * p = reinterpret_cast<unsigned long *>(code);
// ARM (not thumb) mode instructions
// mov ip, pc
*p++ = 0xE1A0C00F;
// ldr pc, [pc, #4]
*p++ = 0xE59FF004;
- *p++ = (unsigned long)functionIndex;
- *p++ = (unsigned long)vtableOffset;
- *p++ = (unsigned long)privateSnippetExecutor;
+ *p++ = static_cast<unsigned long>(functionIndex);
+ *p++ = static_cast<unsigned long>(vtableOffset);
+ *p++ = reinterpret_cast<unsigned long>(privateSnippetExecutor);
return code + codeSnippetSize;
}
@@ -504,8 +505,8 @@ bridges::cpp_uno::shared::VtableFactory::initializeBlock(
typelib_InterfaceTypeDescription *)
{
Slot * slots = mapBlockToVtable(block);
- slots[-2].fn = 0;
- slots[-1].fn = 0;
+ slots[-2].fn = nullptr;
+ slots[-1].fn = nullptr;
return slots + slotCount;
}
@@ -524,7 +525,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
Slot * s = *slots;
for (sal_Int32 i = 0; i < type->nMembers; ++i)
{
- typelib_TypeDescription * member = 0;
+ typelib_TypeDescription * member = nullptr;
TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
assert(member != 0);
switch (member->eTypeClass)
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
index bed9d7a0af96..8533415ed087 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx
@@ -109,7 +109,7 @@ namespace arm
if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT ||
p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION)
{
- typelib_TypeDescription * t = 0;
+ typelib_TypeDescription * t = nullptr;
TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]);
bool b = is_complex_struct(t);
TYPELIB_DANGER_RELEASE(t);
@@ -120,7 +120,7 @@ namespace arm
else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass))
return true;
}
- if (p->pBaseTypeDescription != 0)
+ if (p->pBaseTypeDescription != nullptr)
return is_complex_struct(&p->pBaseTypeDescription->aBase);
return false;
}
@@ -145,7 +145,7 @@ namespace arm
return false;
else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION)
{
- typelib_TypeDescription * pTypeDescr = 0;
+ typelib_TypeDescription * pTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
//A Composite Type not larger than 4 bytes is returned in r0
@@ -298,9 +298,9 @@ void callVirtualMethod(
#define INSERT_INT32( pSV, nr, pGPR, pDS ) \
if ( nr < arm::MAX_GPR_REGS ) \
- pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
+ pGPR[nr++] = reinterpret_cast<sal_uInt32>( pSV ); \
else \
- *pDS++ = *reinterpret_cast<sal_uInt32 *>( pSV );
+ *pDS++ = reinterpret_cast<sal_uInt32>( pSV );
#ifdef __ARM_EABI__
#define INSERT_INT64( pSV, nr, pGPR, pDS, pStart ) \
@@ -310,8 +310,8 @@ void callVirtualMethod(
} \
if ( nr < arm::MAX_GPR_REGS ) \
{ \
- pGPR[nr++] = *reinterpret_cast<sal_uInt32 *>( pSV ); \
- pGPR[nr++] = *(reinterpret_cast<sal_uInt32 *>( pSV ) + 1); \
+ *reinterpret_cast<sal_uInt32 *>(pGPR[nr++]) = *static_cast<sal_uInt32 *>( pSV ); \
+ *reinterpret_cast<sal_uInt32 *>(pGPR[nr++]) = *(static_cast<sal_uInt32 *>( pSV ) + 1); \
} \
else \
{ \
@@ -319,8 +319,8 @@ void callVirtualMethod(
{ \
++pDS; \
} \
- *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[0]; \
- *pDS++ = reinterpret_cast<sal_uInt32 *>( pSV )[1]; \
+ *reinterpret_cast<sal_uInt32 *>(*pDS++) = static_cast<sal_uInt32 *>( pSV )[0]; \
+ *reinterpret_cast<sal_uInt32 *>(*pDS++) = static_cast<sal_uInt32 *>( pSV )[1]; \
}
#else
#define INSERT_INT64( pSV, nr, pGPR, pDS, pStart ) \
@@ -343,18 +343,18 @@ void callVirtualMethod(
nSR = 2*nDR; \
}\
if ( nSR < arm::MAX_FPR_REGS*2 ) {\
- pSPR[nSR++] = *reinterpret_cast<float *>( pSV ); \
+ pSPR[nSR++] = *static_cast<float const *>( pSV ); \
if ((nSR % 2 == 1) && (nSR > 2*nDR)) {\
nDR++; \
}\
}\
else \
{\
- *pDS++ = *reinterpret_cast<float *>( pSV );\
+ *pDS++ = *static_cast<float const *>( pSV );\
}
#define INSERT_DOUBLE( pSV, nr, pGPR, pDS, pStart ) \
if ( nDR < arm::MAX_FPR_REGS ) { \
- pFPR[nDR++] = *reinterpret_cast<double *>( pSV ); \
+ pFPR[nDR++] = *static_cast<double const *>( pSV ); \
}\
else\
{\
@@ -362,7 +362,7 @@ void callVirtualMethod(
{ \
++pDS; \
} \
- *(double *)pDS = *reinterpret_cast<double *>( pSV );\
+ *reinterpret_cast<double *>(pDS) = *static_cast<double const *>( pSV );\
pDS += 2;\
}
#else
@@ -375,15 +375,15 @@ void callVirtualMethod(
#define INSERT_INT16( pSV, nr, pGPR, pDS ) \
if ( nr < arm::MAX_GPR_REGS ) \
- pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \
+ pGPR[nr++] = *static_cast<sal_uInt16 const *>( pSV ); \
else \
- *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV );
+ *pDS++ = *static_cast<sal_uInt16 const *>( pSV );
#define INSERT_INT8( pSV, nr, pGPR, pDS ) \
if ( nr < arm::MAX_GPR_REGS ) \
- pGPR[nr++] = *reinterpret_cast<sal_uInt8 *>( pSV ); \
+ pGPR[nr++] = *static_cast<sal_uInt8 const *>( pSV ); \
else \
- *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV );
+ *pDS++ = *static_cast<sal_uInt8 const *>( pSV );
namespace {
@@ -411,11 +411,11 @@ void cpp_call(
#endif
// return
- typelib_TypeDescription * pReturnTypeDescr = 0;
+ typelib_TypeDescription * pReturnTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef );
assert(pReturnTypeDescr);
- void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion
+ void * pCppReturn = nullptr; // if != 0 && != pUnoReturn, needs reconversion
if (pReturnTypeDescr)
{
@@ -452,7 +452,7 @@ void cpp_call(
for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos )
{
const typelib_MethodParameter & rParam = pParams[nPos];
- typelib_TypeDescription * pParamTypeDescr = 0;
+ typelib_TypeDescription * pParamTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef );
if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ))
@@ -553,7 +553,7 @@ void cpp_call(
}
// NO exception occurred...
- *ppUnoExc = 0;
+ *ppUnoExc = nullptr;
// reconvert temporary params
for ( ; nTempIndices--; )
@@ -565,7 +565,7 @@ void cpp_call(
{
if (pParams[nIndex].bOut) // inout
{
- uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value
+ uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, nullptr ); // destroy uno value
uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr,
pThis->getBridge()->getCpp2Uno() );
}
@@ -642,8 +642,8 @@ void unoInterfaceProxyDispatch(
// dependent dispatch
cpp_call(
pThis, aVtableSlot,
- ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef,
- 0, 0, // no params
+ reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *>(pMemberDescr)->pAttributeTypeRef,
+ 0, nullptr, // no params
pReturn, pArgs, ppException );
}
else
@@ -651,11 +651,11 @@ void unoInterfaceProxyDispatch(
// is SET
typelib_MethodParameter aParam;
aParam.pTypeRef =
- ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef;
- aParam.bIn = sal_True;
- aParam.bOut = sal_False;
+ reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *>(pMemberDescr)->pAttributeTypeRef;
+ aParam.bIn = true;
+ aParam.bOut = false;
- typelib_TypeDescriptionReference * pReturnTypeRef = 0;
+ typelib_TypeDescriptionReference * pReturnTypeRef = nullptr;
OUString aVoidName("void");
typelib_typedescriptionreference_new(
&pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData );
@@ -691,31 +691,31 @@ void unoInterfaceProxyDispatch(
// standard calls
case 1: // acquire uno interface
(*pUnoI->acquire)( pUnoI );
- *ppException = 0;
+ *ppException = nullptr;
break;
case 2: // release uno interface
(*pUnoI->release)( pUnoI );
- *ppException = 0;
+ *ppException = nullptr;
break;
case 0: // queryInterface() opt
{
- typelib_TypeDescription * pTD = 0;
- TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() );
+ typelib_TypeDescription * pTD = nullptr;
+ TYPELIB_DANGER_GET( &pTD, static_cast< Type * >( pArgs[0] )->getTypeLibType() );
if (pTD)
{
- uno_Interface * pInterface = 0;
+ uno_Interface * pInterface = nullptr;
(*pThis->getBridge()->getUnoEnv()->getRegisteredInterface)(
pThis->getBridge()->getUnoEnv(),
- (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD );
+ reinterpret_cast<void **>(&pInterface), pThis->oid.pData, reinterpret_cast<typelib_InterfaceTypeDescription *>(pTD) );
if (pInterface)
{
::uno_any_construct(
- reinterpret_cast< uno_Any * >( pReturn ),
- &pInterface, pTD, 0 );
+ static_cast< uno_Any * >( pReturn ),
+ &pInterface, pTD, nullptr );
(*pInterface->release)( pInterface );
TYPELIB_DANGER_RELEASE( pTD );
- *ppException = 0;
+ *ppException = nullptr;
break;
}
TYPELIB_DANGER_RELEASE( pTD );
@@ -725,9 +725,9 @@ void unoInterfaceProxyDispatch(
// dependent dispatch
cpp_call(
pThis, aVtableSlot,
- ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef,
- ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams,
- ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams,
+ reinterpret_cast<typelib_InterfaceMethodTypeDescription const *>(pMemberDescr)->pReturnTypeRef,
+ reinterpret_cast<typelib_InterfaceMethodTypeDescription const *>(pMemberDescr)->nParams,
+ reinterpret_cast<typelib_InterfaceMethodTypeDescription const *>(pMemberDescr)->pParams,
pReturn, pArgs, ppException );
}
break;
@@ -740,7 +740,7 @@ void unoInterfaceProxyDispatch(
Type const & rExcType = cppu::UnoType<decltype(aExc)>::get();
// binary identical null reference
- ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 );
+ ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), nullptr );
}
}
}