summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx11
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/except.cxx32
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_arm/rtti.hxx33
3 files changed, 21 insertions, 55 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
index aaba8ffb7b6d..103f2b492e3a 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx
@@ -272,8 +272,7 @@ namespace
}
if (pReturnTypeDescr)
{
- typelib_TypeClass eRet =
- static_cast<typelib_TypeClass>(pReturnTypeDescr->eTypeClass);
+ typelib_TypeClass eRet = pReturnTypeDescr->eTypeClass;
TYPELIB_DANGER_RELEASE( pReturnTypeDescr );
return eRet;
}
@@ -381,7 +380,7 @@ namespace
{
typelib_TypeDescription * pTD = nullptr;
TYPELIB_DANGER_GET(&pTD,
- reinterpret_cast<Type *>(pCallStack[2])->getTypeLibType());
+ static_cast<Type *>(pCallStack[2])->getTypeLibType());
if (pTD)
{
XInterface * pInterface = nullptr;
@@ -393,7 +392,7 @@ namespace
if (pInterface)
{
::uno_any_construct(
- reinterpret_cast< uno_Any * >( pCallStack[0] ),
+ static_cast< uno_Any * >( pCallStack[0] ),
&pInterface, pTD, cpp_acquire );
pInterface->release();
TYPELIB_DANGER_RELEASE( pTD );
@@ -576,8 +575,8 @@ void bridges::cpp_uno::shared::VtableFactory::flushCode(
{
#ifndef ANDROID
static void (*clear_cache)(unsigned char const*, unsigned char const*)
- = (void (*)(unsigned char const*, unsigned char const*))
- dlsym(RTLD_DEFAULT, "__clear_cache");
+ = reinterpret_cast<void (*)(unsigned char const*, unsigned char const*)>
+ (dlsym(RTLD_DEFAULT, "__clear_cache"));
(*clear_cache)(beg, end);
#else
cacheflush((long) beg, (long) end, 0);
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
index 367604f3ed11..14bffa75ad7f 100644
--- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
+++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx
@@ -31,7 +31,6 @@
#include <typelib/typedescription.hxx>
#include <uno/any2.h>
#include <unordered_map>
-#include "rtti.hxx"
#include "share.hxx"
@@ -86,6 +85,7 @@ namespace CPPU_CURRENT_NAMESPACE
#endif
}
+namespace {
class RTTI
{
typedef std::unordered_map< OUString, type_info * > t_rtti_map;
@@ -104,10 +104,11 @@ namespace CPPU_CURRENT_NAMESPACE
type_info * getRTTI(typelib_CompoundTypeDescription *);
};
+}
RTTI::RTTI()
#ifndef ANDROID
- : m_hApp( dlopen( 0, RTLD_LAZY ) )
+ : m_hApp( dlopen( nullptr, RTLD_LAZY ) )
#endif
{
}
@@ -124,7 +125,7 @@ namespace CPPU_CURRENT_NAMESPACE
{
type_info * rtti;
- OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName;
+ OUString const & unoName = *reinterpret_cast<OUString const *>(&pTypeDescr->aBase.pTypeName);
MutexGuard guard( m_mutex );
t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) );
@@ -146,7 +147,7 @@ namespace CPPU_CURRENT_NAMESPACE
OString symName( buf.makeStringAndClear() );
#ifndef ANDROID
- rtti = (type_info *)dlsym( m_hApp, symName.getStr() );
+ rtti = static_cast<type_info *>(dlsym( m_hApp, symName.getStr() ));
#else
rtti = (type_info *)dlsym( RTLD_DEFAULT, symName.getStr() );
#endif
@@ -185,10 +186,9 @@ namespace CPPU_CURRENT_NAMESPACE
if (pTypeDescr->pBaseTypeDescription)
{
// ensure availability of base
- type_info * base_rtti = getRTTI(
- (typelib_CompoundTypeDescription *)pTypeDescr->pBaseTypeDescription );
+ type_info * base_rtti = getRTTI( pTypeDescr->pBaseTypeDescription );
rtti = new __si_class_type_info(
- strdup( rttiName ), (__class_type_info *)base_rtti );
+ strdup( rttiName ), static_cast<__class_type_info *>(base_rtti) );
}
else
{
@@ -218,8 +218,8 @@ namespace CPPU_CURRENT_NAMESPACE
static void deleteException( void * pExc )
{
- __cxa_exception const * header = ((__cxa_exception const *)pExc - 1);
- typelib_TypeDescription * pTD = 0;
+ __cxa_exception const * header = static_cast<__cxa_exception const *>(pExc) - 1;
+ typelib_TypeDescription * pTD = nullptr;
OUString unoName( toUNOname( header->exceptionType->name() ) );
::typelib_typedescription_getByName( &pTD, unoName.pData );
assert(pTD && "### unknown exception type! leaving out destruction => leaking!!!");
@@ -244,13 +244,13 @@ namespace CPPU_CURRENT_NAMESPACE
{
// construct cpp exception object
- typelib_TypeDescription * pTypeDescr = 0;
+ typelib_TypeDescription * pTypeDescr = nullptr;
TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType );
assert(pTypeDescr);
if (! pTypeDescr)
{
throw RuntimeException(
- OUString("cannot get typedescription for type ") +
+ "cannot get typedescription for type " +
OUString::unacquired( &pUnoExc->pType->pTypeName ) );
}
@@ -258,16 +258,16 @@ namespace CPPU_CURRENT_NAMESPACE
::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp );
// destruct uno exception
- ::uno_any_destruct( pUnoExc, 0 );
+ ::uno_any_destruct( pUnoExc, nullptr );
// avoiding locked counts
static RTTI rtti_data;
- rtti = (type_info*)rtti_data.getRTTI((typelib_CompoundTypeDescription*)pTypeDescr);
+ rtti = rtti_data.getRTTI(reinterpret_cast<typelib_CompoundTypeDescription*>(pTypeDescr));
TYPELIB_DANGER_RELEASE( pTypeDescr );
assert(rtti && "### no rtti for throwing exception!");
if (! rtti)
{
throw RuntimeException(
- OUString("no rtti for type ") +
+ "no rtti for type " +
OUString::unacquired( &pUnoExc->pType->pTypeName ) );
}
}
@@ -278,7 +278,7 @@ namespace CPPU_CURRENT_NAMESPACE
#ifdef __ARM_EABI__
static void* getAdjustedPtr(__cxa_exception* header)
{
- return (void*)header->unwindHeader.barrier_cache.bitpattern[0];
+ return reinterpret_cast<void*>(header->unwindHeader.barrier_cache.bitpattern[0]);
}
#else
static void* getAdjustedPtr(__cxa_exception* header)
@@ -308,7 +308,7 @@ namespace CPPU_CURRENT_NAMESPACE
fprintf( stderr, "> c++ exception occurred: %s\n", cstr_unoName.getStr() );
#endif
typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData );
- if (0 == pExcTypeDescr)
+ if (nullptr == pExcTypeDescr)
{
RuntimeException aRE( "exception type not found: " + unoName );
Type const & rType = cppu::UnoType<decltype(aRE)>::get();
diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/rtti.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/rtti.hxx
deleted file mode 100644
index 7057cb4ed161..000000000000
--- a/bridges/source/cpp_uno/gcc3_linux_arm/rtti.hxx
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- 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 <typeinfo>
-
-#include <typelib/typedescription.h>
-
-namespace arm
-{
-std::type_info* getRtti(typelib_TypeDescription const& type);
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */