summaryrefslogtreecommitdiff
path: root/cppu/source/uno
diff options
context:
space:
mode:
Diffstat (limited to 'cppu/source/uno')
-rw-r--r--cppu/source/uno/EnvDcp.c3
-rw-r--r--cppu/source/uno/EnvStack.cxx34
-rw-r--r--cppu/source/uno/IdentityMapping.cxx3
-rw-r--r--cppu/source/uno/IdentityMapping.hxx3
-rw-r--r--cppu/source/uno/any.cxx3
-rw-r--r--cppu/source/uno/assign.hxx3
-rw-r--r--cppu/source/uno/cascade_mapping.cxx10
-rw-r--r--cppu/source/uno/cascade_mapping.hxx3
-rw-r--r--cppu/source/uno/constr.hxx3
-rw-r--r--cppu/source/uno/copy.hxx7
-rw-r--r--cppu/source/uno/data.cxx30
-rw-r--r--cppu/source/uno/destr.hxx9
-rw-r--r--cppu/source/uno/env_subst.cxx3
-rw-r--r--cppu/source/uno/env_subst.hxx3
-rw-r--r--cppu/source/uno/eq.hxx6
-rw-r--r--cppu/source/uno/lbenv.cxx44
-rw-r--r--cppu/source/uno/lbmap.cxx20
-rw-r--r--cppu/source/uno/loadmodule.cxx7
-rw-r--r--cppu/source/uno/loadmodule.hxx3
-rw-r--r--cppu/source/uno/prim.hxx9
-rw-r--r--cppu/source/uno/sequence.cxx7
21 files changed, 131 insertions, 82 deletions
diff --git a/cppu/source/uno/EnvDcp.c b/cppu/source/uno/EnvDcp.c
index 7fb9a0e0ee68..a9d6dc3d59c7 100644
--- a/cppu/source/uno/EnvDcp.c
+++ b/cppu/source/uno/EnvDcp.c
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -47,3 +48,5 @@ void uno_EnvDcp_getPurpose(rtl_uString const * pEnvDcp, rtl_uString ** ppEnvPurp
else
rtl_uString_new(ppEnvPurpose);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/EnvStack.cxx b/cppu/source/uno/EnvStack.cxx
index b7cefd42b4da..d1ff2922233a 100644
--- a/cppu/source/uno/EnvStack.cxx
+++ b/cppu/source/uno/EnvStack.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,10 +31,12 @@
#include "cppu/EnvDcp.hxx"
#include "cppu/Enterable.hxx"
+#include "rtl/instance.hxx"
+
#include "osl/thread.h"
#include "osl/mutex.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
using namespace com::sun::star;
@@ -62,14 +65,16 @@ size_t oslThreadIdentifier_hash::operator()(oslThreadIdentifier s1) const
return s1;
}
-typedef ::std::hash_map<oslThreadIdentifier,
+typedef ::boost::unordered_map<oslThreadIdentifier,
uno_Environment *,
oslThreadIdentifier_hash,
oslThreadIdentifier_equal> ThreadMap;
-static osl::Mutex s_threadMap_mutex;
-static ThreadMap s_threadMap;
-
+namespace
+{
+ struct s_threadMap_mutex : public rtl::Static< osl::Mutex, s_threadMap_mutex > {};
+ struct s_threadMap : public rtl::Static< ThreadMap, s_threadMap > {};
+}
static rtl::OUString s_uno_envDcp(RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO));
@@ -77,15 +82,13 @@ static void s_setCurrent(uno_Environment * pEnv)
{
oslThreadIdentifier threadId = osl_getThreadIdentifier(NULL);
- osl::MutexGuard guard(s_threadMap_mutex);
+ osl::MutexGuard guard(s_threadMap_mutex::get());
+ ThreadMap &rThreadMap = s_threadMap::get();
if (pEnv)
- s_threadMap[threadId] = pEnv;
+ rThreadMap[threadId] = pEnv;
else
- {
- ThreadMap::iterator iEnv = s_threadMap.find(threadId);
- s_threadMap.erase(iEnv);
- }
+ rThreadMap.erase(threadId);
}
static uno_Environment * s_getCurrent(void)
@@ -94,9 +97,10 @@ static uno_Environment * s_getCurrent(void)
oslThreadIdentifier threadId = osl_getThreadIdentifier(NULL);
- osl::MutexGuard guard(s_threadMap_mutex);
- ThreadMap::iterator iEnv = s_threadMap.find(threadId);
- if(iEnv != s_threadMap.end())
+ osl::MutexGuard guard(s_threadMap_mutex::get());
+ ThreadMap &rThreadMap = s_threadMap::get();
+ ThreadMap::iterator iEnv = rThreadMap.find(threadId);
+ if(iEnv != rThreadMap.end())
pEnv = iEnv->second;
return pEnv;
@@ -378,3 +382,5 @@ int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pRea
return result;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/IdentityMapping.cxx b/cppu/source/uno/IdentityMapping.cxx
index 64721e2993ca..868a4d7c5e3c 100644
--- a/cppu/source/uno/IdentityMapping.cxx
+++ b/cppu/source/uno/IdentityMapping.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -104,3 +105,5 @@ uno_Mapping * createIdentityMapping(uno::Environment const & rEnv) SAL_THROW(())
{
return new IdentityMapping(rEnv);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/IdentityMapping.hxx b/cppu/source/uno/IdentityMapping.hxx
index cf95a30b203c..cd9760640656 100644
--- a/cppu/source/uno/IdentityMapping.hxx
+++ b/cppu/source/uno/IdentityMapping.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,3 +38,5 @@ class Environment;
uno_Mapping * createIdentityMapping(const ::com::sun::star::uno::Environment & rEnv);
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/any.cxx b/cppu/source/uno/any.cxx
index 29be833dfb86..f83373ce4d5c 100644
--- a/cppu/source/uno/any.cxx
+++ b/cppu/source/uno/any.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -148,3 +149,5 @@ void SAL_CALL uno_any_clear( uno_Any * pValue, uno_ReleaseFunc release )
CONSTRUCT_EMPTY_ANY( pValue );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/assign.hxx b/cppu/source/uno/assign.hxx
index 256bb31565db..42375832ab09 100644
--- a/cppu/source/uno/assign.hxx
+++ b/cppu/source/uno/assign.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -633,3 +634,5 @@ inline sal_Bool _assignData(
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/cascade_mapping.cxx b/cppu/source/uno/cascade_mapping.cxx
index ee870a52e286..9e32c6db8bc5 100644
--- a/cppu/source/uno/cascade_mapping.cxx
+++ b/cppu/source/uno/cascade_mapping.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,22 +26,17 @@
*
************************************************************************/
-#include <iostream>
-
#include "osl/interlck.h"
#include "rtl/ustring.hxx"
#include "uno/environment.hxx"
#include "uno/mapping.hxx"
#include "uno/dispatcher.h"
-//#include "cascade_mappping.hxx"
#include "cppu/EnvDcp.hxx"
-//#define LOG_CALLING_named_purpose_getMapping
-
-//#define LOG_LIFECYLE_MediatorMapping
#ifdef LOG_LIFECYLE_MediatorMapping
+# include <iostream>
# define LOG_LIFECYLE_MediatorMapping_emit(x) x
#else
@@ -339,3 +335,5 @@ void getCascadeMapping(uno_Mapping ** ppMapping,
*ppMapping = pMapping;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/cascade_mapping.hxx b/cppu/source/uno/cascade_mapping.hxx
index 3b63e17198fb..9920fa05058d 100644
--- a/cppu/source/uno/cascade_mapping.hxx
+++ b/cppu/source/uno/cascade_mapping.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,3 +40,5 @@ void getCascadeMapping(uno_Mapping ** ppMapping,
rtl_uString * pAddPurpose );
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/constr.hxx b/cppu/source/uno/constr.hxx
index 8e6d35e9db64..b8eb9b5cc5ce 100644
--- a/cppu/source/uno/constr.hxx
+++ b/cppu/source/uno/constr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -265,3 +266,5 @@ inline void _defaultConstructData(
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/copy.hxx b/cppu/source/uno/copy.hxx
index 7999b5ae0d2b..eee6363e6998 100644
--- a/cppu/source/uno/copy.hxx
+++ b/cppu/source/uno/copy.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -251,7 +252,7 @@ inline void _copyConstructAnyFromData(
*(typelib_TypeDescriptionReference **)&pDestAny->pReserved = *(typelib_TypeDescriptionReference **)pSource;
break;
case typelib_TypeClass_ANY:
- OSL_ENSURE( 0, "### unexpected nested any!" );
+ OSL_FAIL( "### unexpected nested any!" );
break;
case typelib_TypeClass_ENUM:
pDestAny->pData = &pDestAny->pReserved;
@@ -728,7 +729,7 @@ inline uno_Sequence * icopyConstructSequence(
break;
}
default:
- OSL_ENSURE( 0, "### unexepcted sequence element type!" );
+ OSL_FAIL( "### unexepcted sequence element type!" );
pDest = 0;
break;
}
@@ -884,3 +885,5 @@ inline void _copyConstructData(
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/data.cxx b/cppu/source/uno/data.cxx
index bb2869ca037f..19da7a87fbc1 100644
--- a/cppu/source/uno/data.cxx
+++ b/cppu/source/uno/data.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -108,7 +109,7 @@ void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * p
#if OSL_DEBUG_LEVEL > 1
OUStringBuffer buf( 128 );
buf.appendAscii(
- RTL_CONSTASCII_STRINGPARAM("### exception occured querying for interface ") );
+ RTL_CONSTASCII_STRINGPARAM("### exception occurred querying for interface ") );
buf.append( * reinterpret_cast< OUString const * >( &pDestType->pTypeName ) );
buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(": [") );
buf.append( * reinterpret_cast< OUString const * >( &pExc->pType->pTypeName ) );
@@ -117,7 +118,7 @@ void * binuno_queryInterface( void * pUnoI, typelib_TypeDescriptionReference * p
buf.append( * reinterpret_cast< OUString const * >( pExc->pData ) );
OString cstr(
OUStringToOString( buf.makeStringAndClear(), RTL_TEXTENCODING_ASCII_US ) );
- OSL_ENSURE( 0, cstr.getStr() );
+ OSL_FAIL( cstr.getStr() );
#endif
uno_any_destruct( pExc, 0 );
}
@@ -276,7 +277,7 @@ sal_Bool SAL_CALL uno_type_equalData(
{
return _equalData(
pVal1, pVal1Type, 0,
- pVal2, pVal2Type, 0,
+ pVal2, pVal2Type,
queryInterface, release );
}
//##################################################################################################
@@ -288,7 +289,7 @@ sal_Bool SAL_CALL uno_equalData(
{
return _equalData(
pVal1, pVal1TD->pWeakRef, pVal1TD,
- pVal2, pVal2TD->pWeakRef, pVal2TD,
+ pVal2, pVal2TD->pWeakRef,
queryInterface, release );
}
//##################################################################################################
@@ -355,12 +356,11 @@ sal_Bool SAL_CALL uno_type_isAssignableFromData(
#if defined( SAL_W32)
#pragma pack(push, 8)
-#elif defined(SAL_OS2)
-#pragma pack(push, 4)
#endif
#if defined(INTEL) \
- && (defined(__GNUC__) && (defined(LINUX) || defined(FREEBSD) || defined(OS2)) || defined(MACOSX) \
+ && (defined(__GNUC__) && (defined(LINUX) || defined(FREEBSD) \
+ || defined(NETBSD) || defined(OPENBSD)) || defined(MACOSX) || defined(DRAGONFLY) \
|| defined(__SUNPRO_CC) && defined(SOLARIS))
#define MAX_ALIGNMENT_4
#endif
@@ -372,20 +372,8 @@ sal_Bool SAL_CALL uno_type_isAssignableFromData(
#define BINTEST_VERIFYOFFSET( s, m, n ) \
if (OFFSET_OF(s, m) != n) { fprintf( stderr, "### OFFSET_OF(" #s ", " #m ") = %" SAL_PRI_SIZET "u instead of expected %d!!!\n", OFFSET_OF(s, m), n ); abort(); }
-#if OSL_DEBUG_LEVEL > 1
-#if defined(__GNUC__) && (defined(LINUX) || defined(FREEBSD)) && (defined(INTEL) || defined(POWERPC) || defined(X86_64) || defined(S390))
-#define BINTEST_VERIFYSIZE( s, n ) \
- fprintf( stderr, "> sizeof(" #s ") = %d; __alignof__ (" #s ") = %d\n", sizeof(s), __alignof__ (s) ); \
- if (sizeof(s) != n) { fprintf( stderr, "### sizeof(" #s ") = %d instead of expected %d!!!\n", sizeof(s), n ); abort(); }
-#else // ! GNUC
-#define BINTEST_VERIFYSIZE( s, n ) \
- fprintf( stderr, "> sizeof(" #s ") = %d\n", sizeof(s) ); \
- if (sizeof(s) != n) { fprintf( stderr, "### sizeof(" #s ") = %d instead of expected %d!!!\n", sizeof(s), n ); abort(); }
-#endif
-#else // ! OSL_DEBUG_LEVEL
#define BINTEST_VERIFYSIZE( s, n ) \
if (sizeof(s) != n) { fprintf( stderr, "### sizeof(" #s ") = %d instead of expected %d!!!\n", sizeof(s), n ); abort(); }
-#endif
struct C1
{
@@ -607,8 +595,6 @@ BinaryCompatible_Impl::BinaryCompatible_Impl()
#ifdef SAL_W32
# pragma pack(pop)
-#elif defined(SAL_OS2)
-# pragma pack()
#endif
static BinaryCompatible_Impl aTest;
@@ -616,3 +602,5 @@ static BinaryCompatible_Impl aTest;
#endif
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/destr.hxx b/cppu/source/uno/destr.hxx
index 8f156038ade5..92da095f1ac1 100644
--- a/cppu/source/uno/destr.hxx
+++ b/cppu/source/uno/destr.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -146,12 +147,12 @@ inline void _destructAny(
(typelib_TypeDescriptionReference *)pAny->pReserved );
break;
case typelib_TypeClass_ANY:
- OSL_ENSURE( sal_False, "### unexpected nested any!" );
+ OSL_FAIL( "### unexpected nested any!" );
::uno_any_destruct( (uno_Any *)pAny->pData, release );
::rtl_freeMemory( pAny->pData );
break;
case typelib_TypeClass_TYPEDEF:
- OSL_ENSURE( 0, "### unexpected typedef!" );
+ OSL_FAIL( "### unexpected typedef!" );
break;
case typelib_TypeClass_STRUCT:
case typelib_TypeClass_EXCEPTION:
@@ -380,7 +381,7 @@ inline void _destructData(
_destructAny( (uno_Any *)pValue, release );
break;
case typelib_TypeClass_TYPEDEF:
- OSL_ENSURE( 0, "### unexpected typedef!" );
+ OSL_FAIL( "### unexpected typedef!" );
break;
case typelib_TypeClass_STRUCT:
case typelib_TypeClass_EXCEPTION:
@@ -436,3 +437,5 @@ inline void _destructData(
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/env_subst.cxx b/cppu/source/uno/env_subst.cxx
index 4465a9e1815e..6d75a35b662b 100644
--- a/cppu/source/uno/env_subst.cxx
+++ b/cppu/source/uno/env_subst.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -52,3 +53,5 @@ void SAL_CALL uno_getEnvironment(uno_Environment ** ppEnv,
uno_direct_getEnvironment(ppEnv, envDcp.pData, pContext);
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/env_subst.hxx b/cppu/source/uno/env_subst.hxx
index 8ee8631ced84..b0118a532403 100644
--- a/cppu/source/uno/env_subst.hxx
+++ b/cppu/source/uno/env_subst.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -39,3 +40,5 @@ extern "C" void SAL_CALL uno_direct_getEnvironment(uno_Environment ** ppEnv,
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/eq.hxx b/cppu/source/uno/eq.hxx
index 45bc0e79cfaa..fef81033cfa5 100644
--- a/cppu/source/uno/eq.hxx
+++ b/cppu/source/uno/eq.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -302,7 +303,7 @@ inline sal_Bool _equalData(
void * pDest,
typelib_TypeDescriptionReference * pDestType, typelib_TypeDescription * pDestTypeDescr,
void * pSource,
- typelib_TypeDescriptionReference * pSourceType, typelib_TypeDescription * pSourceTypeDescr,
+ typelib_TypeDescriptionReference * pSourceType,
uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release )
SAL_THROW( () )
{
@@ -315,7 +316,6 @@ inline sal_Bool _equalData(
}
while (typelib_TypeClass_ANY == (eSourceTypeClass = pSourceType->eTypeClass))
{
- pSourceTypeDescr = 0;
pSourceType = ((uno_Any *)pSource)->pType;
pSource = ((uno_Any *)pSource)->pData;
}
@@ -666,3 +666,5 @@ inline sal_Bool _equalData(
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/lbenv.cxx b/cppu/source/uno/lbenv.cxx
index f9e382d7e7a5..651e6862fba7 100644
--- a/cppu/source/uno/lbenv.cxx
+++ b/cppu/source/uno/lbenv.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,7 +51,7 @@
#include "destr.hxx"
#include "loadmodule.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <vector>
#include <stdio.h>
@@ -119,16 +120,16 @@ struct FctOUStringHash :
};
// mapping from environment name to environment
-typedef ::std::hash_map<
+typedef ::boost::unordered_map<
OUString, uno_Environment *, FctOUStringHash,
::std::equal_to< OUString > > OUString2EnvironmentMap;
// mapping from ptr to object entry
-typedef ::std::hash_map<
+typedef ::boost::unordered_map<
void *, ObjectEntry *, FctPtrHash,
::std::equal_to< void * > > Ptr2ObjectMap;
// mapping from oid to object entry
-typedef ::std::hash_map<
+typedef ::boost::unordered_map<
OUString, ObjectEntry *, FctOUStringHash,
::std::equal_to< OUString > > OId2ObjectMap;
@@ -269,7 +270,7 @@ static void SAL_CALL defenv_registerInterface(
// try to insert dummy 0:
std::pair<OId2ObjectMap::iterator, bool> const insertion(
- that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( rOId, 0 ) ) );
+ that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( rOId, (ObjectEntry*)0 ) ) );
if (insertion.second)
{
ObjectEntry * pOEntry = new ObjectEntry( rOId );
@@ -317,7 +318,7 @@ static void SAL_CALL defenv_registerProxyInterface(
// try to insert dummy 0:
std::pair<OId2ObjectMap::iterator, bool> const insertion(
- that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( rOId, 0 ) ) );
+ that->aOId2ObjectMap.insert( OId2ObjectMap::value_type( rOId, (ObjectEntry*)0 ) ) );
if (insertion.second)
{
ObjectEntry * pOEntry = new ObjectEntry( rOId );
@@ -686,8 +687,7 @@ static void writeLine(
}
else
{
- OSL_TRACE( pLine );
- OSL_TRACE( "\n" );
+ OSL_TRACE( "%s\n", pLine );
}
}
}
@@ -825,14 +825,14 @@ extern "C" void SAL_CALL uno_dumpEnvironmentByName(
}
}
-//------------------------------------------------------------------------------
-inline static const OUString & unoenv_getStaticOIdPart()
+namespace
{
- static OUString * s_pStaticOidPart = 0;
- if (! s_pStaticOidPart)
+ class makeOIdPart
{
- ::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() );
- if (! s_pStaticOidPart)
+ private:
+ OUString m_sOidPart;
+ public:
+ makeOIdPart()
{
::rtl::OUStringBuffer aRet( 64 );
aRet.appendAscii( RTL_CONSTASCII_STRINGPARAM("];") );
@@ -856,11 +856,18 @@ inline static const OUString & unoenv_getStaticOIdPart()
for ( sal_Int32 i = 0; i < 16; ++i )
aRet.append( (sal_Int32)ar[i], 16 );
- static OUString s_aStaticOidPart( aRet.makeStringAndClear() );
- s_pStaticOidPart = &s_aStaticOidPart;
+ m_sOidPart = aRet.makeStringAndClear();
}
- }
- return *s_pStaticOidPart;
+ const OUString& getOIdPart() const { return m_sOidPart; }
+ };
+
+ class theStaticOIdPart : public rtl::Static<makeOIdPart, theStaticOIdPart> {};
+}
+
+//------------------------------------------------------------------------------
+inline static const OUString & unoenv_getStaticOIdPart()
+{
+ return theStaticOIdPart::get().getOIdPart();
}
extern "C"
@@ -1185,3 +1192,4 @@ void SAL_CALL uno_getRegisteredEnvironments(
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/lbmap.cxx b/cppu/source/uno/lbmap.cxx
index d2c4a6f60641..0d3664c1a3da 100644
--- a/cppu/source/uno/lbmap.cxx
+++ b/cppu/source/uno/lbmap.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include "IdentityMapping.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <set>
#include <algorithm>
@@ -56,9 +57,11 @@
using namespace std;
using namespace osl;
-using namespace rtl;
using namespace com::sun::star::uno;
-
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+using ::rtl::OUStringToOString;
+using ::rtl::OString;
namespace cppu
{
@@ -68,7 +71,7 @@ class Mapping
uno_Mapping * _pMapping;
public:
- inline Mapping( uno_Mapping * pMapping = 0 ) SAL_THROW( () );
+ inline explicit Mapping( uno_Mapping * pMapping = 0 ) SAL_THROW( () );
inline Mapping( const Mapping & rMapping ) SAL_THROW( () );
inline ~Mapping() SAL_THROW( () );
inline Mapping & SAL_CALL operator = ( uno_Mapping * pMapping ) SAL_THROW( () );
@@ -129,21 +132,21 @@ struct MappingEntry
{}
};
//--------------------------------------------------------------------------------------------------
-struct FctOUStringHash : public unary_function< const OUString &, size_t >
+struct FctOUStringHash : public std::unary_function< const OUString &, size_t >
{
size_t operator()( const OUString & rKey ) const SAL_THROW( () )
{ return (size_t)rKey.hashCode(); }
};
//--------------------------------------------------------------------------------------------------
-struct FctPtrHash : public unary_function< uno_Mapping *, size_t >
+struct FctPtrHash : public std::unary_function< uno_Mapping *, size_t >
{
size_t operator()( uno_Mapping * pKey ) const SAL_THROW( () )
{ return (size_t)pKey; }
};
-typedef hash_map<
+typedef boost::unordered_map<
OUString, MappingEntry *, FctOUStringHash, equal_to< OUString > > t_OUString2Entry;
-typedef hash_map<
+typedef boost::unordered_map<
uno_Mapping *, MappingEntry *, FctPtrHash, equal_to< uno_Mapping * > > t_Mapping2Entry;
typedef set< uno_getMappingFunc > t_CallbackSet;
@@ -690,3 +693,4 @@ void SAL_CALL uno_revokeMappingCallback(
}
} // extern "C"
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/loadmodule.cxx b/cppu/source/uno/loadmodule.cxx
index e6858d247f04..ecc3ad9ce656 100644
--- a/cppu/source/uno/loadmodule.cxx
+++ b/cppu/source/uno/loadmodule.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -40,6 +41,9 @@
namespace cppu { namespace detail {
::oslModule loadModule(rtl::OUString const & name) {
+#ifdef IOS
+ return NULL;
+#else
rtl::OUStringBuffer b;
#if defined SAL_DLLPREFIX
b.appendAscii(RTL_CONSTASCII_STRINGPARAM(SAL_DLLPREFIX));
@@ -50,6 +54,9 @@ namespace cppu { namespace detail {
reinterpret_cast< oslGenericFunction >(&loadModule),
b.makeStringAndClear().pData,
SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY);
+#endif
}
} }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/loadmodule.hxx b/cppu/source/uno/loadmodule.hxx
index 77a9bb8d6dc0..fc3ec6dbbbe3 100644
--- a/cppu/source/uno/loadmodule.hxx
+++ b/cppu/source/uno/loadmodule.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -49,3 +50,5 @@ namespace cppu { namespace detail {
} }
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/prim.hxx b/cppu/source/uno/prim.hxx
index 4acafd125d55..81f6f3148173 100644
--- a/cppu/source/uno/prim.hxx
+++ b/cppu/source/uno/prim.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -28,22 +29,16 @@
#define PRIM_HXX
#include "typelib/typedescription.h"
-#ifndef _typelib_TypeClass_H_
#include "typelib/typeclass.h"
-#endif
#include "uno/sequence2.h"
#include "uno/any2.h"
#include "uno/data.h"
#include "uno/mapping.h"
#include "uno/dispatcher.h"
-#ifndef _OSL_INTERLCK_H
#include "osl/interlck.h"
-#endif
#include "osl/diagnose.h"
-#ifndef _RTL_USTRING_HXX
#include "rtl/ustring.hxx"
-#endif
#include "rtl/alloc.h"
#if OSL_DEBUG_LEVEL > 1
@@ -204,3 +199,5 @@ inline sal_Bool _type_equals(
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cppu/source/uno/sequence.cxx b/cppu/source/uno/sequence.cxx
index 933d38fc6b4f..6374c773cb86 100644
--- a/cppu/source/uno/sequence.cxx
+++ b/cppu/source/uno/sequence.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -350,7 +351,7 @@ static inline bool idefaultConstructElements(
}
break;
default:
- OSL_ENSURE( 0, "### unexpected element type!" );
+ OSL_FAIL( "### unexpected element type!" );
pSeq = 0;
break;
}
@@ -664,7 +665,7 @@ static inline bool icopyConstructFromElements(
break;
}
default:
- OSL_ENSURE( 0, "### unexpected element type!" );
+ OSL_FAIL( "### unexpected element type!" );
pSeq = 0;
break;
}
@@ -1014,3 +1015,5 @@ void SAL_CALL uno_type_sequence_assign(
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */