summaryrefslogtreecommitdiff
path: root/cppu/source
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/source')
-rw-r--r--cppu/source/AffineBridge/AffineBridge.cxx7
-rw-r--r--cppu/source/UnsafeBridge/UnsafeBridge.cxx4
-rw-r--r--cppu/source/helper/purpenv/helper_purpenv_Environment.cxx4
-rw-r--r--cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx4
-rw-r--r--cppu/source/threadpool/current.cxx3
-rw-r--r--cppu/source/threadpool/threadpool.cxx7
-rw-r--r--cppu/source/typelib/static_types.cxx4
-rw-r--r--cppu/source/typelib/typelib.cxx10
-rw-r--r--cppu/source/uno/EnvStack.cxx6
-rw-r--r--cppu/source/uno/IdentityMapping.cxx4
-rw-r--r--cppu/source/uno/cascade_mapping.cxx4
-rw-r--r--cppu/source/uno/lbmap.cxx15
12 files changed, 72 insertions, 0 deletions
diff --git a/cppu/source/AffineBridge/AffineBridge.cxx b/cppu/source/AffineBridge/AffineBridge.cxx
index 1e2a45ac84cf..156d6eb9c7a0 100644
--- a/cppu/source/AffineBridge/AffineBridge.cxx
+++ b/cppu/source/AffineBridge/AffineBridge.cxx
@@ -29,6 +29,7 @@
#include <cppu/helper/purpenv/Mapping.hxx>
#include <memory>
+namespace {
class InnerThread;
class OuterThread;
@@ -86,6 +87,8 @@ public:
}
};
+}
+
void InnerThread::run()
{
osl_setThreadName("UNO AffineBridge InnerThread");
@@ -95,6 +98,8 @@ void InnerThread::run()
m_pAffineBridge->leave();
}
+namespace {
+
class OuterThread : public osl::Thread
{
virtual void SAL_CALL run() override;
@@ -105,6 +110,8 @@ public:
explicit OuterThread(AffineBridge * threadEnvironment);
};
+}
+
OuterThread::OuterThread(AffineBridge * threadEnvironment)
: m_pAffineBridge(threadEnvironment)
{
diff --git a/cppu/source/UnsafeBridge/UnsafeBridge.cxx b/cppu/source/UnsafeBridge/UnsafeBridge.cxx
index 7cf945d44391..491a888c3921 100644
--- a/cppu/source/UnsafeBridge/UnsafeBridge.cxx
+++ b/cppu/source/UnsafeBridge/UnsafeBridge.cxx
@@ -26,6 +26,8 @@
#include <cppu/helper/purpenv/Environment.hxx>
#include <cppu/helper/purpenv/Mapping.hxx>
+namespace {
+
class UnsafeBridge : public cppu::Enterable
{
osl::Mutex m_mutex;
@@ -46,6 +48,8 @@ public:
virtual bool v_isValid(OUString * pReason) override;
};
+}
+
UnsafeBridge::UnsafeBridge()
: m_count (0),
m_threadId(0)
diff --git a/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx b/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx
index ceeee6eb0deb..bb8af537c4b8 100644
--- a/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx
+++ b/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx
@@ -59,6 +59,8 @@ typedef void ExtEnv_releaseInterface (uno_ExtEnvironment *
void * pInterface);
}
+namespace {
+
class Base : public cppu::Enterable
{
public:
@@ -117,6 +119,8 @@ protected:
virtual ~Base() override;
};
+}
+
extern "C" {
static void s_acquire(uno_Environment * pEnv) //SAL_THROW_EXTERN_C()
{
diff --git a/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx b/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx
index 19c341f15d34..6255b2f0b52a 100644
--- a/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx
+++ b/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx
@@ -29,6 +29,8 @@
using namespace com::sun::star;
+namespace {
+
class Mapping : public uno_Mapping
{
uno::Environment m_from;
@@ -55,6 +57,8 @@ public:
void release();
};
+}
+
static void s_mapInterface(
uno_Mapping * puno_Mapping,
void ** ppOut,
diff --git a/cppu/source/threadpool/current.cxx b/cppu/source/threadpool/current.cxx
index f788e005a031..665f1b7c636e 100644
--- a/cppu/source/threadpool/current.cxx
+++ b/cppu/source/threadpool/current.cxx
@@ -81,6 +81,7 @@ static typelib_InterfaceTypeDescription * get_type_XCurrentContext()
return s_type_XCurrentContext;
}
+namespace {
class ThreadKey
{
@@ -119,6 +120,8 @@ public:
}
};
+}
+
extern "C" {
static void delete_IdContainer( void * p )
diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx
index 40b031c85732..d11268b85784 100644
--- a/cppu/source/threadpool/threadpool.cxx
+++ b/cppu/source/threadpool/threadpool.cxx
@@ -44,6 +44,8 @@ namespace cppu_threadpool
rtl::Reference<ORequestThread> const & theThread): thread(theThread)
{}
+ namespace {
+
struct theDisposedCallerAdmin :
public rtl::StaticWithInit< DisposedCallerAdminHolder, theDisposedCallerAdmin >
{
@@ -52,6 +54,8 @@ namespace cppu_threadpool
}
};
+ }
+
DisposedCallerAdminHolder const & DisposedCallerAdmin::getInstance()
{
return theDisposedCallerAdmin::get();
@@ -328,6 +332,8 @@ namespace cppu_threadpool
using namespace cppu_threadpool;
+namespace {
+
struct uno_ThreadPool_Equal
{
bool operator () ( const uno_ThreadPool &a , const uno_ThreadPool &b ) const
@@ -344,6 +350,7 @@ struct uno_ThreadPool_Hash
}
};
+}
typedef std::unordered_map< uno_ThreadPool, ThreadPoolHolder, uno_ThreadPool_Hash, uno_ThreadPool_Equal > ThreadpoolHashSet;
diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx
index 5a400817115d..b2638979936a 100644
--- a/cppu/source/typelib/static_types.cxx
+++ b/cppu/source/typelib/static_types.cxx
@@ -40,6 +40,8 @@ extern "C"
#pragma pack(push, 8)
#endif
+namespace {
+
/**
* The double member determines the alignment.
* Under OS2 and MS-Windows the Alignment is min( 8, sizeof( type ) ).
@@ -59,6 +61,8 @@ struct AlignSize_Impl
#endif
};
+}
+
#ifdef _WIN32
#pragma pack(pop)
#endif
diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx
index 1604cf7b7997..c94ee1a80ec2 100644
--- a/cppu/source/typelib/typelib.cxx
+++ b/cppu/source/typelib/typelib.cxx
@@ -46,6 +46,8 @@ using namespace osl;
#pragma pack(push, 8)
#endif
+namespace {
+
/**
* The double member determines the alignment.
* Under OS2 and MS-Windows the Alignment is min( 8, sizeof( type ) ).
@@ -65,6 +67,8 @@ struct AlignSize_Impl
#endif
};
+}
+
#ifdef _WIN32
#pragma pack(pop)
#endif
@@ -138,6 +142,7 @@ static sal_Int32 getDescriptionSize( typelib_TypeClass eTypeClass )
return nSize;
}
+namespace {
struct equalStr_Impl
{
@@ -152,6 +157,7 @@ struct hashStr_Impl
{ return rtl_ustr_hashCode( s ); }
};
+}
// Heavy hack, the const sal_Unicode * is hold by the typedescription reference
typedef std::unordered_map< const sal_Unicode *, typelib_TypeDescriptionReference *,
@@ -164,6 +170,8 @@ typedef list< typelib_TypeDescription * > TypeDescriptionList_Impl;
// # of cached elements
static sal_Int32 nCacheSize = 256;
+namespace {
+
struct TypeDescriptor_Init_Impl
{
//sal_Bool bDesctructorCalled;
@@ -206,6 +214,8 @@ struct TypeDescriptor_Init_Impl
~TypeDescriptor_Init_Impl();
};
+}
+
inline Mutex & TypeDescriptor_Init_Impl::getMutex()
{
if( !pMutex )
diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx
index 71c87bec7c37..f6b11352cf14 100644
--- a/cppu/source/uno/EnvStack.cxx
+++ b/cppu/source/uno/EnvStack.cxx
@@ -33,12 +33,15 @@
using namespace com::sun::star;
+namespace {
struct oslThreadIdentifier_equal
{
bool operator()(oslThreadIdentifier s1, oslThreadIdentifier s2) const;
};
+}
+
bool oslThreadIdentifier_equal::operator()(oslThreadIdentifier s1, oslThreadIdentifier s2) const
{
bool result = s1 == s2;
@@ -46,12 +49,15 @@ bool oslThreadIdentifier_equal::operator()(oslThreadIdentifier s1, oslThreadIden
return result;
}
+namespace {
struct oslThreadIdentifier_hash
{
size_t operator()(oslThreadIdentifier s1) const;
};
+}
+
size_t oslThreadIdentifier_hash::operator()(oslThreadIdentifier s1) const
{
return s1;
diff --git a/cppu/source/uno/IdentityMapping.cxx b/cppu/source/uno/IdentityMapping.cxx
index 6b7ad09f98c6..c6dab40cefe8 100644
--- a/cppu/source/uno/IdentityMapping.cxx
+++ b/cppu/source/uno/IdentityMapping.cxx
@@ -28,6 +28,8 @@
using namespace ::com::sun::star;
+namespace {
+
struct IdentityMapping : public uno_Mapping
{
sal_Int32 m_nRef;
@@ -36,6 +38,8 @@ struct IdentityMapping : public uno_Mapping
explicit IdentityMapping(uno::Environment const & rEnv);
};
+}
+
extern "C"
{
diff --git a/cppu/source/uno/cascade_mapping.cxx b/cppu/source/uno/cascade_mapping.cxx
index 13df4d8814e7..f57f7dc0ac87 100644
--- a/cppu/source/uno/cascade_mapping.cxx
+++ b/cppu/source/uno/cascade_mapping.cxx
@@ -30,6 +30,8 @@
using namespace com::sun::star;
+namespace {
+
class MediatorMapping : public uno_Mapping
{
oslInterlockedCount m_refCount;
@@ -53,6 +55,8 @@ public:
uno_Environment * pTo);
};
+}
+
extern "C" {
static void s_acquire(uno_Mapping * mapping)
{
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index a97d2a0dc829..ad27087b9b02 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -53,6 +53,8 @@ using namespace com::sun::star::uno;
namespace cppu
{
+namespace {
+
class Mapping
{
uno_Mapping * _pMapping;
@@ -80,6 +82,8 @@ public:
{ return (_pMapping != nullptr); }
};
+}
+
inline Mapping::Mapping( uno_Mapping * pMapping )
: _pMapping( pMapping )
{
@@ -110,6 +114,7 @@ inline Mapping & Mapping::operator = ( uno_Mapping * pMapping )
return *this;
}
+namespace {
struct MappingEntry
{
@@ -134,6 +139,8 @@ struct FctPtrHash
{ return reinterpret_cast<size_t>(pKey); }
};
+}
+
typedef std::unordered_map<
OUString, MappingEntry * > t_OUString2Entry;
typedef std::unordered_map<
@@ -141,6 +148,7 @@ typedef std::unordered_map<
typedef set< uno_getMappingFunc > t_CallbackSet;
+namespace {
struct MappingsData
{
@@ -155,6 +163,8 @@ struct MappingsData
set<OUString> aNegativeLibs;
};
+}
+
static MappingsData & getMappingsData()
{
//TODO This memory is leaked; see #i63473# for when this should be
@@ -164,6 +174,8 @@ static MappingsData & getMappingsData()
return *s_p;
}
+namespace {
+
/**
* This class mediates two different mapping via uno, e.g. form any language to uno,
* then from uno to any other language.
@@ -185,6 +197,9 @@ struct uno_Mediate_Mapping : public uno_Mapping
const Mapping & rFrom2Uno_, const Mapping & rUno2To_,
const OUString & rAddPurpose );
};
+
+}
+
extern "C"
{