diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2018-10-09 10:28:48 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2018-10-09 14:47:17 +0200 |
commit | 7ceee0f1ec0e349d0df4980d7fdedbd13c7917c5 (patch) | |
tree | 616ab419fe0f01e94740de7faacb393775420589 /cppuhelper | |
parent | 664db0d945fbb23e115eeea8377e3a4e88541da1 (diff) |
Extend loplugin:redundantinline to catch inline functions w/o external linkage
...where "inline" (in its meaning of "this function can be defined in multiple
translation units") thus doesn't make much sense. (As discussed in
compilerplugins/clang/redundantinline.cxx, exempt such "static inline" functions
in include files for now.)
All the rewriting has been done automatically by the plugin, except for one
instance in sw/source/ui/frmdlg/column.cxx that used to involve an #if), plus
some subsequent solenv/clang-format/reformat-formatted-files.
Change-Id: Ib8b996b651aeafc03bbdc8890faa05ed50517224
Reviewed-on: https://gerrit.libreoffice.org/61573
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'cppuhelper')
-rw-r--r-- | cppuhelper/source/access_control.cxx | 4 | ||||
-rw-r--r-- | cppuhelper/source/component_context.cxx | 4 | ||||
-rw-r--r-- | cppuhelper/source/exc_thrower.cxx | 4 | ||||
-rw-r--r-- | cppuhelper/source/implbase_ex.cxx | 14 | ||||
-rw-r--r-- | cppuhelper/source/macro_expander.cxx | 4 | ||||
-rw-r--r-- | cppuhelper/source/propshlp.cxx | 6 | ||||
-rw-r--r-- | cppuhelper/source/tdmgr.cxx | 12 | ||||
-rw-r--r-- | cppuhelper/source/typeprovider.cxx | 2 | ||||
-rw-r--r-- | cppuhelper/source/weak.cxx | 2 |
9 files changed, 26 insertions, 26 deletions
diff --git a/cppuhelper/source/access_control.cxx b/cppuhelper/source/access_control.cxx index a63dcdacf3b1..164db03314eb 100644 --- a/cppuhelper/source/access_control.cxx +++ b/cppuhelper/source/access_control.cxx @@ -34,7 +34,7 @@ using rtl::OUString; namespace { - inline OUString str_ac_singleton() + OUString str_ac_singleton() { return OUString("/singletons/com.sun.star.security.theAccessController"); } @@ -85,7 +85,7 @@ namespace { #pragma pack(pop) #endif -inline void checkPermission( +void checkPermission( Reference< security::XAccessController > const & xController, Type const & type, rtl_uString * str1, rtl_uString * str2 ) { diff --git a/cppuhelper/source/component_context.cxx b/cppuhelper/source/component_context.cxx index f6b7aa0cf0da..62839c64d491 100644 --- a/cppuhelper/source/component_context.cxx +++ b/cppuhelper/source/component_context.cxx @@ -59,7 +59,7 @@ using rtl::OUStringBuffer; namespace cppu { -static inline void try_dispose( Reference< XInterface > const & xInstance ) +static void try_dispose( Reference< XInterface > const & xInstance ) { Reference< lang::XComponent > xComp( xInstance, UNO_QUERY ); if (xComp.is()) @@ -68,7 +68,7 @@ static inline void try_dispose( Reference< XInterface > const & xInstance ) } } -static inline void try_dispose( Reference< lang::XComponent > const & xComp ) +static void try_dispose( Reference< lang::XComponent > const & xComp ) { if (xComp.is()) { diff --git a/cppuhelper/source/exc_thrower.cxx b/cppuhelper/source/exc_thrower.cxx index 647184a40802..5770bf50aa21 100644 --- a/cppuhelper/source/exc_thrower.cxx +++ b/cppuhelper/source/exc_thrower.cxx @@ -46,7 +46,7 @@ using cppuhelper::detail::XExceptionThrower; struct ExceptionThrower : public uno_Interface, XExceptionThrower { - inline ExceptionThrower(); + ExceptionThrower(); virtual ~ExceptionThrower() {} @@ -164,7 +164,7 @@ void ExceptionThrower::rethrowException() } -inline ExceptionThrower::ExceptionThrower() +ExceptionThrower::ExceptionThrower() { uno_Interface::acquire = ExceptionThrower_acquire_release_nop; uno_Interface::release = ExceptionThrower_acquire_release_nop; diff --git a/cppuhelper/source/implbase_ex.cxx b/cppuhelper/source/implbase_ex.cxx index 2abad8783bcf..c0f5477d2029 100644 --- a/cppuhelper/source/implbase_ex.cxx +++ b/cppuhelper/source/implbase_ex.cxx @@ -54,7 +54,7 @@ static ::osl::Mutex & getImplHelperInitMutex() } -static inline void checkInterface( Type const & rType ) +static void checkInterface( Type const & rType ) { if (TypeClass_INTERFACE != rType.getTypeClass()) { @@ -64,17 +64,17 @@ static inline void checkInterface( Type const & rType ) } } -static inline bool isXInterface( rtl_uString * pStr ) +static bool isXInterface( rtl_uString * pStr ) { return OUString::unacquired(&pStr) == "com.sun.star.uno.XInterface"; } -static inline void * makeInterface( sal_IntPtr nOffset, void * that ) +static void * makeInterface( sal_IntPtr nOffset, void * that ) { return (static_cast<char *>(that) + nOffset); } -static inline bool td_equals( +static bool td_equals( typelib_TypeDescriptionReference const * pTDR1, typelib_TypeDescriptionReference const * pTDR2 ) { @@ -82,7 +82,7 @@ static inline bool td_equals( OUString::unacquired(&pTDR1->pTypeName) == OUString::unacquired(&pTDR2->pTypeName)); } -static inline type_entry * getTypeEntries( class_data * cd ) +static type_entry * getTypeEntries( class_data * cd ) { type_entry * pEntries = cd->m_typeEntries; if (! cd->m_storedTypeRefs) // not inited? @@ -117,7 +117,7 @@ static inline type_entry * getTypeEntries( class_data * cd ) return pEntries; } -static inline void fillTypes( Type * types, class_data * cd ) +static void fillTypes( Type * types, class_data * cd ) { type_entry * pEntries = getTypeEntries( cd ); for ( sal_Int32 n = cd->m_nTypes; n--; ) @@ -168,7 +168,7 @@ bool recursivelyFindType( } -static inline void * queryDeepNoXInterface( +static void * queryDeepNoXInterface( typelib_TypeDescriptionReference const * pDemandedTDR, class_data * cd, void * that ) { type_entry * pEntries = getTypeEntries( cd ); diff --git a/cppuhelper/source/macro_expander.cxx b/cppuhelper/source/macro_expander.cxx index cfaebecfcc86..2b8d5407ce81 100644 --- a/cppuhelper/source/macro_expander.cxx +++ b/cppuhelper/source/macro_expander.cxx @@ -103,12 +103,12 @@ public: class theImplNames : public rtl::Static<ImplNames, theImplNames> {}; -inline OUString s_impl_name() +OUString s_impl_name() { return OUString(IMPL_NAME); } -inline Sequence< OUString > const & s_get_service_names() +Sequence< OUString > const & s_get_service_names() { return theImplNames::get().getNames(); } diff --git a/cppuhelper/source/propshlp.cxx b/cppuhelper/source/propshlp.cxx index a8053aac6b61..83e7726f0a35 100644 --- a/cppuhelper/source/propshlp.cxx +++ b/cppuhelper/source/propshlp.cxx @@ -43,15 +43,15 @@ IPropertyArrayHelper::~IPropertyArrayHelper() { } -static inline const css::uno::Type & getPropertyTypeIdentifier( ) +static const css::uno::Type & getPropertyTypeIdentifier( ) { return cppu::UnoType<XPropertyChangeListener>::get(); } -static inline const css::uno::Type & getPropertiesTypeIdentifier() +static const css::uno::Type & getPropertiesTypeIdentifier() { return cppu::UnoType<XPropertiesChangeListener>::get(); } -static inline const css::uno::Type & getVetoableTypeIdentifier() +static const css::uno::Type & getVetoableTypeIdentifier() { return cppu::UnoType<XVetoableChangeListener>::get(); } diff --git a/cppuhelper/source/tdmgr.cxx b/cppuhelper/source/tdmgr.cxx index 1627e2277526..b4aec385c956 100644 --- a/cppuhelper/source/tdmgr.cxx +++ b/cppuhelper/source/tdmgr.cxx @@ -66,7 +66,7 @@ static typelib_TypeDescription * createCTD( const Reference< XTypeDescription > & xType ); -inline static typelib_TypeDescription * createCTD( +static typelib_TypeDescription * createCTD( const Reference< XCompoundTypeDescription > & xType ) { typelib_TypeDescription * pRet = nullptr; @@ -123,7 +123,7 @@ inline static typelib_TypeDescription * createCTD( return pRet; } -inline static typelib_TypeDescription * createCTD( +static typelib_TypeDescription * createCTD( Reference< container::XHierarchicalNameAccess > const & access, const Reference< XStructTypeDescription > & xType ) { @@ -199,7 +199,7 @@ inline static typelib_TypeDescription * createCTD( return pRet; } -inline static typelib_TypeDescription * createCTD( +static typelib_TypeDescription * createCTD( const Reference< XInterfaceAttributeTypeDescription2 > & xAttribute ) { typelib_TypeDescription * pRet = nullptr; @@ -308,7 +308,7 @@ static typelib_TypeDescription * createCTD( return pRet; } -inline static typelib_TypeDescription * createCTD( +static typelib_TypeDescription * createCTD( Reference< container::XHierarchicalNameAccess > const & access, const Reference< XInterfaceTypeDescription2 > & xType ) { @@ -374,7 +374,7 @@ inline static typelib_TypeDescription * createCTD( return pRet; } -inline static typelib_TypeDescription * createCTD( const Reference< XEnumTypeDescription > & xType ) +static typelib_TypeDescription * createCTD( const Reference< XEnumTypeDescription > & xType ) { typelib_TypeDescription * pRet = nullptr; if (xType.is()) @@ -393,7 +393,7 @@ inline static typelib_TypeDescription * createCTD( const Reference< XEnumTypeDes return pRet; } -inline static typelib_TypeDescription * createCTD( +static typelib_TypeDescription * createCTD( Reference< container::XHierarchicalNameAccess > const & access, const Reference< XIndirectTypeDescription > & xType ) { diff --git a/cppuhelper/source/typeprovider.cxx b/cppuhelper/source/typeprovider.cxx index 125ceda30ca8..c4258ef61cc8 100644 --- a/cppuhelper/source/typeprovider.cxx +++ b/cppuhelper/source/typeprovider.cxx @@ -50,7 +50,7 @@ Sequence< sal_Int8 > OImplementationId::getImplementationId() const } -static inline void copy( Sequence< Type > & rDest, const Sequence< Type > & rSource, sal_Int32 nOffset ) +static void copy( Sequence< Type > & rDest, const Sequence< Type > & rSource, sal_Int32 nOffset ) { Type * pDest = rDest.getArray(); const Type * pSource = rSource.getConstArray(); diff --git a/cppuhelper/source/weak.cxx b/cppuhelper/source/weak.cxx index fc53cc56d440..cd3fa5e48dfc 100644 --- a/cppuhelper/source/weak.cxx +++ b/cppuhelper/source/weak.cxx @@ -38,7 +38,7 @@ namespace cppu // due to static Reflection destruction from usr, there must be a mutex leak (#73272#) // this is used to lock all instances of OWeakConnectionPoint and OWeakRefListener as well as OWeakObject::m_pWeakConnectionPoint -inline static Mutex & getWeakMutex() +static Mutex & getWeakMutex() { static Mutex * s_pMutex = nullptr; if (! s_pMutex) |