diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-06-08 20:53:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-09 10:34:00 +0100 |
commit | ad62165065a0f96933d8b491770775bb57ac51bd (patch) | |
tree | be8f806481f96756bc33d9414640b31dd1e84f5f /cppu | |
parent | cc0e9a37de8bceeb224b03a5bb1827b087e3e7b5 (diff) |
cppcheck: noExplicitConstructor
Change-Id: Ic33ee6936f40bec4f3a82aea39a180ae6e9a0928
Diffstat (limited to 'cppu')
-rw-r--r-- | cppu/source/AffineBridge/AffineBridge.cxx | 4 | ||||
-rw-r--r-- | cppu/source/threadpool/current.cxx | 48 | ||||
-rw-r--r-- | cppu/source/typelib/typelib.cxx | 2 | ||||
-rw-r--r-- | cppu/source/uno/IdentityMapping.cxx | 2 | ||||
-rw-r--r-- | cppu/source/uno/lbenv.cxx | 2 |
5 files changed, 26 insertions, 32 deletions
diff --git a/cppu/source/AffineBridge/AffineBridge.cxx b/cppu/source/AffineBridge/AffineBridge.cxx index 2184a59461a1..b0f23d41162a 100644 --- a/cppu/source/AffineBridge/AffineBridge.cxx +++ b/cppu/source/AffineBridge/AffineBridge.cxx @@ -90,7 +90,7 @@ class InnerThread : public osl::Thread AffineBridge * m_pAffineBridge; public: - InnerThread(AffineBridge * threadEnvironment) + explicit InnerThread(AffineBridge * threadEnvironment) : m_pAffineBridge(threadEnvironment) { create(); @@ -113,7 +113,7 @@ class OuterThread : public osl::Thread AffineBridge * m_pAffineBridge; public: - OuterThread(AffineBridge * threadEnvironment); + explicit OuterThread(AffineBridge * threadEnvironment); }; OuterThread::OuterThread(AffineBridge * threadEnvironment) diff --git a/cppu/source/threadpool/current.cxx b/cppu/source/threadpool/current.cxx index 610d4b35e755..cc313cdf925a 100644 --- a/cppu/source/threadpool/current.cxx +++ b/cppu/source/threadpool/current.cxx @@ -106,41 +106,35 @@ class ThreadKey oslThreadKeyCallbackFunction _pCallback; public: - inline oslThreadKey getThreadKey(); - - inline ThreadKey( oslThreadKeyCallbackFunction pCallback ); - inline ~ThreadKey(); -}; - -inline ThreadKey::ThreadKey( oslThreadKeyCallbackFunction pCallback ) - : _bInit( false ) - , _hThreadKey( 0 ) - , _pCallback( pCallback ) -{ -} + oslThreadKey getThreadKey() + { + if (! _bInit) + { + MutexGuard aGuard( Mutex::getGlobalMutex() ); + if (! _bInit) + { + _hThreadKey = ::osl_createThreadKey( _pCallback ); + _bInit = true; + } + } + return _hThreadKey; + } -inline ThreadKey::~ThreadKey() -{ - if (_bInit) + explicit ThreadKey( oslThreadKeyCallbackFunction pCallback ) + : _bInit(false) + , _hThreadKey(0) + , _pCallback(pCallback) { - ::osl_destroyThreadKey( _hThreadKey ); } -} -inline oslThreadKey ThreadKey::getThreadKey() -{ - if (! _bInit) + ~ThreadKey() { - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if (! _bInit) + if (_bInit) { - _hThreadKey = ::osl_createThreadKey( _pCallback ); - _bInit = true; + ::osl_destroyThreadKey( _hThreadKey ); } } - return _hThreadKey; -} - +}; extern "C" void SAL_CALL delete_IdContainer( void * p ) { diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index ff76c8c98be1..740b9bcb7648 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -920,7 +920,7 @@ public: typedef std::vector< Entry > List; - BaseList(typelib_InterfaceTypeDescription const * desc); + explicit BaseList(typelib_InterfaceTypeDescription const * desc); List const & getList() const { return list; } diff --git a/cppu/source/uno/IdentityMapping.cxx b/cppu/source/uno/IdentityMapping.cxx index 270d065ca802..4f8266cb3aa0 100644 --- a/cppu/source/uno/IdentityMapping.cxx +++ b/cppu/source/uno/IdentityMapping.cxx @@ -33,7 +33,7 @@ struct IdentityMapping : public uno_Mapping sal_Int32 m_nRef; uno::Environment m_env; - IdentityMapping(uno::Environment const & rEnv); + explicit IdentityMapping(uno::Environment const & rEnv); }; extern "C" diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx index 8068e12c38de..239b81b595f2 100644 --- a/cppu/source/uno/lbenv.cxx +++ b/cppu/source/uno/lbenv.cxx @@ -82,7 +82,7 @@ struct ObjectEntry ::std::vector< InterfaceEntry > aInterfaces; bool mixedObject; - inline ObjectEntry( const OUString & rOId_ ); + explicit inline ObjectEntry( const OUString & rOId_ ); inline void append( uno_DefaultEnvironment * pEnv, |