diff options
Diffstat (limited to 'cppu/source')
41 files changed, 255 insertions, 136 deletions
diff --git a/cppu/source/AffineBridge/AffineBridge.cxx b/cppu/source/AffineBridge/AffineBridge.cxx index 59f8213274a6..89647322ad6d 100644 --- a/cppu/source/AffineBridge/AffineBridge.cxx +++ b/cppu/source/AffineBridge/AffineBridge.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. @@ -362,3 +363,4 @@ extern "C" void SAL_DLLPUBLIC_EXPORT SAL_CALL uno_ext_getMapping(uno_Mapping cppu::helper::purpenv::createMapping(ppMapping, pFrom, pTo); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/LogBridge/LogBridge.cxx b/cppu/source/LogBridge/LogBridge.cxx index b57cd405c82b..8eb69cc23e4e 100755..100644 --- a/cppu/source/LogBridge/LogBridge.cxx +++ b/cppu/source/LogBridge/LogBridge.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. @@ -38,7 +39,7 @@ #include "rtl/logfile.hxx" #include "uno/environment.hxx" #include <com/sun/star/uno/Type.hxx> -#include <hash_map> +#include <boost/unordered_map.hpp> #include <memory> namespace @@ -246,7 +247,7 @@ void LogProbe( rtl_logfile_longTrace( "} LogBridge () %s",sTemp.getStr()); if ( ppException && *ppException ) { - rtl_logfile_trace( " excption occured : "); + rtl_logfile_trace( " excption occurred : "); typelib_TypeDescription * pElementTypeDescr = 0; TYPELIB_DANGER_GET( &pElementTypeDescr, (*ppException)->pType ); const ::rtl::OString sValue( ::rtl::OUStringToOString(pElementTypeDescr->pTypeName,osl_getThreadTextEncoding())); @@ -275,3 +276,5 @@ extern "C" void SAL_DLLPUBLIC_EXPORT SAL_CALL uno_ext_getMapping(uno_Mapping { cppu::helper::purpenv::createMapping(ppMapping, pFrom, pTo,LogProbe); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/UnsafeBridge/UnsafeBridge.cxx b/cppu/source/UnsafeBridge/UnsafeBridge.cxx index 5a531de47182..17ecb4646918 100644 --- a/cppu/source/UnsafeBridge/UnsafeBridge.cxx +++ b/cppu/source/UnsafeBridge/UnsafeBridge.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. @@ -161,3 +162,4 @@ extern "C" void SAL_DLLPUBLIC_EXPORT SAL_CALL uno_ext_getMapping(uno_Mapping cppu::helper::purpenv::createMapping(ppMapping, pFrom, pTo); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/cppu/cppu_opt.cxx b/cppu/source/cppu/cppu_opt.cxx index a4640fd6f945..6512bd567d71 100644 --- a/cppu/source/cppu/cppu_opt.cxx +++ b/cppu/source/cppu/cppu_opt.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. @@ -79,3 +80,5 @@ extern "C" rtl_uString * SAL_CALL cppu_Any_extraction_failure_msg( rtl_uString_acquire( ret.pData ); return ret.pData; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/helper/purpenv/Proxy.hxx b/cppu/source/helper/purpenv/Proxy.hxx index 570d7291b177..9db0182c2edc 100644 --- a/cppu/source/helper/purpenv/Proxy.hxx +++ b/cppu/source/helper/purpenv/Proxy.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. @@ -87,3 +88,5 @@ public: extern "C" SAL_DLLPRIVATE void SAL_CALL Proxy_free(uno_ExtEnvironment * pEnv, void * pProxy) SAL_THROW_EXTERN_C(); #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/helper/purpenv/export.mk b/cppu/source/helper/purpenv/export.mk index 7e5e9d04d1d2..004787e4f45c 100644 --- a/cppu/source/helper/purpenv/export.mk +++ b/cppu/source/helper/purpenv/export.mk @@ -4,10 +4,6 @@ NAMEpurpenv_helper := uno_purpenvhelper$(COMID) purpenv_helper_LIB := -l$(NAMEpurpenv_helper) -.ELIF "$(GUI)"=="OS2" -NAMEpurpenv_helper := purpeh$(UDK_MAJOR) -purpenv_helper_LIB := i$(NAMEpurpenv_helper) - .ELSE NAMEpurpenv_helper := purpenvhelper$(UDK_MAJOR)$(COMID) .IF "$(COM)"=="GCC" diff --git a/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx b/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx index 0fbed6739951..52e77785f1ea 100644 --- a/cppu/source/helper/purpenv/helper_purpenv_Environment.cxx +++ b/cppu/source/helper/purpenv/helper_purpenv_Environment.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. @@ -535,3 +536,5 @@ void Environment_initWithEnterable(uno_Environment * pEnvironment, cppu::Enterab } }}} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx b/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx index 0b4b3c9e0786..9c87f82cf470 100644 --- a/cppu/source/helper/purpenv/helper_purpenv_Mapping.cxx +++ b/cppu/source/helper/purpenv/helper_purpenv_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. @@ -231,3 +232,5 @@ void createMapping(uno_Mapping ** ppMapping, } }}} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx b/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx index 344203e38762..1240df313f57 100644 --- a/cppu/source/helper/purpenv/helper_purpenv_Proxy.cxx +++ b/cppu/source/helper/purpenv/helper_purpenv_Proxy.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. @@ -171,7 +172,7 @@ extern "C" { static void SAL_CALL s_Proxy_dispatch( break; } default: - OSL_ENSURE( sal_False, "### illegal member typeclass!" ); + OSL_FAIL( "### illegal member typeclass!" ); abort(); } @@ -492,7 +493,7 @@ void Proxy::dispatch(typelib_TypeDescriptionReference * pReturnTypeRef, *ppException = 0; } - else // exception occured + else // exception occurred { for (sal_Int32 nPos = 0; nPos < nParams; ++ nPos) { @@ -528,3 +529,4 @@ void Proxy::dispatch(typelib_TypeDescriptionReference * pReturnTypeRef, ppException); } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/current.cxx b/cppu/source/threadpool/current.cxx index 23bd52ca1917..2ffabcbff014 100644 --- a/cppu/source/threadpool/current.cxx +++ b/cppu/source/threadpool/current.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. @@ -295,3 +296,5 @@ extern "C" sal_Bool SAL_CALL uno_getCurrentContext( return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/current.hxx b/cppu/source/threadpool/current.hxx index fbe0531cf178..45640220116d 100644 --- a/cppu/source/threadpool/current.hxx +++ b/cppu/source/threadpool/current.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. @@ -46,3 +47,5 @@ struct IdContainer IdContainer * getIdContainer() SAL_THROW( () ); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/jobqueue.cxx b/cppu/source/threadpool/jobqueue.cxx index 333a350c0b23..9f629e43a457 100644 --- a/cppu/source/threadpool/jobqueue.cxx +++ b/cppu/source/threadpool/jobqueue.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. @@ -187,10 +188,12 @@ namespace cppu_threadpool { return m_lstCallstack.empty(); } - sal_Bool JobQueue::isBusy() + sal_Bool JobQueue::isBusy() const { return m_nToDo > 0; } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/jobqueue.hxx b/cppu/source/threadpool/jobqueue.hxx index 78202573403e..6bddcc73483f 100644 --- a/cppu/source/threadpool/jobqueue.hxx +++ b/cppu/source/threadpool/jobqueue.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. @@ -69,7 +70,7 @@ namespace cppu_threadpool sal_Bool isEmpty(); sal_Bool isCallstackEmpty(); - sal_Bool isBusy(); + sal_Bool isBusy() const; private: ::osl::Mutex m_mutex; @@ -83,3 +84,5 @@ namespace cppu_threadpool } #endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/thread.cxx b/cppu/source/threadpool/thread.cxx index 00c91500d1e5..c6035f0754c7 100644 --- a/cppu/source/threadpool/thread.cxx +++ b/cppu/source/threadpool/thread.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. @@ -217,3 +218,5 @@ namespace cppu_threadpool { } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/thread.hxx b/cppu/source/threadpool/thread.hxx index 2f7791daf7e5..bbef51eabca4 100644 --- a/cppu/source/threadpool/thread.hxx +++ b/cppu/source/threadpool/thread.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. @@ -89,3 +90,4 @@ namespace cppu_threadpool { #endif +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/threadident.cxx b/cppu/source/threadpool/threadident.cxx index 0fb6c1196185..50fef43f57b4 100644 --- a/cppu/source/threadpool/threadident.cxx +++ b/cppu/source/threadpool/threadident.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. @@ -133,3 +134,5 @@ extern "C" sal_Bool SAL_CALL uno_bindIdToCurrentThread( sal_Sequence *pThreadId } return sal_True; } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx index b7df159a80b9..b21d0b758bc5 100644 --- a/cppu/source/threadpool/threadpool.cxx +++ b/cppu/source/threadpool/threadpool.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. @@ -27,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_cppu.hxx" -#include <hash_set> +#include <boost/unordered_map.hpp> #include <stdio.h> #include <osl/diagnose.h> @@ -118,7 +119,7 @@ namespace cppu_threadpool ThreadPool::ThreadPool() { - m_DisposedCallerAdmin = DisposedCallerAdmin::getInstance(); + m_DisposedCallerAdmin = DisposedCallerAdmin::getInstance(); } ThreadPool::~ThreadPool() @@ -302,7 +303,7 @@ namespace cppu_threadpool if( ii == m_mapQueue.end() ) { - m_mapQueue[ aThreadId ] = pair < JobQueue * , JobQueue * > ( 0 , 0 ); + m_mapQueue[ aThreadId ] = pair < JobQueue * , JobQueue * > ( (JobQueue *)0 , (JobQueue*)0 ); ii = m_mapQueue.find( aThreadId ); OSL_ASSERT( ii != m_mapQueue.end() ); } @@ -348,7 +349,7 @@ namespace cppu_threadpool if( ii == m_mapQueue.end() ) { JobQueue *p = new JobQueue(); - m_mapQueue[ aThreadId ] = pair< JobQueue * , JobQueue * > ( p , 0 ); + m_mapQueue[ aThreadId ] = pair< JobQueue * , JobQueue * > ( p , (JobQueue*)0 ); } else if( 0 == (*ii).second.first ) { @@ -404,7 +405,7 @@ struct uno_ThreadPool_Hash -typedef ::std::hash_map< uno_ThreadPool, ThreadPoolHolder, uno_ThreadPool_Hash, uno_ThreadPool_Equal > ThreadpoolHashSet; +typedef ::boost::unordered_map< uno_ThreadPool, ThreadPoolHolder, uno_ThreadPool_Hash, uno_ThreadPool_Equal > ThreadpoolHashSet; static ThreadpoolHashSet *g_pThreadpoolHashSet; @@ -504,3 +505,5 @@ uno_threadpool_destroy( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C() } } } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/threadpool/threadpool.hxx b/cppu/source/threadpool/threadpool.hxx index e1c9a127fa55..273798c81f8a 100644 --- a/cppu/source/threadpool/threadpool.hxx +++ b/cppu/source/threadpool/threadpool.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. @@ -24,7 +25,7 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include <hash_map> +#include <boost/unordered_map.hpp> #include <osl/conditn.h> @@ -59,7 +60,7 @@ namespace cppu_threadpool { } }; - typedef ::std::hash_map + typedef ::boost::unordered_map < ByteSequence, // ThreadID ::std::pair < JobQueue * , JobQueue * >, @@ -138,3 +139,5 @@ namespace cppu_threadpool { }; } // end namespace cppu_threadpool + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/typelib/static_types.cxx b/cppu/source/typelib/static_types.cxx index 605bc5aadbdc..bc2f67c2fefb 100644 --- a/cppu/source/typelib/static_types.cxx +++ b/cppu/source/typelib/static_types.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. @@ -42,7 +43,9 @@ using namespace osl; -using namespace rtl; + +using ::rtl::OUString; +using ::rtl::OUStringBuffer; extern "C" { @@ -67,8 +70,6 @@ void SAL_CALL typelib_typedescriptionreference_getByName( #ifdef SAL_W32 #pragma pack(push, 8) -#elif defined(SAL_OS2) -#pragma pack(8) #endif /** @@ -79,14 +80,19 @@ void SAL_CALL typelib_typedescriptionreference_getByName( */ struct AlignSize_Impl { - sal_Int16 nInt16; - double dDouble; + sal_Int16 nInt16; +#ifdef AIX + //double: doubleword aligned if -qalign=natural/-malign=natural + //which isn't the default ABI. Otherwise word aligned, While a long long int + //is always doubleword aligned, so use that instead. + sal_Int64 dDouble; +#else + double dDouble; +#endif }; #ifdef SAL_W32 #pragma pack(pop) -#elif defined(SAL_OS2) -#pragma pack() #endif // the value of the maximal alignment @@ -647,3 +653,5 @@ void SAL_CALL typelib_static_array_type_init( } // extern "C" } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index 935a64397505..672502cec457 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.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. @@ -28,7 +29,11 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_cppu.hxx" -#include <hash_map> +#if OSL_DEBUG_LEVEL > 1 +#include <stdio.h> +#endif + +#include <boost/unordered_map.hpp> #include <list> #include <set> #include <vector> @@ -48,17 +53,15 @@ #include <typelib/typedescription.h> #include <uno/any2.h> -using namespace rtl; using namespace std; using namespace osl; +using ::rtl::OUString; +using ::rtl::OUStringBuffer; +using ::rtl::OString; -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ #ifdef SAL_W32 #pragma pack(push, 8) -#elif defined(SAL_OS2) -#pragma pack(8) #endif /** @@ -69,14 +72,19 @@ using namespace osl; */ struct AlignSize_Impl { - sal_Int16 nInt16; - double dDouble; + sal_Int16 nInt16; +#ifdef AIX + //double: doubleword aligned if -qalign=natural/-malign=natural + //which isn't the default ABI. Otherwise word aligned, While a long long int + //is always doubleword aligned, so use that instead. + sal_Int64 dDouble; +#else + double dDouble; +#endif }; #ifdef SAL_W32 #pragma pack(pop) -#elif defined(SAL_OS2) -#pragma pack() #endif // the value of the maximal alignment @@ -183,7 +191,7 @@ struct hashStr_Impl //----------------------------------------------------------------------------- // Heavy hack, the const sal_Unicode * is hold by the typedescription reference -typedef hash_map< const sal_Unicode *, typelib_TypeDescriptionReference *, +typedef boost::unordered_map< const sal_Unicode *, typelib_TypeDescriptionReference *, hashStr_Impl, equalStr_Impl > WeakMap_Impl; typedef pair< void *, typelib_typedescription_Callback > CallbackEntry; @@ -273,7 +281,7 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() SAL_THROW( () ) while( aIt != pCache->end() ) { typelib_typedescription_release( (*aIt) ); - aIt++; + ++aIt; } delete pCache; pCache = 0; @@ -330,6 +338,21 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() SAL_THROW( () ) delete pWeakMap; pWeakMap = 0; } +#if OSL_DEBUG_LEVEL > 1 + OSL_ENSURE( !nTypeDescriptionCount ); + OSL_ENSURE( !nCompoundTypeDescriptionCount ); + OSL_ENSURE( !nUnionTypeDescriptionCount ); + OSL_ENSURE( !nIndirectTypeDescriptionCount ); + OSL_ENSURE( !nArrayTypeDescriptionCount ); + OSL_ENSURE( !nEnumTypeDescriptionCount ); + OSL_ENSURE( !nInterfaceMethodTypeDescriptionCount ); + OSL_ENSURE( !nInterfaceAttributeTypeDescriptionCount ); + OSL_ENSURE( !nInterfaceTypeDescriptionCount ); + OSL_ENSURE( !nTypeDescriptionReferenceCount ); + + OSL_ENSURE( !pCallbacks || pCallbacks->empty() ); +#endif + delete pCallbacks; pCallbacks = 0; @@ -342,10 +365,6 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() SAL_THROW( () ) namespace { struct Init : public rtl::Static< TypeDescriptor_Init_Impl, Init > {}; } -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ extern "C" void SAL_CALL typelib_typedescription_registerCallback( void * pContext, typelib_typedescription_Callback pCallback ) SAL_THROW_EXTERN_C() @@ -385,10 +404,6 @@ extern "C" void SAL_CALL typelib_typedescription_revokeCallback( } } - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ extern "C" sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize( const typelib_TypeDescription * pTypeDescription, sal_Int32 nOffset, sal_Int32 & rMaxIntegralTypeSize ) @@ -1276,7 +1291,7 @@ extern "C" void SAL_CALL typelib_typedescription_newInterfaceMethod( sal_Int32 nOffset = rtl_ustr_lastIndexOfChar_WithLength( pTypeName->buffer, pTypeName->length, ':'); if (nOffset <= 0 || pTypeName->buffer[nOffset - 1] != ':') { - OSL_ENSURE(false, "Bad interface method type name"); + OSL_FAIL("Bad interface method type name"); return; } rtl::OUString aInterfaceTypeName(pTypeName->buffer, nOffset - 1); @@ -1289,7 +1304,7 @@ extern "C" void SAL_CALL typelib_typedescription_newInterfaceMethod( || !complete( reinterpret_cast< typelib_TypeDescription ** >(&pInterface), false)) { - OSL_ENSURE(false, "No interface corresponding to interface method"); + OSL_FAIL("No interface corresponding to interface method"); return; } @@ -1369,7 +1384,7 @@ extern "C" void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute( sal_Int32 nOffset = rtl_ustr_lastIndexOfChar_WithLength( pTypeName->buffer, pTypeName->length, ':'); if (nOffset <= 0 || pTypeName->buffer[nOffset - 1] != ':') { - OSL_ENSURE(false, "Bad interface attribute type name"); + OSL_FAIL("Bad interface attribute type name"); return; } rtl::OUString aInterfaceTypeName(pTypeName->buffer, nOffset - 1); @@ -1382,7 +1397,7 @@ extern "C" void SAL_CALL typelib_typedescription_newExtendedInterfaceAttribute( || !complete( reinterpret_cast< typelib_TypeDescription ** >(&pInterface), false)) { - OSL_ENSURE(false, "No interface corresponding to interface attribute"); + OSL_FAIL("No interface corresponding to interface attribute"); return; } @@ -1927,7 +1942,13 @@ extern "C" sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize( nSize = rMaxIntegralTypeSize = (sal_Int32)(sizeof( float )); break; case typelib_TypeClass_DOUBLE: +#ifdef AIX + //See previous AIX ifdef comment for an explanation + nSize = (sal_Int32)(sizeof(double)); + rMaxIntegralTypeSize = (sal_Int32)(sizeof(void*)); +#else nSize = rMaxIntegralTypeSize = (sal_Int32)(sizeof( double )); +#endif break; case typelib_TypeClass_BYTE: nSize = rMaxIntegralTypeSize = (sal_Int32)(sizeof( sal_Int8 )); @@ -1948,7 +1969,7 @@ extern "C" sal_Int32 SAL_CALL typelib_typedescription_getAlignedUnoSize( case typelib_TypeClass_SERVICE: case typelib_TypeClass_MODULE: default: - OSL_ENSURE( sal_False, "not convertable type" ); + OSL_FAIL( "not convertable type" ); }; } @@ -2174,7 +2195,7 @@ extern "C" void SAL_CALL typelib_typedescription_getByName( { // Check for derived interface member type: sal_Int32 i1 = name.lastIndexOf( - rtl::OUString::createFromAscii(":@")); + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(":@"))); if (i1 >= 0) { sal_Int32 i2 = i1 + RTL_CONSTASCII_LENGTH(":@"); sal_Int32 i3 = name.indexOf(',', i2); @@ -2254,10 +2275,6 @@ extern "C" void SAL_CALL typelib_typedescription_getByName( } } - -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ -//------------------------------------------------------------------------ extern "C" void SAL_CALL typelib_typedescriptionreference_newByAsciiName( typelib_TypeDescriptionReference ** ppTDR, typelib_TypeClass eTypeClass, @@ -2644,3 +2661,5 @@ extern "C" sal_Bool SAL_CALL typelib_typedescription_complete( { return complete(ppTypeDescr, true); } + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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: */ |