diff options
Diffstat (limited to 'bridges/source')
164 files changed, 2096 insertions, 2096 deletions
diff --git a/bridges/source/cpp_uno/cc50_solaris_intel/cc50_solaris_intel.hxx b/bridges/source/cpp_uno/cc50_solaris_intel/cc50_solaris_intel.hxx index 8e938e2c8105..479d39ec6841 100644 --- a/bridges/source/cpp_uno/cc50_solaris_intel/cc50_solaris_intel.hxx +++ b/bridges/source/cpp_uno/cc50_solaris_intel/cc50_solaris_intel.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,10 +39,10 @@ namespace __Crun struct static_type_info { std::ptrdiff_t m_pClassName; - int m_nSkip1; // must be 0 - void* m_pMagic; // points to some magic data - int m_nMagic[ 4 ]; - int m_nSkip2[2]; // must be 0 + int m_nSkip1; // must be 0 + void* m_pMagic; // points to some magic data + int m_nMagic[ 4 ]; + int m_nSkip2[2]; // must be 0 }; void* ex_alloc(unsigned); void ex_throw( void*, const static_type_info*, void(*)(void*)); diff --git a/bridges/source/cpp_uno/cc50_solaris_intel/cpp2uno.cxx b/bridges/source/cpp_uno/cc50_solaris_intel/cpp2uno.cxx index 0737475c995a..fcd3509050fb 100644 --- a/bridges/source/cpp_uno/cc50_solaris_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_intel/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -66,7 +66,7 @@ void cpp2uno_call( void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -95,9 +95,9 @@ void cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -151,7 +151,7 @@ void cpp2uno_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; @@ -159,7 +159,7 @@ void cpp2uno_call( // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case no exception occured... if (pUnoExc) { @@ -167,14 +167,14 @@ void cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::cc50_solaris_intel_raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any @@ -186,7 +186,7 @@ void cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -198,7 +198,7 @@ void cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -218,7 +218,7 @@ void cpp2uno_call( { TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); } - } + } } @@ -228,7 +228,7 @@ extern "C" void cpp_vtable_call( sal_Int64 nRegReturn ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); - + // pCallStack: ret adr, [ret *], this, params void * pThis; if( nFunctionIndex & 0x80000000 ) @@ -253,7 +253,7 @@ extern "C" void cpp_vtable_call( { throw RuntimeException( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); @@ -279,9 +279,9 @@ extern "C" void cpp_vtable_call( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -313,7 +313,7 @@ extern "C" void cpp_vtable_call( pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( diff --git a/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx b/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx index e0776c19476c..e0bb02db0257 100644 --- a/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_intel/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc50_solaris_intel/hash.cxx b/bridges/source/cpp_uno/cc50_solaris_intel/hash.cxx index c1c2c2dc8eb6..dfa9b7227195 100644 --- a/bridges/source/cpp_uno/cc50_solaris_intel/hash.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_intel/hash.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,7 +39,7 @@ typedef unsigned int sal_uInt32; #include <string.h> /* - * build a hash for a character buffer using the NIST algorithm + * build a hash for a character buffer using the NIST algorithm */ class NIST_Hash @@ -50,12 +50,12 @@ class NIST_Hash { return z ^ ( x & ( y ^ z ) ); } - + sal_uInt32 f2( sal_uInt32 x, sal_uInt32 y, sal_uInt32 z ) { return x ^ y ^ z; } - + sal_uInt32 f3( sal_uInt32 x, sal_uInt32 y, sal_uInt32 z ) { return ( x & y ) + ( z & ( x ^ y ) ); @@ -98,17 +98,17 @@ class NIST_Hash sal_uInt32 hashdata[5]; public: NIST_Hash( const char* pString, sal_uInt32 nLen ); - + sal_uInt32 *getHash() { return hashdata; } }; void NIST_Hash::transform() { // constants - const sal_uInt32 K2 = 0x5A827999; - const sal_uInt32 K3 = 0x6ED9EBA1; - const sal_uInt32 K5 = 0x8F1BBCDC; - const sal_uInt32 K10 = 0xCA62C1D6; + const sal_uInt32 K2 = 0x5A827999; + const sal_uInt32 K3 = 0x6ED9EBA1; + const sal_uInt32 K5 = 0x8F1BBCDC; + const sal_uInt32 K10 = 0xCA62C1D6; sal_uInt32 a, b, c, d, e; a = hashdata[0]; @@ -210,7 +210,7 @@ void NIST_Hash::transform() #define BLOCKSIZE sizeof( data ) -NIST_Hash::NIST_Hash( const char* pString, sal_uInt32 nLen ) +NIST_Hash::NIST_Hash( const char* pString, sal_uInt32 nLen ) { hashdata[0] = 0x67452301; hashdata[1] = 0xefcdab89; diff --git a/bridges/source/cpp_uno/cc50_solaris_intel/uno2cpp.cxx b/bridges/source/cpp_uno/cc50_solaris_intel/uno2cpp.cxx index 7242ccd31ee6..705cad8a33ef 100644 --- a/bridges/source/cpp_uno/cc50_solaris_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_intel/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -70,16 +70,16 @@ static inline void cpp_call( // max space for: [complex ret ptr], values|ptr ... char * pCppStack = (char *)alloca( ((nParams+3) * sizeof(sal_Int64)) ); char * pCppStackStart = pCppStack; - + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + void * pReturnSpace = 0; - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -102,7 +102,7 @@ static inline void cpp_call( + aVtableSlot.offset; *(void**)pCppStack = pAdjustedThisPtr; pCppStack += sizeof( void* ); - + const int nMaxParams = 32; // args void * args_buffer[3 * nMaxParams]; @@ -117,20 +117,20 @@ static inline void cpp_call( const int nTempBufferSize = 256; sal_Int32 nTempBufferPos = 0; long params_buffer[nTempBufferSize]; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { pCppArgs[ nPos ] = pCppStack; uno_copyAndConvertData( pCppArgs[nPos], pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -212,10 +212,10 @@ static inline void cpp_call( (sal_Int32 *)pCppStackStart, nStackLongs ); - + // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { @@ -223,7 +223,7 @@ static inline void cpp_call( sal_Bool bAllocated = (nIndex & 0x80000000) != 0; nIndex &= 0x7fffffff; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -263,7 +263,7 @@ static inline void cpp_call( const char* pName = __Cimpl::ex_name(); // get exception - CPPU_CURRENT_NAMESPACE::cc50_solaris_intel_fillUnoException( + CPPU_CURRENT_NAMESPACE::cc50_solaris_intel_fillUnoException( pExc, pName, *ppUnoExc, pThis->getBridge()->getCpp2Uno()); @@ -285,7 +285,7 @@ static inline void cpp_call( if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); } - + if (pCppArgs != (void **)args_buffer) rtl_freeMemory( pCppArgs ); if (pReturnSpace) @@ -304,7 +304,7 @@ void unoInterfaceProxyDispatch( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -329,14 +329,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -344,10 +344,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -378,7 +378,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -408,7 +408,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/cc50_solaris_sparc.hxx b/bridges/source/cpp_uno/cc50_solaris_sparc/cc50_solaris_sparc.hxx index 06667e4a366c..a00d2ac7cc8b 100644 --- a/bridges/source/cpp_uno/cc50_solaris_sparc/cc50_solaris_sparc.hxx +++ b/bridges/source/cpp_uno/cc50_solaris_sparc/cc50_solaris_sparc.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -39,10 +39,10 @@ namespace __Crun struct static_type_info { std::ptrdiff_t m_pClassName; - int m_nSkip1; // must be 0 - void* m_pMagic; // points to some magic data - int m_nMagic[ 4 ]; - int m_nSkip2[2]; // must be 0 + int m_nSkip1; // must be 0 + void* m_pMagic; // points to some magic data + int m_nMagic[ 4 ]; + int m_nSkip2[2]; // must be 0 }; void* ex_alloc(unsigned); void ex_throw( void*, const static_type_info*, void(*)(void*)); diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx b/bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx index bfe55d726b3c..f13bcfbe214c 100644 --- a/bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_sparc/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -260,13 +260,13 @@ static typelib_TypeClass cpp_mediate( OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); -// if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) -// { -// RuntimeException aExc; -// aExc.Message = OUString::createFromAscii("illegal vtable index!"); -// aExc.Context = (XInterface *)pThis; -// throw aExc; -// } +// if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) +// { +// RuntimeException aExc; +// aExc.Message = OUString::createFromAscii("illegal vtable index!"); +// aExc.Context = (XInterface *)pThis; +// throw aExc; +// } // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; @@ -294,8 +294,8 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; eRet = cpp2uno_call( pCppI, aMemberDescr.get(), @@ -356,15 +356,15 @@ static typelib_TypeClass cpp_mediate( } break; } -// default: -// { -// RuntimeException aExc; -// aExc.Message = OUString::createFromAscii("no member description found!"); -// aExc.Context = (XInterface *)pThis; -// throw aExc; -// // is here for dummy -// eRet = typelib_TypeClass_VOID; -// } +// default: +// { +// RuntimeException aExc; +// aExc.Message = OUString::createFromAscii("no member description found!"); +// aExc.Context = (XInterface *)pThis; +// throw aExc; +// // is here for dummy +// eRet = typelib_TypeClass_VOID; +// } } return eRet; diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx b/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx index aa2bbde76708..2c003cc4ba5b 100644 --- a/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_sparc/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/flushcode.hxx b/bridges/source/cpp_uno/cc50_solaris_sparc/flushcode.hxx index 5d89d81efed8..4a3bbc9319b5 100644 --- a/bridges/source/cpp_uno/cc50_solaris_sparc/flushcode.hxx +++ b/bridges/source/cpp_uno/cc50_solaris_sparc/flushcode.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/hash.cxx b/bridges/source/cpp_uno/cc50_solaris_sparc/hash.cxx index 29064c19a28f..d2d94bb24b96 100644 --- a/bridges/source/cpp_uno/cc50_solaris_sparc/hash.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_sparc/hash.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -40,7 +40,7 @@ typedef unsigned int sal_uInt32; #include <string.h> /* - * build a hash for a character buffer using the NIST algorithm + * build a hash for a character buffer using the NIST algorithm */ class NIST_Hash @@ -51,12 +51,12 @@ class NIST_Hash { return z ^ ( x & ( y ^ z ) ); } - + sal_uInt32 f2( sal_uInt32 x, sal_uInt32 y, sal_uInt32 z ) { return x ^ y ^ z; } - + sal_uInt32 f3( sal_uInt32 x, sal_uInt32 y, sal_uInt32 z ) { return ( x & y ) + ( z & ( x ^ y ) ); @@ -99,17 +99,17 @@ class NIST_Hash sal_uInt32 hashdata[5]; public: NIST_Hash( const char* pString, sal_uInt32 nLen ); - + sal_uInt32 *getHash() { return hashdata; } }; void NIST_Hash::transform() { // constants - const sal_uInt32 K2 = 0x5A827999; - const sal_uInt32 K3 = 0x6ED9EBA1; - const sal_uInt32 K5 = 0x8F1BBCDC; - const sal_uInt32 K10 = 0xCA62C1D6; + const sal_uInt32 K2 = 0x5A827999; + const sal_uInt32 K3 = 0x6ED9EBA1; + const sal_uInt32 K5 = 0x8F1BBCDC; + const sal_uInt32 K10 = 0xCA62C1D6; sal_uInt32 a, b, c, d, e; a = hashdata[0]; @@ -211,7 +211,7 @@ void NIST_Hash::transform() #define BLOCKSIZE sizeof( data ) -NIST_Hash::NIST_Hash( const char* pString, sal_uInt32 nLen ) +NIST_Hash::NIST_Hash( const char* pString, sal_uInt32 nLen ) { hashdata[0] = 0x67452301; hashdata[1] = 0xefcdab89; diff --git a/bridges/source/cpp_uno/cc50_solaris_sparc/uno2cpp.cxx b/bridges/source/cpp_uno/cc50_solaris_sparc/uno2cpp.cxx index 7b85bc1fee91..2d040352ff5d 100644 --- a/bridges/source/cpp_uno/cc50_solaris_sparc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/cc50_solaris_sparc/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -69,8 +69,8 @@ static void cpp_call( OSL_ENSURE( pThis, "### no interface given!" ); // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = (char *)alloca( ((nParams+3) * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; + char * pCppStack = (char *)alloca( ((nParams+3) * sizeof(sal_Int64)) ); + char * pCppStackStart = pCppStack; // return typelib_TypeDescription * pReturnTypeDescr = 0; @@ -173,20 +173,20 @@ static void cpp_call( // seems that EH registration for callVirtualMethod is not really // necessary -// static unsigned long* pFrameInfo = NULL; - -// if( ! pFrameInfo ) -// { -// pFrameInfo = new unsigned long[ 7 ]; -// pFrameInfo[ 0 ] = 0x40000000 | (((unsigned long)__Crun::ex_rethrow_q) >> 2); -// pFrameInfo[ 1 ] = 0x01000000; -// pFrameInfo[ 2 ] = (unsigned long)callVirtualMethodExceptionHandler; -// pFrameInfo[ 3 ] = 0; -// pFrameInfo[ 4 ] = (unsigned long)pFrameInfo - (unsigned long)callVirtualMethodExceptionHandler; -// pFrameInfo[ 5 ] = 0; -// pFrameInfo[ 6 ] = 0; -// _ex_register( pFrameInfo+2, 1 ); -// } +// static unsigned long* pFrameInfo = NULL; + +// if( ! pFrameInfo ) +// { +// pFrameInfo = new unsigned long[ 7 ]; +// pFrameInfo[ 0 ] = 0x40000000 | (((unsigned long)__Crun::ex_rethrow_q) >> 2); +// pFrameInfo[ 1 ] = 0x01000000; +// pFrameInfo[ 2 ] = (unsigned long)callVirtualMethodExceptionHandler; +// pFrameInfo[ 3 ] = 0; +// pFrameInfo[ 4 ] = (unsigned long)pFrameInfo - (unsigned long)callVirtualMethodExceptionHandler; +// pFrameInfo[ 5 ] = 0; +// pFrameInfo[ 6 ] = 0; +// _ex_register( pFrameInfo+2, 1 ); +// } try { @@ -250,7 +250,7 @@ static void cpp_call( const char* pName = __Cimpl::ex_name(); // get exception - CPPU_CURRENT_NAMESPACE::cc50_solaris_sparc_fillUnoException( + CPPU_CURRENT_NAMESPACE::cc50_solaris_sparc_fillUnoException( pExc, pName, *ppUnoExc, pThis->getBridge()->getCpp2Uno()); // temporary params @@ -307,8 +307,8 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/callvirtualmethod.hxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/callvirtualmethod.hxx index 16f6c1090ff2..f58a9bd616cb 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/callvirtualmethod.hxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/callvirtualmethod.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/cpp2uno.cxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/cpp2uno.cxx index c49330b2223f..0d0d4e05707e 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.cxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.cxx index bf6b1512a41d..5e694c09de46 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.cxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.hxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.hxx index 8ba17dad842f..ee5672e05cd1 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.hxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/exceptions.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/flushcode.hxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/flushcode.hxx index de7028d3faa2..f78a66c93a8c 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/flushcode.hxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/flushcode.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/fp.hxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/fp.hxx index ba32b141d338..b22804e062b2 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/fp.hxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/fp.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/isdirectreturntype.cxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/isdirectreturntype.cxx index 9b004078c35f..1a2f5f6bddf7 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/isdirectreturntype.cxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/isdirectreturntype.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/isdirectreturntype.hxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/isdirectreturntype.hxx index f9741a8898a5..b1bc3d64a489 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/isdirectreturntype.hxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/isdirectreturntype.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx index e6646dca42a1..76959161bf2f 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/cc5_solaris_sparc64/vtableslotcall.hxx b/bridges/source/cpp_uno/cc5_solaris_sparc64/vtableslotcall.hxx index c63f674c1549..6c699bb5a91e 100644 --- a/bridges/source/cpp_uno/cc5_solaris_sparc64/vtableslotcall.hxx +++ b/bridges/source/cpp_uno/cc5_solaris_sparc64/vtableslotcall.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx index 3ee825511d66..6cb1deedbaa7 100644 --- a/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,7 +48,7 @@ using namespace ::com::sun::star::uno; -namespace +namespace { static typelib_TypeClass cpp2uno_call( bridges::cpp_uno::shared::CppInterfaceProxy * pThis, @@ -62,7 +62,7 @@ static typelib_TypeClass cpp2uno_call( fprintf(stderr, "as far as cpp2uno_call\n"); #endif int nregs = 0; //number of words passed in registers - + // gpreg: [ret *], this, [gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -71,10 +71,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -87,14 +87,14 @@ static typelib_TypeClass cpp2uno_call( gpreg++; fpreg++; nregs++; - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn); // direct way } } // pop this - gpreg++; + gpreg++; fpreg++; nregs++; @@ -107,7 +107,7 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { @@ -223,7 +223,7 @@ static typelib_TypeClass cpp2uno_call( void *pCppStack; //temporary stack pointer if (nregs < axp::MAX_WORDS_IN_REGS) - { + { pCppArgs[nPos] = pCppStack = *gpreg; gpreg++; fpreg++; @@ -265,14 +265,14 @@ static typelib_TypeClass cpp2uno_call( #ifdef CMC_DEBUG fprintf(stderr, "end of params\n"); #endif - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -280,14 +280,14 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -299,7 +299,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -309,7 +309,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -366,7 +366,7 @@ static typelib_TypeClass cpp_mediate( } #endif - + // gpreg: [ret *], this, [other gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -384,14 +384,14 @@ static typelib_TypeClass cpp_mediate( } pThis = static_cast< char * >(pThis) - nVtableOffset; - + bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -399,14 +399,14 @@ static typelib_TypeClass cpp_mediate( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pCppI ); } - + // determine called method OSL_ENSURE( nVtableCall < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + typelib_TypeClass eRet; switch (aMemberDescr.get()->eTypeClass) { @@ -429,7 +429,7 @@ static typelib_TypeClass cpp_mediate( ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; aParam.bIn = sal_True; aParam.bOut = sal_False; - + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -460,9 +460,9 @@ static typelib_TypeClass cpp_mediate( XInterface * pInterface = 0; (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), - (void **)&pInterface, pCppI->getOid().pData, + (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -529,8 +529,8 @@ long cpp_vtable_call(long r16, long r17, long r18, long r19, long r20, long r21, fprintf(stderr, "non-doubles are %x %x %x %x %x %x\n", gpreg[0], gpreg[1], gpreg[2], gpreg[3], gpreg[4], gpreg[5]); fprintf(stderr, "doubles are %f %f %f %f %f %f\n", fpreg[0], fpreg[1], fpreg[2], fpreg[3], fpreg[4], fpreg[5]); #endif - typelib_TypeClass aType = - cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, (void**)sp, + typelib_TypeClass aType = + cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, (void**)sp, (sal_Int64*)nRegReturn ); #ifdef CMC_DEBUG fprintf(stderr, "after mediate ret is %lx %ld\n", nRegReturn[0], nRegReturn[0]); diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx index c0de95532515..ea6961092f1a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx b/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx index d76cbf748db3..ba9db0598b73 100644 --- a/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,25 +49,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx index dddda8ab8207..02801f75606c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -203,7 +203,7 @@ void callVirtualMethod( } -//============================================================================ +//============================================================================ static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -218,12 +218,12 @@ static void cpp_call( sal_uInt64 pGPR[axp::MAX_GPR_REGS]; double pFPR[axp::MAX_SSE_REGS]; sal_uInt32 nRegs = 0; - + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion if (pReturnTypeDescr) @@ -254,15 +254,15 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, @@ -319,7 +319,7 @@ static void cpp_call( uno_copyAndConvertData( pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -333,7 +333,7 @@ static void cpp_call( INSERT_INT64( &(pCppArgs[nPos]), nRegs, pGPR, pStack ); } } - + try { callVirtualMethod( @@ -344,13 +344,13 @@ static void cpp_call( pFPR, nRegs ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -367,7 +367,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -381,10 +381,10 @@ static void cpp_call( catch (...) { // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -409,12 +409,12 @@ void unoInterfaceProxyDispatch( #ifdef CMC_DEBUG fprintf(stderr, "unoInterfaceProxyDispatch\n"); #endif - + // is my surrogate - bridges::cpp_uno::shared::UnoInterfaceProxy * pThis + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -448,7 +448,7 @@ void unoInterfaceProxyDispatch( OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; //get then set method cpp_call( @@ -456,10 +456,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -491,7 +491,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -521,7 +521,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx index da4f0e34ce3c..e71398220522 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ namespace static typelib_TypeClass cpp2uno_call( bridges::cpp_uno::shared::CppInterfaceProxy* pThis, const typelib_TypeDescription * pMemberTypeDescr, - typelib_TypeDescriptionReference * pReturnTypeRef, + typelib_TypeDescriptionReference * pReturnTypeRef, sal_Int32 nParams, typelib_MethodParameter * pParams, void ** pCallStack, sal_Int64 * pRegisterReturn /* space for register return */ ) @@ -70,11 +70,11 @@ namespace typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need void * pCppReturn = 0; - + if (pReturnTypeDescr) { if (!arm::return_in_hidden_param(pReturnTypeRef)) @@ -83,7 +83,7 @@ namespace { pCppReturn = *(void **)pCppStack; pCppStack += sizeof(void *); - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) @@ -103,9 +103,9 @@ namespace // cpp<=>uno) sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions - typelib_TypeDescription ** ppTempParamTypeDescr = + typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) @@ -114,8 +114,8 @@ namespace typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - if (!rParam.bOut && - bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + if (!rParam.bOut && + bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { #ifdef __ARM_EABI__ switch (pParamTypeDescr->eTypeClass) @@ -161,7 +161,7 @@ namespace else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) { - uno_copyAndConvertData( pUnoArgs[nPos] = + uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), *(void **)pCppStack, pParamTypeDescr, pThis->getBridge()->getCpp2Uno() ); @@ -178,7 +178,7 @@ namespace } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; @@ -194,16 +194,16 @@ namespace for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed - uno_destructData( pUnoArgs[nIndex], + uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - - CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, + + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -216,18 +216,18 @@ namespace sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], + uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -278,10 +278,10 @@ namespace } pThis = static_cast< char * >(pThis) - nVtableOffset; - bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = + bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); - + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, @@ -292,7 +292,7 @@ namespace OUString::createFromAscii("illegal vtable index!"), (XInterface *)pCppI ); } - + // determine called method OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); @@ -326,7 +326,7 @@ namespace ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; aParam.bIn = sal_True; aParam.bOut = sal_False; - + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -360,7 +360,7 @@ namespace pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -405,7 +405,7 @@ namespace * (called by asm snippets) */ -extern "C" sal_Int64 cpp_vtable_call( long *pFunctionAndOffset, +extern "C" sal_Int64 cpp_vtable_call( long *pFunctionAndOffset, void **pCallStack ) { sal_Int64 nRegReturn; @@ -442,7 +442,7 @@ namespace { const int codeSnippetSize = 20; - unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex, + unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex, sal_Int32 vtableOffset, bool bHasHiddenParam) { if (bHasHiddenParam) @@ -522,7 +522,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( { (s++)->fn = code + writetoexecdiff; - typelib_InterfaceMethodTypeDescription *pMethodTD = + typelib_InterfaceMethodTypeDescription *pMethodTD = reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(member); @@ -544,7 +544,7 @@ void bridges::cpp_uno::shared::VtableFactory::flushCode( { static void (*clear_cache)(unsigned char const*, unsigned char const*) = (void (*)(unsigned char const*, unsigned char const*)) - dlsym(RTLD_DEFAULT, "__clear_cache"); + dlsym(RTLD_DEFAULT, "__clear_cache"); (*clear_cache)(beg, end); } diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx index 1fc67a2098d6..84f60331d48a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx index 2b00c6c008b4..e1d24dc71ab9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,15 +42,15 @@ namespace CPPU_CURRENT_NAMESPACE // -- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h struct __cxa_exception - { + { ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; #ifdef __ARM_EABI__ __cxa_exception *nextPropagatingException; @@ -61,14 +61,14 @@ namespace CPPU_CURRENT_NAMESPACE const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; -#endif +#endif _Unwind_Exception unwindHeader; - }; + }; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); extern "C" void __cxa_throw ( - void *thrown_exception, std::type_info *tinfo, + void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); struct __cxa_eh_globals diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx index 00a06643fda5..1a2c27136d83 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,13 +43,13 @@ #include <stdio.h> #include <string.h> -/* +/* * Based on http://gcc.gnu.org/PR41443 * References to __SOFTFP__ are incorrect for EABI; the __SOFTFP__ code * should be used for *soft-float ABI* whether or not VFP is enabled, * and __SOFTFP__ does specifically mean soft-float not soft-float ABI. * - * Changing the conditionals to __SOFTFP__ || __ARM_EABI__ then + * Changing the conditionals to __SOFTFP__ || __ARM_EABI__ then * -mfloat-abi=softfp should work. -mfloat-abi=hard won't; that would * need both a new macro to identify the hard-VFP ABI. */ @@ -320,7 +320,7 @@ void callVirtualMethod( *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV ); namespace { -//======================================================================= +//======================================================================= static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -335,12 +335,12 @@ static void cpp_call( sal_uInt32 pGPR[arm::MAX_GPR_REGS]; sal_uInt32 nGPR = 0; - + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion bool bOverFlow = false; @@ -377,7 +377,7 @@ static void cpp_call( typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -389,7 +389,7 @@ static void cpp_call( // uno_copyAndConvertData( pCppArgs[nPos] = pStack, pUnoArgs[nPos], uno_copyAndConvertData( pCppArgs[nPos] = alloca(8), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -446,7 +446,7 @@ static void cpp_call( uno_copyAndConvertData( pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -466,7 +466,7 @@ static void cpp_call( callVirtualMethod( pAdjustedThisPtr, aVtableSlot.index, pCppReturn, pReturnTypeRef, - pStackStart, + pStackStart, (pStack - pStackStart), pGPR, nGPR); @@ -478,7 +478,7 @@ static void cpp_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -495,7 +495,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -521,7 +521,7 @@ static void cpp_call( uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], cpp_release ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } - + // return type if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); @@ -541,7 +541,7 @@ void unoInterfaceProxyDispatch( #if OSL_DEBUG_LEVEL > 0 typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; #endif - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -551,12 +551,12 @@ void unoInterfaceProxyDispatch( sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); #endif - + VtableSlot aVtableSlot( getVtableSlot( reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *> (pMemberDescr))); - + if (pReturn) { // dependent dispatch @@ -579,7 +579,7 @@ void unoInterfaceProxyDispatch( OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; cpp_call( @@ -587,10 +587,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -627,7 +627,7 @@ void unoInterfaceProxyDispatch( (*pThis->getBridge()->getUnoEnv()->getRegisteredInterface)( pThis->getBridge()->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -657,7 +657,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx index 4974bf3f0e82..ad9898c732c5 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/call.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -92,11 +92,11 @@ void MapReturn(sal_uInt32 ret0, sal_uInt32 ret1, typelib_TypeDescription *pRetur //strictly necessary register sal_uInt32 r28 __asm__("%r28"); -void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, +void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, void * pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR) __attribute__((noinline)); -void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, +void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, void * pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR) { diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx index ebe07d4119b2..cb6ed0a33db2 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ namespace static typelib_TypeClass cpp2uno_call( bridges::cpp_uno::shared::CppInterfaceProxy* pThis, const typelib_TypeDescription * pMemberTypeDescr, - typelib_TypeDescriptionReference * pReturnTypeRef, + typelib_TypeDescriptionReference * pReturnTypeRef, sal_Int32 nParams, typelib_MethodParameter * pParams, long r8, void ** gpreg, double *fpreg, void ** ovrflw, sal_Int64 * pRegisterReturn /* space for register return */ ) @@ -72,7 +72,7 @@ namespace typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need void * pCppReturn = 0; @@ -112,9 +112,9 @@ namespace // cpp<=>uno) sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions - typelib_TypeDescription ** ppTempParamTypeDescr = + typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; bool bOverFlowUsed = false; for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) @@ -275,7 +275,7 @@ namespace else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) { - uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), + uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), pCppStack, pParamTypeDescr, pThis->getBridge()->getCpp2Uno() ); pTempIndizes[nTempIndizes] = nPos; // has to be reconverted @@ -313,16 +313,16 @@ namespace for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed - uno_destructData( pUnoArgs[nIndex], + uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - - CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, + + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -335,18 +335,18 @@ namespace sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], + uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -421,10 +421,10 @@ namespace pThis = static_cast< char * >(pThis) - nVtableOffset; - bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = + bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); - + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, @@ -469,7 +469,7 @@ namespace ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; aParam.bIn = sal_True; aParam.bOut = sal_False; - + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -503,7 +503,7 @@ namespace pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -617,7 +617,7 @@ namespace # define L21(v) unldil(((unsigned long)(v) >> 11) & 0x1fffff) //Left 21 bits # define R11(v) (((unsigned long)(v) & 0x7FF) << 1) //Right 11 bits - unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex, + unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex, sal_Int32 vtableOffset, bool bHasHiddenParam) { if (bHasHiddenParam) diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx index 36fe7968e19a..a49edffc61c1 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx b/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx index 895acf6b1883..f4ce93771bf7 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,25 +49,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); @@ -92,7 +92,7 @@ void fillUnoException( } -namespace hppa +namespace hppa { enum hppalimits { MAX_WORDS_IN_REGS = 4, MAX_GPR_REGS = 4, MAX_SSE_REGS = 4 }; diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx index 6d7a5333f1e1..377d8fd27cfd 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,7 +46,7 @@ using namespace ::rtl; using namespace ::com::sun::star::uno; -void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, +void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, void * pRegisterReturn, typelib_TypeDescription *pReturnTypeDescr, bool bRegisterReturn, sal_uInt32 *pStack, sal_uInt32 nStack, sal_uInt32 *pGPR, double *pFPR); @@ -139,7 +139,7 @@ namespace hppa { if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT || p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION) - { + { typelib_TypeDescription * t = 0; TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]); bool b = is_complex_struct(t); @@ -177,7 +177,7 @@ namespace hppa namespace { -//======================================================================= +//======================================================================= static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -198,7 +198,7 @@ static void cpp_call( typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion bool bOverFlow = false; bool bRegisterReturn = true; @@ -243,7 +243,7 @@ static void cpp_call( { uno_copyAndConvertData( pCppArgs[nPos] = alloca(8), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -300,7 +300,7 @@ static void cpp_call( uno_copyAndConvertData( pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -320,7 +320,7 @@ static void cpp_call( callVirtualMethod( pAdjustedThisPtr, aVtableSlot.index, pCppReturn, pReturnTypeDescr, bRegisterReturn, - pStackStart, + pStackStart, (pStack - pStackStart), pGPR, pFPR); // NO exception occured... @@ -331,7 +331,7 @@ static void cpp_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -348,7 +348,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -372,7 +372,7 @@ static void cpp_call( uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], cpp_release ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } - + // return type if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); @@ -402,12 +402,12 @@ void unoInterfaceProxyDispatch( sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); #endif - + VtableSlot aVtableSlot( getVtableSlot( reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *> (pMemberDescr))); - + if (pReturn) { // dependent dispatch @@ -430,7 +430,7 @@ void unoInterfaceProxyDispatch( OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; cpp_call( @@ -438,10 +438,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -478,7 +478,7 @@ void unoInterfaceProxyDispatch( (*pThis->getBridge()->getUnoEnv()->getRegisteredInterface)( pThis->getBridge()->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -509,7 +509,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx index 5a25c25c1ed8..dcd589b64bb0 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -52,7 +52,7 @@ static typelib_TypeClass cpp2uno_call( bridges::cpp_uno::shared::CppInterfaceProxy * pThis, const typelib_TypeDescription * pMemberTypeDescr, typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void return - sal_Int32 nParams, typelib_MethodParameter * pParams, long r8, + sal_Int32 nParams, typelib_MethodParameter * pParams, long r8, void ** gpreg, void ** fpreg, void ** ovrflw, sal_Int64 * pRegisterReturn /* space for register return */ ) { @@ -60,9 +60,9 @@ static typelib_TypeClass cpp2uno_call( fprintf(stderr, "as far as cpp2uno_call\n"); #endif - int ng = 0; //number of gpr registers used + int ng = 0; //number of gpr registers used int nf = 0; //number of fpr regsiters used - + // gpreg: [ret *], this, [gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -71,10 +71,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if ( ia64::return_in_hidden_param( pReturnTypeRef ) ) // complex return via ptr passed as hidden parameter reg (pCppReturn) @@ -82,15 +82,15 @@ static typelib_TypeClass cpp2uno_call( pCppReturn = *(void **)gpreg; gpreg++; ng++; - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn); // direct way } - else if ( ia64::return_via_r8_buffer( pReturnTypeRef ) ) // complex return via ptr passed in r8 + else if ( ia64::return_via_r8_buffer( pReturnTypeRef ) ) // complex return via ptr passed in r8 { pCppReturn = (void *)r8; - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn); // direct way @@ -100,7 +100,7 @@ static typelib_TypeClass cpp2uno_call( pUnoReturn = pRegisterReturn; // direct way for simple types } // pop this - gpreg++; + gpreg++; ng++; // stack space @@ -112,7 +112,7 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; bool bOverFlowUsed = false; for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) @@ -126,7 +126,7 @@ static typelib_TypeClass cpp2uno_call( #endif //I think it is impossible to get UNO to pass structs as parameters by copy - if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { #ifdef CMC_DEBUG fprintf(stderr, "simple\n"); @@ -175,7 +175,7 @@ static typelib_TypeClass cpp2uno_call( case typelib_TypeClass_LONG: case typelib_TypeClass_UNSIGNED_LONG: default: - if (ng < ia64::MAX_GPR_REGS) + if (ng < ia64::MAX_GPR_REGS) { pCppArgs[nPos] = pUnoArgs[nPos] = gpreg++; ng++; @@ -200,7 +200,7 @@ static typelib_TypeClass cpp2uno_call( void *pCppStack; //temporary stack pointer if (ng < ia64::MAX_GPR_REGS) - { + { pCppArgs[nPos] = pCppStack = *gpreg++; ng++; } @@ -241,14 +241,14 @@ static typelib_TypeClass cpp2uno_call( #ifdef CMC_DEBUG fprintf(stderr, "end of params\n"); #endif - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -256,15 +256,15 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - - CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); + + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -276,7 +276,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -286,7 +286,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -317,7 +317,7 @@ static typelib_TypeClass cpp2uno_call( //================================================================================================== static typelib_TypeClass cpp_mediate( sal_uInt64 nOffsetAndIndex, - void ** gpreg, void ** fpreg, long sp, long r8, + void ** gpreg, void ** fpreg, long sp, long r8, sal_Int64 * pRegisterReturn /* space for register return */ ) { OSL_ENSURE( sizeof(sal_Int64)==sizeof(void *), "### unexpected!" ); @@ -326,7 +326,7 @@ static typelib_TypeClass cpp_mediate( sal_Int32 nFunctionIndex = (nOffsetAndIndex & 0xFFFFFFFF); void ** ovrflw = (void**)(sp); - + // gpreg: [ret *], this, [other gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -351,7 +351,7 @@ static typelib_TypeClass cpp_mediate( #ifdef CMC_DEBUG fprintf(stderr, "pThis is %p\n", pThis); #endif - + pThis = static_cast< char * >(pThis) - nVtableOffset; #ifdef CMC_DEBUG @@ -367,7 +367,7 @@ static typelib_TypeClass cpp_mediate( #ifdef CMC_DEBUG fprintf(stderr, "indexes are %d %d\n", nFunctionIndex, pTypeDescr->nMapFunctionIndexToMemberIndex); #endif - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -375,7 +375,7 @@ static typelib_TypeClass cpp_mediate( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); @@ -406,9 +406,9 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -439,9 +439,9 @@ static typelib_TypeClass cpp_mediate( XInterface * pInterface = 0; (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), - (void **)&pInterface, pCppI->getOid().pData, + (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -573,7 +573,7 @@ namespace { const int codeSnippetSize = 40; -bridges::cpp_uno::shared::VtableFactory::Slot codeSnippet( unsigned char * code, sal_PtrDiff writetoexecdiff, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, +bridges::cpp_uno::shared::VtableFactory::Slot codeSnippet( unsigned char * code, sal_PtrDiff writetoexecdiff, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, bool bHasHiddenParam ) { #ifdef CMC_DEBUG diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx index c0de95532515..ea6961092f1a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_ia64/share.hxx index 359c9c720212..aabc2359bcb4 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,25 +50,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx index 2be69d85ba90..8e1d706a8f42 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -88,7 +88,7 @@ void MapReturn(const ia64::RegReturn &rRet, double dret, typelib_TypeDescription } namespace ia64 -{ +{ bool is_complex_struct(const typelib_TypeDescription * type) { const typelib_CompoundTypeDescription * p @@ -97,7 +97,7 @@ namespace ia64 { if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT || p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION) - { + { typelib_TypeDescription * t = 0; TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]); bool b = is_complex_struct(t); @@ -161,7 +161,7 @@ namespace ia64 namespace { //================================================================================================== -static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, +static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, bool bSimpleReturn, sal_uInt64 *pStack, sal_uInt32 nStack, sal_uInt64 *pGPR, sal_uInt32 nGPR, @@ -184,7 +184,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, for ( unsigned int i = 0; i < nGPR; ++i ) fprintf( stderr, "0x%lx, ", pGPR[i] ); fprintf( stderr, "\nFPR's (%d): ", nFPR ); - for ( unsigned int i = 0; i < nFPR; ++i ) + for ( unsigned int i = 0; i < nFPR; ++i ) fprintf( stderr, "0x%lx (%f), ", pFPR[i], pFPR[i] ); fprintf( stderr, "\nStack (%d): ", nStack ); for ( unsigned int i = 0; i < nStack; ++i ) @@ -243,7 +243,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, register long r10 asm("r10"); ret.r10 = r10; register long r11 asm("r11"); ret.r11 = r11; } - + MapReturn(ret, f8, pReturnTypeDescr, bSimpleReturn, (sal_uInt64*)pRegisterReturn); } @@ -307,7 +307,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, if (bOverFlow) \ *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV ); -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -324,12 +324,12 @@ static void cpp_call( double pFPR[ia64::MAX_SSE_REGS]; sal_uInt32 nFPR = 0; - + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion bool bOverFlow = false; @@ -370,19 +370,19 @@ static void cpp_call( #endif INSERT_INT64( &pAdjustedThisPtr, nGPR, pGPR, pStack, bOverFlow ); - // Args + // Args void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams ); // indizes of values this have to be converted (interface conversion cpp<=>uno) sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; #ifdef CMC_DEBUG fprintf(stderr, "n params is %d\n", nParams); #endif - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -393,10 +393,10 @@ static void cpp_call( fprintf(stderr, "param %d is %d %d %d\n", nPos, rParam.bOut, bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ), pParamTypeDescr->eTypeClass); #endif - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { -// uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, +// uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, uno_copyAndConvertData( pCppArgs[nPos] = pStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); switch (pParamTypeDescr->eTypeClass) @@ -450,7 +450,7 @@ static void cpp_call( // no longer needed TYPELIB_DANGER_RELEASE( pParamTypeDescr ); - + } else // ptr to complex value | ref { @@ -465,7 +465,7 @@ static void cpp_call( // cpp out is constructed mem, uno out is not! uno_constructData( pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), - pParamTypeDescr ); + pParamTypeDescr ); pTempIndizes[nTempIndizes] = nPos; // default constructed for cpp call // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -496,12 +496,12 @@ static void cpp_call( INSERT_INT64( &(pCppArgs[nPos]), nGPR, pGPR, pStack, bOverFlow ); } } - + try { callVirtualMethod( pAdjustedThisPtr, aVtableSlot.index, - pCppReturn, pReturnTypeDescr, bSimpleReturn, + pCppReturn, pReturnTypeDescr, bSimpleReturn, pStackStart, ( pStack - pStackStart ), pGPR, nGPR, pFPR, nFPR ); @@ -513,7 +513,7 @@ static void cpp_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -530,7 +530,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -544,9 +544,9 @@ static void cpp_call( catch (...) { // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -570,9 +570,9 @@ void unoInterfaceProxyDispatch( void * pReturn, void * pArgs[], uno_Any ** ppException ) { // is my surrogate - bridges::cpp_uno::shared::UnoInterfaceProxy * pThis + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -599,14 +599,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; //get then set method cpp_call( @@ -614,10 +614,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -649,7 +649,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -679,7 +679,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx index ccc31f10a407..355928ac8721 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -62,10 +62,10 @@ void cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (x86::isSimpleReturnType( pReturnTypeDescr )) @@ -76,7 +76,7 @@ void cpp2uno_call( { pCppReturn = *(void **)pCppStack; pCppStack += sizeof(void *); - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) @@ -95,9 +95,9 @@ void cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -155,7 +155,7 @@ void cpp2uno_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; @@ -163,7 +163,7 @@ void cpp2uno_call( // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -171,14 +171,14 @@ void cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any @@ -190,7 +190,7 @@ void cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -200,7 +200,7 @@ void cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -230,7 +230,7 @@ extern "C" void cpp_vtable_call( void * pReturnValue ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); - + // pCallStack: ret adr, [ret *], this, params void * pThis; if( nFunctionIndex & 0x80000000 ) @@ -246,9 +246,9 @@ extern "C" void cpp_vtable_call( bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); - + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -256,13 +256,13 @@ extern "C" void cpp_vtable_call( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + switch (aMemberDescr.get()->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -282,9 +282,9 @@ extern "C" void cpp_vtable_call( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -315,7 +315,7 @@ extern "C" void cpp_vtable_call( pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx index 69785be506f1..807448909389 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx index 8a3e136bfb7b..f7dc2f956896 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,25 +48,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx index 777d4b553db3..57e59d312560 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -77,11 +77,11 @@ void callVirtualMethod( { // parameter list is mixed list of * and values // reference parameters are pointers - + OSL_ENSURE( pStackLongs && pAdjustedThisPtr, "### null ptr!" ); OSL_ENSURE( (sizeof(void *) == 4) && (sizeof(sal_Int32) == 4), "### unexpected size of int!" ); OSL_ENSURE( nStackLongs && pStackLongs, "### no stack in callVirtualMethod !" ); - + // never called if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something @@ -169,7 +169,7 @@ void callVirtualMethod( } } -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -178,18 +178,18 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion bool bSimpleReturn = true; - + if (pReturnTypeDescr) { bSimpleReturn = x86::isSimpleReturnType(pReturnTypeDescr); @@ -222,21 +222,21 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -270,7 +270,7 @@ static void cpp_call( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -294,13 +294,13 @@ static void cpp_call( (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -317,7 +317,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -332,7 +332,7 @@ static void cpp_call( { // fill uno exception fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -390,7 +390,7 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -415,14 +415,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -430,10 +430,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -464,7 +464,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -494,7 +494,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx index 53542e23f97d..7673ad98f268 100644 --- a/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_m68k/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ namespace static typelib_TypeClass cpp2uno_call( bridges::cpp_uno::shared::CppInterfaceProxy* pThis, const typelib_TypeDescription * pMemberTypeDescr, - typelib_TypeDescriptionReference * pReturnTypeRef, + typelib_TypeDescriptionReference * pReturnTypeRef, sal_Int32 nParams, typelib_MethodParameter * pParams, long r8, void ** pCallStack, sal_Int64 * pRegisterReturn /* space for register return */ ) @@ -72,11 +72,11 @@ namespace typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need void * pCppReturn = 0; - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -111,9 +111,9 @@ namespace // cpp<=>uno) sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions - typelib_TypeDescription ** ppTempParamTypeDescr = + typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) @@ -122,8 +122,8 @@ namespace typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - if (!rParam.bOut && - bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + if (!rParam.bOut && + bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { switch (pParamTypeDescr->eTypeClass) { @@ -169,7 +169,7 @@ namespace else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) { - uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), + uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), *(void **)pCppStack, pParamTypeDescr, pThis->getBridge()->getCpp2Uno() ); pTempIndizes[nTempIndizes] = nPos; // has to be reconverted @@ -208,16 +208,16 @@ namespace for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed - uno_destructData( pUnoArgs[nIndex], + uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - - CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, + + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -230,18 +230,18 @@ namespace sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], + uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -254,7 +254,7 @@ namespace // destroy temp uno return uno_destructData( pUnoReturn, pReturnTypeDescr, 0 ); } - // complex return ptr is set to return reg + // complex return ptr is set to return reg *(void **)pRegisterReturn = pCppReturn; } if (pReturnTypeDescr) @@ -289,10 +289,10 @@ namespace pThis = static_cast< char * >(pThis) - nVtableOffset; - bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = + bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); - + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, @@ -337,7 +337,7 @@ namespace ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; aParam.bIn = sal_True; aParam.bOut = sal_False; - + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -371,7 +371,7 @@ namespace pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -440,17 +440,17 @@ namespace //some m68k info : http://www2.biglobe.ne.jp/~inaba/trampolines.html - unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex, + unsigned char *codeSnippet(unsigned char* code, sal_Int32 functionIndex, sal_Int32 vtableOffset) { unsigned char * p = code; - *(short *)&p[0] = 0x203C; //movel functionIndex,d0 + *(short *)&p[0] = 0x203C; //movel functionIndex,d0 *(long *)&p[2] = functionIndex; - *(short *)&p[6] = 0x223C; //movel functionIndex,d1 + *(short *)&p[6] = 0x223C; //movel functionIndex,d1 *(long *)&p[8] = vtableOffset; - *(short *)&p[12] = 0x4EF9; //jmp cpp_vtable_call + *(short *)&p[12] = 0x4EF9; //jmp cpp_vtable_call *(long *)&p[14] = (long)&cpp_vtable_call; - *(short *)&p[18] = 0x4E71; //nop + *(short *)&p[18] = 0x4E71; //nop return code + codeSnippetSize; } } @@ -510,7 +510,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( { (s++)->fn = code + writetoexecdiff; - typelib_InterfaceMethodTypeDescription *pMethodTD = + typelib_InterfaceMethodTypeDescription *pMethodTD = reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(member); diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx index 36fe7968e19a..a49edffc61c1 100644 --- a/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/share.hxx b/bridges/source/cpp_uno/gcc3_linux_m68k/share.hxx index 4ec09c29ff0a..aa802babac96 100644 --- a/bridges/source/cpp_uno/gcc3_linux_m68k/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_m68k/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,25 +49,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/uno2cpp.cxx index 97a9ab0187d9..9ea27cfb05fc 100644 --- a/bridges/source/cpp_uno/gcc3_linux_m68k/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_m68k/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -159,7 +159,7 @@ void callVirtualMethod( *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV ); namespace { -//======================================================================= +//======================================================================= static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -177,7 +177,7 @@ static void cpp_call( typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion if (pReturnTypeDescr) @@ -212,7 +212,7 @@ static void cpp_call( typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -224,7 +224,7 @@ static void cpp_call( // uno_copyAndConvertData( pCppArgs[nPos] = pStack, pUnoArgs[nPos], uno_copyAndConvertData( pCppArgs[nPos] = alloca(8), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -279,7 +279,7 @@ static void cpp_call( uno_copyAndConvertData( pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -299,7 +299,7 @@ static void cpp_call( callVirtualMethod( pAdjustedThisPtr, aVtableSlot.index, pCppReturn, pReturnTypeDescr->eTypeClass, - pStackStart, + pStackStart, (pStack - pStackStart)); // NO exception occured... @@ -310,7 +310,7 @@ static void cpp_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -327,7 +327,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -351,7 +351,7 @@ static void cpp_call( uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], cpp_release ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } - + // return type if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); @@ -377,12 +377,12 @@ void unoInterfaceProxyDispatch( // determine vtable call index sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); - + VtableSlot aVtableSlot( getVtableSlot( reinterpret_cast<typelib_InterfaceAttributeTypeDescription const *> (pMemberDescr))); - + if (pReturn) { // dependent dispatch @@ -405,7 +405,7 @@ void unoInterfaceProxyDispatch( OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; cpp_call( @@ -413,10 +413,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -451,7 +451,7 @@ void unoInterfaceProxyDispatch( (*pThis->getBridge()->getUnoEnv()->getRegisteredInterface)( pThis->getBridge()->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -481,7 +481,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx index b6fd1d461cfd..5b49ac892005 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -87,9 +87,9 @@ namespace #endif /* C++ has [ret *] or this as the first arguments, so no arguments will - * be passed in floating-point registers? + * be passed in floating-point registers? */ - //int int_seen = 0; // have we seen integer arguments? + //int int_seen = 0; // have we seen integer arguments? void ** pCppStack; //temporary stack pointer @@ -130,7 +130,7 @@ namespace } // pop this - gpreg++; + gpreg++; nw++; // stack space @@ -155,7 +155,7 @@ namespace typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) // value { @@ -171,7 +171,7 @@ namespace if (nw & 1) { nw++; gpreg++; - } + } #ifdef BRDEBUG fprintf(stderr,"cpp2uno_call:gpreg=%p,%p\n",gpreg[0],gpreg[1]); #endif @@ -253,7 +253,7 @@ namespace #ifdef BRDEBUG fprintf(stderr,"cpp2uno_call:ptr|ref\n"); #endif - if (nw < 4) { + if (nw < 4) { pCppArgs[nPos] = *(void **)gpreg; pCppStack = gpreg; nw++; @@ -328,7 +328,7 @@ namespace if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -465,8 +465,8 @@ namespace typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; eRet = cpp2uno_call( pCppI, aMemberDescr.get(), @@ -507,7 +507,7 @@ namespace XInterface * pInterface = 0; (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), - (void **)&pInterface, pCppI->getOid().pData, + (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); if (pInterface) @@ -579,15 +579,15 @@ namespace memcpy( gpreg, pCallStack, 16); -#ifdef BRDEBUG - fprintf(stderr,"in cpp_vtable_call nFunctionIndex is %d\n",nFunctionIndex); +#ifdef BRDEBUG + fprintf(stderr,"in cpp_vtable_call nFunctionIndex is %d\n",nFunctionIndex); fprintf(stderr,"in cpp_vtable_call nVtableOffset is %d\n",vTableOffset); fprintf(stderr,"gp=%x,%x,%x,%x\n",gpreg[0],gpreg[1],gpreg[2],gpreg[3]); #endif //sal_Bool bComplex = nFunctionIndex & 0x80000000 ? sal_True : sal_False; - typelib_TypeClass aType = + typelib_TypeClass aType = cpp_mediate( nFunctionIndex, vTableOffset, (void**)gpreg, (void**)fpreg, ovrflw, (sal_Int64*)nRegReturn ); switch( aType ) @@ -639,7 +639,7 @@ namespace int const codeSnippetSize = 56; - unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset, + unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset, bool simpleRetType) { @@ -683,7 +683,7 @@ namespace 40: 00000000 nop be careful, we use the argument space reserved by the caller to - write down regs. This can avoid the need to make use of arbitary far away + write down regs. This can avoid the need to make use of arbitary far away stack space or to allocate a function frame for this code snippet itself. Since only functions with variable arguments will overwrite the space, cpp_vtable_call should be safe. diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx b/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx index 78d72c0c733b..d99977e00a08 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -52,7 +52,7 @@ using namespace ::__cxxabiv1; namespace CPPU_CURRENT_NAMESPACE { - + void dummy_can_throw_anything( char const * ) { } @@ -63,13 +63,13 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) #if defined BRIDGES_DEBUG char const * start = p; #endif - + // example: N3com3sun4star4lang24IllegalArgumentExceptionE - + OUStringBuffer buf( 64 ); OSL_ASSERT( 'N' == *p ); ++p; // skip N - + while ('E' != *p) { // read chars count @@ -84,7 +84,7 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) if ('E' != *p) buf.append( (sal_Unicode)'.' ); } - + #if defined BRIDGES_DEBUG OUString ret( buf.makeStringAndClear() ); OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) ); @@ -99,17 +99,17 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) class RTTI { typedef hash_map< OUString, type_info *, OUStringHash > t_rtti_map; - + Mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; void * m_hApp; - + public: RTTI() SAL_THROW( () ); ~RTTI() SAL_THROW( () ); - + type_info * getRTTI( typelib_CompoundTypeDescription * ) SAL_THROW( () ); }; //__________________________________________________________________________________________________ @@ -127,9 +127,9 @@ RTTI::~RTTI() SAL_THROW( () ) type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () ) { type_info * rtti; - + OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - + MutexGuard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) @@ -147,7 +147,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR } while (index >= 0); buf.append( 'E' ); - + OString symName( buf.makeStringAndClear() ); rtti = (type_info *)dlsym( m_hApp, symName.getStr() ); @@ -183,7 +183,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR // this class has no base class rtti = new __class_type_info( strdup( rttiName ) ); } - + pair< t_rtti_map::iterator, bool > insertion( m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); @@ -198,7 +198,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR { rtti = iRttiFind->second; } - + return rtti; } @@ -242,10 +242,10 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ), Reference< XInterface >() ); } - + pCppExc = __cxa_allocate_exception( pTypeDescr->nSize ); ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); - + // destruct uno exception ::uno_any_destruct( pUnoExc, 0 ); // avoiding locked counts @@ -274,7 +274,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) Reference< XInterface >() ); } } - + __cxa_throw( pCppExc, rtti, deleteException ); } @@ -294,7 +294,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping #endif return; } - + typelib_TypeDescription * pExcTypeDescr = 0; OUString unoName( toUNOname( header->exceptionType->name() ) ); #if defined BRIDGES_DEBUG diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/share.hxx b/bridges/source/cpp_uno/gcc3_linux_mips/share.hxx index 4ec09c29ff0a..aa802babac96 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,25 +49,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_mips/uno2cpp.cxx index 82d226f88ea6..ba139cd43f51 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -89,7 +89,7 @@ namespace /* p = sp - 512; new sp will be p - 16, but we don't change sp * at this time to avoid breaking ABI--not sure whether changing sp will break - * references to local variables. For the same reason, we use abosulte value. + * references to local variables. For the same reason, we use abosulte value. */ __asm__ __volatile__ ( "addiu $2,$29,-512\n\t" @@ -97,10 +97,10 @@ namespace :"=r"(p): : "$2","$29" ); #ifdef BRDEBUG - if (nStackLongs * 4 > 512 ) - fprintf(stderr,"too many arguments"); + if (nStackLongs * 4 > 512 ) + fprintf(stderr,"too many arguments"); #endif - + // now begin to load the C++ function arguments into storage nw = 0; @@ -130,13 +130,13 @@ namespace case 'D': /* type is double */ /* treat the same as long long */ case 'H': /* type is long long */ - if (nw & 1) nw++; /* note even elements gpr[] will map to + if (nw & 1) nw++; /* note even elements gpr[] will map to odd registers*/ if (nw < 4) { gpr[nw++] = *pStackLongs; gpr[nw++] = *(pStackLongs+1); } else { - if (((long) p) & 4) + if (((long) p) & 4) p++; *p++ = *pStackLongs; *p++ = *(pStackLongs+1); @@ -175,12 +175,12 @@ namespace } /* figure out the address of the function we need to invoke */ - off = nVtableIndex; + off = nVtableIndex; off = off * 4; // 4 bytes per slot mfunc = *((unsigned long **)pAdjustedThisPtr); // get the address of the vtable - mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset + mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset mfunc = *((unsigned long **)mfunc); // the function is stored at the address - ptr = (void (*)())mfunc; + ptr = (void (*)())mfunc; #ifdef BRDEBUG fprintf(stderr,"calling function %p\n",mfunc); @@ -189,10 +189,10 @@ namespace /* Set up the machine registers and invoke the function */ __asm__ __volatile__ ( - "lw $4, 0(%0)\n\t" - "lw $5, 4(%0)\n\t" - "lw $6, 8(%0)\n\t" - "lw $7, 12(%0)\n\t" + "lw $4, 0(%0)\n\t" + "lw $5, 4(%0)\n\t" + "lw $6, 8(%0)\n\t" + "lw $7, 12(%0)\n\t" : : "r" (gpr) : "$4", "$5", "$6", "$7" ); @@ -208,13 +208,13 @@ namespace "sw $3,%1 \n\t" : "=m" (iret), "=m" (iret2) : ); register float fret asm("$f0"); - register double dret asm("$f0"); + register double dret asm("$f0"); switch( eReturnType ) { case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: - ((long*)pRegisterReturn)[1] = iret2; // fall through + ((long*)pRegisterReturn)[1] = iret2; // fall through case typelib_TypeClass_LONG: case typelib_TypeClass_UNSIGNED_LONG: case typelib_TypeClass_ENUM: @@ -241,7 +241,7 @@ namespace } - //================================================================================================== + //================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -250,9 +250,9 @@ namespace void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; + char * pCppStackStart = pCppStack; // need to know parameter types for callVirtualMethod so generate a signature string char * pParamType = (char *) alloca(nParams+2); @@ -278,7 +278,7 @@ namespace else { // complex return via ptr - pCppReturn = *(void **)pCppStack = + pCppReturn = *(void **)pCppStack = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ): pUnoReturn); // direct way *pPT++ = 'I'; //signify that a complex return type on stack @@ -376,7 +376,7 @@ namespace { uno_copyAndConvertData( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), - pUnoArgs[nPos], pParamTypeDescr, + pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); pTempIndizes[nTempIndizes] = nPos; // has to be reconverted @@ -445,7 +445,7 @@ namespace catch (...) { // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); // temporary params @@ -507,8 +507,8 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx index 24354bfa45f8..282f40a66765 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,12 +56,12 @@ static typelib_TypeClass cpp2uno_call( void ** gpreg, void ** fpreg, void ** ovrflw, sal_Int64 * pRegisterReturn /* space for register return */ ) { - int ng = 0; //number of gpr registers used + int ng = 0; //number of gpr registers used #ifndef __NO_FPRS__ int nf = 0; //number of fpr regsiters used #endif void ** pCppStack; //temporary stack pointer - + // gpreg: [ret *], this, [gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -70,10 +70,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -85,14 +85,14 @@ static typelib_TypeClass cpp2uno_call( pCppReturn = *(void **)gpreg; gpreg++; ng++; - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn); // direct way } } // pop this - gpreg++; + gpreg++; ng++; // stack space @@ -104,16 +104,16 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) // value { @@ -185,7 +185,7 @@ static typelib_TypeClass cpp2uno_call( if (ng & 1) { ng++; gpreg++; - } + } if (ng < 8) { pCppArgs[nPos] = gpreg; pUnoArgs[nPos] = gpreg; @@ -250,7 +250,7 @@ static typelib_TypeClass cpp2uno_call( else // ptr to complex value | ref { - if (ng < 8) { + if (ng < 8) { pCppArgs[nPos] = *(void **)gpreg; pCppStack = gpreg; ng++; @@ -287,14 +287,14 @@ static typelib_TypeClass cpp2uno_call( } } } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -302,15 +302,15 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - - CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); + + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -322,7 +322,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -332,7 +332,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -368,7 +368,7 @@ static typelib_TypeClass cpp_mediate( sal_Int64 * pRegisterReturn /* space for register return */ ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); - + // gpreg: [ret *], this, [other gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -383,14 +383,14 @@ static typelib_TypeClass cpp_mediate( { pThis = gpreg[0]; } - + pThis = static_cast< char * >(pThis) - nVtableOffset; bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -398,13 +398,13 @@ static typelib_TypeClass cpp_mediate( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + typelib_TypeClass eRet; switch (aMemberDescr.get()->eTypeClass) { @@ -425,9 +425,9 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -458,9 +458,9 @@ static typelib_TypeClass cpp_mediate( XInterface * pInterface = 0; (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), - (void **)&pInterface, pCppI->getOid().pData, + (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -519,15 +519,15 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg // fprintf(stderr,"in cpp_vtable_call nVtableOffset is %x\n",nVtableOffset); // fflush(stderr); - typelib_TypeClass aType = + typelib_TypeClass aType = cpp_mediate( nFunctionIndex, nVtableOffset, (void**)gpreg, #ifndef __NO_FPRS__ - (void**)fpreg, + (void**)fpreg, #else NULL, #endif ovrflw, (sal_Int64*)nRegReturn ); - + switch( aType ) { @@ -539,7 +539,7 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg __asm__( "lbz 3,%0\n\t" : : "m"(nRegReturn[0]) ); break; - + case typelib_TypeClass_CHAR: case typelib_TypeClass_SHORT: case typelib_TypeClass_UNSIGNED_SHORT: @@ -584,7 +584,7 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg int const codeSnippetSize = 108; -unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset, +unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset, bool simpleRetType) { @@ -596,59 +596,59 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal functionIndex |= 0x80000000; unsigned long * p = (unsigned long *) code; - + // OSL_ASSERT( sizeof (long) == 4 ); OSL_ASSERT((((unsigned long)code) & 0x3) == 0 ); //aligned to 4 otherwise a mistake /* generate this code */ // # so first save gpr 3 to gpr 10 (aligned to 4) - // stw r3,-2048(r1) - // stw r4,-2044(r1) - // stw r5,-2040(r1) - // stw r6,-2036(r1) - // stw r7,-2032(r1) - // stw r8,-2028(r1) - // stw r9,-2024(r1) - // stw r10,-2020(r1) + // stw r3,-2048(r1) + // stw r4,-2044(r1) + // stw r5,-2040(r1) + // stw r6,-2036(r1) + // stw r7,-2032(r1) + // stw r8,-2028(r1) + // stw r9,-2024(r1) + // stw r10,-2020(r1) // # next save fpr 1 to fpr 8 (aligned to 8) // if dedicated floating point registers are used - // stfd f1,-2016(r1) - // stfd f2,-2008(r1) - // stfd f3,-2000(r1) - // stfd f4,-1992(r1) - // stfd f5,-1984(r1) - // stfd f6,-1976(r1) - // stfd f7,-1968(r1) - // stfd f8,-1960(r1) + // stfd f1,-2016(r1) + // stfd f2,-2008(r1) + // stfd f3,-2000(r1) + // stfd f4,-1992(r1) + // stfd f5,-1984(r1) + // stfd f6,-1976(r1) + // stfd f7,-1968(r1) + // stfd f8,-1960(r1) // # now here is where cpp_vtable_call must go - // lis r3,-8531 - // ori r3,r3,48879 - // mtctr r3 + // lis r3,-8531 + // ori r3,r3,48879 + // mtctr r3 // # now load up the functionIndex - // lis r3,-8531 - // ori r3,r3,48879 + // lis r3,-8531 + // ori r3,r3,48879 - // # now load up the vtableOffset - // lis r4,-8531 - // ori r4,r4,48879 + // # now load up the vtableOffset + // lis r4,-8531 + // ori r4,r4,48879 // #now load up the pointer to the saved gpr registers - // addi r5,r1,-2048 + // addi r5,r1,-2048 // #now load up the pointer to the saved fpr registers - // addi r6,r1,-2016 + // addi r6,r1,-2016 // if no dedicated floating point registers are used than we have NULL // pointer there // li r6, 0 // // #now load up the pointer to the overflow call stack - // addi r7,r1,8 - // bctr + // addi r7,r1,8 + // bctr * p++ = 0x9061f800; * p++ = 0x9081f804; diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx index c0de95532515..ea6961092f1a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/share.hxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/share.hxx index 4ec09c29ff0a..aa802babac96 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,25 +49,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx index 0ebc44895a78..0c0ad60c5e64 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -64,7 +64,7 @@ static void callVirtualMethod( // reference parameters are pointers // the basic idea here is to use gpr[8] as a storage area for - // the future values of registers r3 to r10 needed for the call, + // the future values of registers r3 to r10 needed for the call, // and similarly fpr[8] as a storage area for the future values // of floating point registers f1 to f8 @@ -91,14 +91,14 @@ static void callVirtualMethod( // Note: This keeps us from having to decode the signature twice and // prevents problems with later local variables. - // Note: could require up to 2*nStackLongs words of parameter stack area - // if the call has many float parameters (i.e. floats take up only 1 + // Note: could require up to 2*nStackLongs words of parameter stack area + // if the call has many float parameters (i.e. floats take up only 1 // word on the stack but double takes 2 words in parameter area in the // stack frame . // Update! floats on the outgoing parameter stack only take up 1 word // (stfs is used) which is not correct according to the ABI but we - // will match what the compiler does until this is figured out + // will match what the compiler does until this is figured out // this grows the current stack to the appropriate size // and sets the outgoing stack pointer p to the right place @@ -156,7 +156,7 @@ static void callVirtualMethod( gpr[n++] = *(pStackLongs+1); #endif } else { - if (((long) p) & 4) + if (((long) p) & 4) p++; *p++ = *pStackLongs; /* or on the parameter stack */ *p++ = *(pStackLongs + 1); @@ -169,7 +169,7 @@ static void callVirtualMethod( stack and that if passed in parameter stack to C, should be as double word. - Whoops: the abi is not actually followed by gcc, need to + Whoops: the abi is not actually followed by gcc, need to store floats as a *single* word on outgoing parameter stack to match what gcc actually does */ @@ -182,7 +182,7 @@ static void callVirtualMethod( #endif } else { #if 0 /* if abi were followed */ - if (((long) p) & 4) + if (((long) p) & 4) p++; *((double *)p) = *((float *)pStackLongs); p += 2; @@ -195,13 +195,13 @@ static void callVirtualMethod( break; case 'H': /* type is long long */ - if (n & 1) n++; /* note even elements gpr[] will map to + if (n & 1) n++; /* note even elements gpr[] will map to odd registers*/ if (n <= 6) { gpr[n++] = *pStackLongs; gpr[n++] = *(pStackLongs+1); } else { - if (((long) p) & 4) + if (((long) p) & 4) p++; *p++ = *pStackLongs; *p++ = *(pStackLongs+1); @@ -240,33 +240,33 @@ static void callVirtualMethod( } /* figure out the address of the function we need to invoke */ - off = nVtableIndex; + off = nVtableIndex; off = off * 4; // 4 bytes per slot mfunc = *((unsigned long **)pAdjustedThisPtr); // get the address of the vtable - mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset + mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset mfunc = *((unsigned long **)mfunc); // the function is stored at the address - ptr = (void (*)())mfunc; + ptr = (void (*)())mfunc; /* Set up the machine registers and invoke the function */ __asm__ __volatile__ ( - "lwz 3, 0(%0)\n\t" - "lwz 4, 4(%0)\n\t" - "lwz 5, 8(%0)\n\t" - "lwz 6, 12(%0)\n\t" - "lwz 7, 16(%0)\n\t" - "lwz 8, 20(%0)\n\t" - "lwz 9, 24(%0)\n\t" - "lwz 10, 28(%0)\n\t" + "lwz 3, 0(%0)\n\t" + "lwz 4, 4(%0)\n\t" + "lwz 5, 8(%0)\n\t" + "lwz 6, 12(%0)\n\t" + "lwz 7, 16(%0)\n\t" + "lwz 8, 20(%0)\n\t" + "lwz 9, 24(%0)\n\t" + "lwz 10, 28(%0)\n\t" #ifndef __NO_FPRS__ - "lfd 1, 0(%1)\n\t" - "lfd 2, 8(%1)\n\t" - "lfd 3, 16(%1)\n\t" - "lfd 4, 24(%1)\n\t" - "lfd 5, 32(%1)\n\t" - "lfd 6, 40(%1)\n\t" - "lfd 7, 48(%1)\n\t" - "lfd 8, 56(%1)\n\t" + "lfd 1, 0(%1)\n\t" + "lfd 2, 8(%1)\n\t" + "lfd 3, 16(%1)\n\t" + "lfd 4, 24(%1)\n\t" + "lfd 5, 32(%1)\n\t" + "lfd 6, 40(%1)\n\t" + "lfd 7, 48(%1)\n\t" + "lfd 8, 56(%1)\n\t" : : "r" (gpr), "r" (fpr) #else : : "r" (gpr) @@ -328,7 +328,7 @@ static void callVirtualMethod( } -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -337,10 +337,10 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // need to know parameter types for callVirtualMethod so generate a signature string char * pParamType = (char *) alloca(nParams+2); char * pPT = pParamType; @@ -349,9 +349,9 @@ static void cpp_call( typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); // OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -361,7 +361,7 @@ static void cpp_call( else { // complex return via ptr - pCppReturn = *(void **)pCppStack = + pCppReturn = *(void **)pCppStack = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ): pUnoReturn); // direct way *pPT++ = 'I'; //signify that a complex return type on stack @@ -382,20 +382,20 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { @@ -458,9 +458,9 @@ static void cpp_call( { uno_copyAndConvertData( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), - pUnoArgs[nPos], pParamTypeDescr, + pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -476,7 +476,7 @@ static void cpp_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // terminate the signature string *pPT++='X'; *pPT=0; @@ -490,13 +490,13 @@ static void cpp_call( (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -513,7 +513,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -527,9 +527,9 @@ static void cpp_call( catch (...) { // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -553,9 +553,9 @@ void unoInterfaceProxyDispatch( void * pReturn, void * pArgs[], uno_Any ** ppException ) { // is my surrogate - bridges::cpp_uno::shared::UnoInterfaceProxy * pThis + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -582,14 +582,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; //get then set method cpp_call( @@ -597,10 +597,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -632,7 +632,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -662,7 +662,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx index f8e1fb9cd98a..661f54522224 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -61,9 +61,9 @@ static typelib_TypeClass cpp2uno_call( fprintf(stderr, "as far as cpp2uno_call\n"); #endif - int ng = 0; //number of gpr registers used + int ng = 0; //number of gpr registers used int nf = 0; //number of fpr regsiters used - + // gpreg: [ret *], this, [gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -72,10 +72,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -87,14 +87,14 @@ static typelib_TypeClass cpp2uno_call( pCppReturn = *(void **)gpreg; gpreg++; ng++; - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn); // direct way } } // pop this - gpreg++; + gpreg++; ng++; // stack space @@ -106,7 +106,7 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; bool bOverFlowUsed = false; for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) @@ -119,7 +119,7 @@ static typelib_TypeClass cpp2uno_call( fprintf(stderr, "arg %d of %d\n", nPos, nParams); #endif - if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { #ifdef CMC_DEBUG fprintf(stderr, "simple\n"); @@ -194,7 +194,7 @@ static typelib_TypeClass cpp2uno_call( if (bOverFlowUsed) ovrflw++; break; default: - if (ng < ppc64::MAX_GPR_REGS) + if (ng < ppc64::MAX_GPR_REGS) { pCppArgs[nPos] = pUnoArgs[nPos] = gpreg++; ng++; @@ -219,7 +219,7 @@ static typelib_TypeClass cpp2uno_call( void *pCppStack; //temporary stack pointer if (ng < ppc64::MAX_GPR_REGS) - { + { pCppArgs[nPos] = pCppStack = *gpreg++; ng++; } @@ -260,14 +260,14 @@ static typelib_TypeClass cpp2uno_call( #ifdef CMC_DEBUG fprintf(stderr, "end of params\n"); #endif - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -275,15 +275,15 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - - CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); + + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -295,7 +295,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -305,7 +305,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -346,7 +346,7 @@ static typelib_TypeClass cpp_mediate( long sf = *(long*)sp; void ** ovrflw = (void**)(sf + 112); - + // gpreg: [ret *], this, [other gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -371,7 +371,7 @@ static typelib_TypeClass cpp_mediate( #ifdef CMC_DEBUG fprintf(stderr, "pThis is %lx\n", pThis); #endif - + pThis = static_cast< char * >(pThis) - nVtableOffset; #ifdef CMC_DEBUG @@ -387,7 +387,7 @@ static typelib_TypeClass cpp_mediate( #ifdef CMC_DEBUG fprintf(stderr, "indexes are %d %d\n", nFunctionIndex, pTypeDescr->nMapFunctionIndexToMemberIndex); #endif - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -395,7 +395,7 @@ static typelib_TypeClass cpp_mediate( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); @@ -405,7 +405,7 @@ static typelib_TypeClass cpp_mediate( #endif TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + typelib_TypeClass eRet; switch (aMemberDescr.get()->eTypeClass) { @@ -426,9 +426,9 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -459,9 +459,9 @@ static typelib_TypeClass cpp_mediate( XInterface * pInterface = 0; (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), - (void **)&pInterface, pCppI->getOid().pData, + (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -540,7 +540,7 @@ extern "C" void privateSnippetExecutor( ... ) "stfd 11, 80(%1)\t\n" "stfd 12, 88(%1)\t\n" "stfd 13, 96(%1)\t\n" - : : "r" (gpreg), "r" (fpreg) + : : "r" (gpreg), "r" (fpreg) : "r0", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "fr1", "fr2", "fr3", "fr4", "fr5", "fr6", "fr7", "fr8", "fr9", "fr10", "fr11", "fr12", "fr13" @@ -564,7 +564,7 @@ extern "C" void privateSnippetExecutor( ... ) break; case typelib_TypeClass_BOOLEAN: case typelib_TypeClass_BYTE: - __asm__( "lbz 3,%0\n\t" + __asm__( "lbz 3,%0\n\t" : : "m" (nRegReturn[0]) ); break; case typelib_TypeClass_CHAR: @@ -586,15 +586,15 @@ extern "C" void privateSnippetExecutor( ... ) : : "m"(nRegReturn[0]) ); break; case typelib_TypeClass_FLOAT: - __asm__( "lfs 1,%0\n\t" + __asm__( "lfs 1,%0\n\t" : : "m" (*((float*)nRegReturn)) ); break; case typelib_TypeClass_DOUBLE: - __asm__( "lfd 1,%0\n\t" + __asm__( "lfd 1,%0\n\t" : : "m" (*((double*)nRegReturn)) ); break; default: - __asm__( "ld 3,%0\n\t" + __asm__( "ld 3,%0\n\t" : : "m" (nRegReturn[0]) ); break; } @@ -602,7 +602,7 @@ extern "C" void privateSnippetExecutor( ... ) const int codeSnippetSize = 24; -unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, +unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, bool simpleRetType) { #ifdef CMC_DEBUG @@ -619,7 +619,7 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 nFunctionIndex, sa memcpy(raw, (char*) privateSnippetExecutor, 16); raw[2] = (void*) nOffsetAndIndex; #ifdef CMC_DEBUG - fprintf(stderr, "in: offset/index is %x %x %d, %lx\n", + fprintf(stderr, "in: offset/index is %x %x %d, %lx\n", nFunctionIndex, nVtableOffset, !simpleRetType, raw[2]); #endif return (code + codeSnippetSize); diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx index c0de95532515..ea6961092f1a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/share.hxx index 38ed48ee06c8..0ec8ec2666f4 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,25 +49,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx index 04ceddab4c5f..23796ca1cbb4 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -84,8 +84,8 @@ void MapReturn(long r3, double dret, typelib_TypeClass eTypeClass, void *pRegist namespace { //================================================================================================== -static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, - void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, +static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, + void * pRegisterReturn, typelib_TypeDescription * pReturnTypeDescr, sal_uInt64 *pStack, sal_uInt32 nStack, sal_uInt64 *pGPR, sal_uInt32 nGPR, double *pFPR, sal_uInt32 nFPR) @@ -107,7 +107,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, for ( int i = 0; i < nGPR; ++i ) fprintf( stderr, "0x%lx, ", pGPR[i] ); fprintf( stderr, "\nFPR's (%d): ", nFPR ); - for ( int i = 0; i < nFPR; ++i ) + for ( int i = 0; i < nFPR; ++i ) fprintf( stderr, "0x%lx (%f), ", pFPR[i], pFPR[i] ); fprintf( stderr, "\nStack (%d): ", nStack ); for ( int i = 0; i < nStack; ++i ) @@ -238,7 +238,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, if (bOverFlow) \ *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV ); -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -255,12 +255,12 @@ static void cpp_call( double pFPR[ppc64::MAX_SSE_REGS]; sal_uInt32 nFPR = 0; - + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion bool bOverFlow = false; @@ -295,19 +295,19 @@ static void cpp_call( #endif INSERT_INT64( &pAdjustedThisPtr, nGPR, pGPR, pStack, bOverFlow ); - // Args + // Args void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams ); // indizes of values this have to be converted (interface conversion cpp<=>uno) sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; #ifdef CMC_DEBUG fprintf(stderr, "n params is %d\n", nParams); #endif - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -318,10 +318,10 @@ static void cpp_call( fprintf(stderr, "param %d is %d %d %d\n", nPos, rParam.bOut, bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr ), pParamTypeDescr->eTypeClass); #endif - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { -// uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, +// uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, uno_copyAndConvertData( pCppArgs[nPos] = pStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); switch (pParamTypeDescr->eTypeClass) @@ -360,7 +360,7 @@ static void cpp_call( // no longer needed TYPELIB_DANGER_RELEASE( pParamTypeDescr ); - + } else // ptr to complex value | ref { @@ -375,7 +375,7 @@ static void cpp_call( // cpp out is constructed mem, uno out is not! uno_constructData( pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), - pParamTypeDescr ); + pParamTypeDescr ); pTempIndizes[nTempIndizes] = nPos; // default constructed for cpp call // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -406,24 +406,24 @@ static void cpp_call( INSERT_INT64( &(pCppArgs[nPos]), nGPR, pGPR, pStack, bOverFlow ); } } - + try { callVirtualMethod( pAdjustedThisPtr, aVtableSlot.index, - pCppReturn, pReturnTypeDescr, + pCppReturn, pReturnTypeDescr, pStackStart, ( pStack - pStackStart ), pGPR, nGPR, pFPR, nFPR ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -440,7 +440,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -454,9 +454,9 @@ static void cpp_call( catch (...) { // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -480,10 +480,10 @@ void unoInterfaceProxyDispatch( void * pReturn, void * pArgs[], uno_Any ** ppException ) { // is my surrogate - bridges::cpp_uno::shared::UnoInterfaceProxy * pThis + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -510,14 +510,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; //get then set method cpp_call( @@ -525,10 +525,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -560,7 +560,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -590,7 +590,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx index f259387a98bf..9e6e9bda3e55 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,7 +44,7 @@ using namespace ::com::sun::star::uno; -namespace +namespace { static typelib_TypeClass cpp2uno_call( @@ -55,10 +55,10 @@ static typelib_TypeClass cpp2uno_call( void ** gpreg, void ** fpreg, void ** ovrflw, sal_Int64 * pRegisterReturn /* space for register return */ ) { - int ng = 0; //number of gpr registers used + int ng = 0; //number of gpr registers used int nf = 0; //number of fpr regsiters used void ** pCppStack; //temporary stack pointer - + // gpreg: [ret *], this, [gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -67,10 +67,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -82,14 +82,14 @@ static typelib_TypeClass cpp2uno_call( pCppReturn = *(void **)gpreg; gpreg++; ng++; - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn); // direct way } } // pop this - gpreg++; + gpreg++; ng++; // stack space @@ -101,9 +101,9 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -133,8 +133,8 @@ static typelib_TypeClass cpp2uno_call( // fpreg are all double values so need to // modify fpreg to be a single word float value if (nf < 2) { -// float tmp = (float) (*((double *)fpreg)); -// (*((float *) fpreg)) = tmp; +// float tmp = (float) (*((double *)fpreg)); +// (*((float *) fpreg)) = tmp; pCppArgs[nPos] = fpreg; pUnoArgs[nPos] = fpreg; nf++; @@ -211,7 +211,7 @@ static typelib_TypeClass cpp2uno_call( else // ptr to complex value | ref { - if (ng < 5) { + if (ng < 5) { pCppArgs[nPos] = *(void **)gpreg; pCppStack = gpreg; ng++; @@ -248,14 +248,14 @@ static typelib_TypeClass cpp2uno_call( } } } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -263,14 +263,14 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -282,7 +282,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -292,7 +292,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -330,7 +330,7 @@ static typelib_TypeClass cpp_mediate( sal_Int16 nVtableOffset = (nOffsetAndIndex >> 16); sal_Int16 nFunctionIndex = (nOffsetAndIndex & 0xFFFF); - + // gpreg: [ret *], this, [other gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -348,14 +348,14 @@ static typelib_TypeClass cpp_mediate( } pThis = static_cast< char * >(pThis) - nVtableOffset; - + bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -363,14 +363,14 @@ static typelib_TypeClass cpp_mediate( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pCppI ); } - + // determine called method OSL_ENSURE( nVtableCall < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + typelib_TypeClass eRet; switch (aMemberDescr.get()->eTypeClass) { @@ -391,9 +391,9 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -424,9 +424,9 @@ static typelib_TypeClass cpp_mediate( XInterface * pInterface = 0; (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), - (void **)&pInterface, pCppI->getOid().pData, + (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -484,10 +484,10 @@ static void privateSnippetExecutor( sal_uInt32 nOffsetAndIndex, void** gpregptr, volatile long nRegReturn[2]; - typelib_TypeClass aType = - cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, ovrflw, + typelib_TypeClass aType = + cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, ovrflw, (sal_Int64*)nRegReturn ); - + switch( aType ) { @@ -560,7 +560,7 @@ unsigned char* codeSnippet( unsigned char * code, sal_Int16 nFunctionIndex, sal_ /* generate this code */ // lr %r0,%r13 // bras %r13,0x6 - // .long privateSnippetExecutor + // .long privateSnippetExecutor // .long nOffsetAndIndex // stm %r2,%r6,8(%r15) // std %f0,64(%r15) @@ -569,7 +569,7 @@ unsigned char* codeSnippet( unsigned char * code, sal_Int16 nFunctionIndex, sal_ // l %r2,4(%r13) // la %r3,8(%r15) // la %r4,64(%r15) - // la %r5,96(%r15) + // la %r5,96(%r15) // l %r1,0(%r13) // lr %r13,%r0 // br %r1 diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx index c0de95532515..ea6961092f1a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/share.hxx b/bridges/source/cpp_uno/gcc3_linux_s390/share.hxx index 4ec09c29ff0a..aa802babac96 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,25 +49,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx index a87cc8e182c8..6c8dc7d9d3d5 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -93,7 +93,7 @@ static void //invoke_copy_to_stack(sal_Int32 paramCount, sal_Int32 * pStackLongs, char * pPT, sal_Int32* d_ov, sal_Int32 overflow) invoke_copy_to_stack(sal_Int32 * pStackLongs, char * pPT, sal_Int32* d_ov, sal_Int32 overflow) { - sal_Int32 *d_gpr = d_ov + overflow; + sal_Int32 *d_gpr = d_ov + overflow; sal_Int64 *d_fpr = (sal_Int64 *)(d_gpr + 5); sal_Int32 gpr = 0, fpr = 0; char c; @@ -192,7 +192,7 @@ static void callVirtualMethod( // reference parameters are pointers // the basic idea here is to use gpr[5] as a storage area for - // the future values of registers r2 to r6 needed for the call, + // the future values of registers r2 to r6 needed for the call, // and similarly fpr[2] as a storage area for the future values // of floating point registers f0 to f2 @@ -228,23 +228,23 @@ static void callVirtualMethod( "ld 0,116(7)\n\t" "ld 2,124(7)\n\t" "lm 2,6,96(7)\n\t" - : + : : "r" (pStackLongs), - "r" (pPT), + "r" (pPT), "r" (overflow), "a" (invoke_copy_to_stack), "a" (method), "X" (dummy) : "2", "3", "4", "5", "6", "7", "memory" ); -// "basr 14,%8\n\t" +// "basr 14,%8\n\t" (*(void (*)())method)(); __asm__ __volatile__ ( - "la 15,48(7)\n\t" - + "la 15,48(7)\n\t" + "lr %2,2\n\t" "lr %3,3\n\t" "ler %0,0\n\t" @@ -257,7 +257,7 @@ static void callVirtualMethod( { case typelib_TypeClass_HYPER: case typelib_TypeClass_UNSIGNED_HYPER: -// ((long*)pRegisterReturn)[0] = iret; +// ((long*)pRegisterReturn)[0] = iret; ((long*)pRegisterReturn)[1] = iret2; case typelib_TypeClass_LONG: case typelib_TypeClass_UNSIGNED_LONG: @@ -283,7 +283,7 @@ static void callVirtualMethod( } -//============================================================================ +//============================================================================ static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -292,10 +292,10 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // need to know parameter types for callVirtualMethod so generate a signature string char * pParamType = (char *) alloca(nParams+2); char * pPT = pParamType; @@ -304,9 +304,9 @@ static void cpp_call( typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -337,15 +337,15 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, @@ -416,7 +416,7 @@ static void cpp_call( uno_copyAndConvertData( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -432,7 +432,7 @@ static void cpp_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // terminate the signature string *pPT++='X'; *pPT=0; @@ -446,13 +446,13 @@ static void cpp_call( (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -469,7 +469,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -483,10 +483,10 @@ static void cpp_call( catch (...) { // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -511,13 +511,13 @@ void unoInterfaceProxyDispatch( #ifdef CMC_DEBUG fprintf(stderr, "unoInterfaceProxyDispatch\n"); #endif - + // is my surrogate - bridges::cpp_uno::shared::UnoInterfaceProxy * pThis + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -544,14 +544,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; //get then set method cpp_call( @@ -559,10 +559,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -594,7 +594,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -624,7 +624,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx index b491f661bff9..39d9fe482fbe 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,7 +43,7 @@ using namespace ::com::sun::star::uno; -namespace +namespace { static typelib_TypeClass cpp2uno_call( bridges::cpp_uno::shared::CppInterfaceProxy * pThis, @@ -56,9 +56,9 @@ static typelib_TypeClass cpp2uno_call( #ifdef CMC_DEBUG fprintf(stderr, "as far as cpp2uno_call\n"); #endif - int ng = 0; //number of gpr registers used + int ng = 0; //number of gpr registers used int nf = 0; //number of fpr regsiters used - + // gpreg: [ret *], this, [gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -67,10 +67,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -82,14 +82,14 @@ static typelib_TypeClass cpp2uno_call( pCppReturn = *(void **)gpreg; gpreg++; ng++; - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn); // direct way } } // pop this - gpreg++; + gpreg++; ng++; // stack space @@ -101,7 +101,7 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { @@ -210,7 +210,7 @@ static typelib_TypeClass cpp2uno_call( void *pCppStack; //temporary stack pointer if (ng < s390x::MAX_GPR_REGS) - { + { pCppArgs[nPos] = pCppStack = *gpreg++; ng++; } @@ -250,14 +250,14 @@ static typelib_TypeClass cpp2uno_call( #ifdef CMC_DEBUG fprintf(stderr, "end of params\n"); #endif - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -265,14 +265,14 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -284,7 +284,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -294,7 +294,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -351,7 +351,7 @@ static typelib_TypeClass cpp_mediate( } #endif - + // gpreg: [ret *], this, [other gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (properly aligned)] @@ -369,14 +369,14 @@ static typelib_TypeClass cpp_mediate( } pThis = static_cast< char * >(pThis) - nVtableOffset; - + bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -384,14 +384,14 @@ static typelib_TypeClass cpp_mediate( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pCppI ); } - + // determine called method OSL_ENSURE( nVtableCall < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + typelib_TypeClass eRet; switch (aMemberDescr.get()->eTypeClass) { @@ -414,7 +414,7 @@ static typelib_TypeClass cpp_mediate( ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; aParam.bIn = sal_True; aParam.bOut = sal_False; - + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -445,9 +445,9 @@ static typelib_TypeClass cpp_mediate( XInterface * pInterface = 0; (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), - (void **)&pInterface, pCppI->getOid().pData, + (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -510,8 +510,8 @@ long privateSnippetExecutor(long r2, long r3, long r4, long r5, long r6, long fi fprintf(stderr, "before mediate with %lx\n",nOffsetAndIndex); fprintf(stderr, "doubles are %f %f %f %f\n", fpreg[0], fpreg[1], fpreg[2], fpreg[3]); #endif - typelib_TypeClass aType = - cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, (void**)sp, + typelib_TypeClass aType = + cpp_mediate( nOffsetAndIndex, (void**)gpreg, (void**)fpreg, (void**)sp, (sal_Int64*)nRegReturn ); #ifdef CMC_DEBUG fprintf(stderr, "after mediate ret is %lx %ld\n", nRegReturn[0], nRegReturn[0]); diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx index c0de95532515..ea6961092f1a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/share.hxx b/bridges/source/cpp_uno/gcc3_linux_s390x/share.hxx index 69176377606b..1abf8cb08aa6 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,25 +49,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx index d3fec618c301..1e7421dcdc87 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -206,7 +206,7 @@ void callVirtualMethod( } -//============================================================================ +//============================================================================ static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -223,12 +223,12 @@ static void cpp_call( double pFPR[s390x::MAX_SSE_REGS]; sal_uInt32 nFPR = 0; - + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion if (pReturnTypeDescr) @@ -259,15 +259,15 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, @@ -324,7 +324,7 @@ static void cpp_call( uno_copyAndConvertData( pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -338,7 +338,7 @@ static void cpp_call( INSERT_INT64( &(pCppArgs[nPos]), nGPR, pGPR, pStack ); } } - + try { callVirtualMethod( @@ -349,13 +349,13 @@ static void cpp_call( pFPR, nFPR ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -372,7 +372,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -386,10 +386,10 @@ static void cpp_call( catch (...) { // fill uno exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -414,12 +414,12 @@ void unoInterfaceProxyDispatch( #ifdef CMC_DEBUG fprintf(stderr, "unoInterfaceProxyDispatch\n"); #endif - + // is my surrogate - bridges::cpp_uno::shared::UnoInterfaceProxy * pThis + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -453,7 +453,7 @@ void unoInterfaceProxyDispatch( OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; //get then set method cpp_call( @@ -461,10 +461,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -496,7 +496,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -526,7 +526,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx index 1546432e5980..25f62a08ef1b 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,10 +57,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -87,9 +87,9 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -156,14 +156,14 @@ static typelib_TypeClass cpp2uno_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)(pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -171,7 +171,7 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); @@ -190,7 +190,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -200,7 +200,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -230,9 +230,9 @@ static typelib_TypeClass cpp2uno_call( //================================================================================================== static typelib_TypeClass cpp_mediate( - sal_Int32 nFunctionIndex, - sal_Int32 nVtableOffset, - void ** pCallStack, + sal_Int32 nFunctionIndex, + sal_Int32 nVtableOffset, + void ** pCallStack, sal_Int64 * pRegisterReturn /* space for register return */ ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); @@ -259,7 +259,7 @@ static typelib_TypeClass cpp_mediate( { throw RuntimeException( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pCppI ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); @@ -291,9 +291,9 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -325,7 +325,7 @@ static typelib_TypeClass cpp_mediate( (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -381,8 +381,8 @@ void * pRegReturn = &nRegReturn; "st %%i2, %2\n\t" : : "m"(nFunctionIndex), "m"(pCallStack), "m"(vTableOffset) ); -// fprintf(stderr,"cpp_mediate nFunctionIndex=%x\n",nFunctionIndex); -// fflush(stderr); +// fprintf(stderr,"cpp_mediate nFunctionIndex=%x\n",nFunctionIndex); +// fflush(stderr); sal_Bool bComplex = nFunctionIndex & 0x80000000 ? sal_True : sal_False; typelib_TypeClass aType = diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx index 6e61196df98e..4556172651cf 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,7 +55,7 @@ using namespace ::__cxxabiv1; namespace CPPU_CURRENT_NAMESPACE { - + void dummy_can_throw_anything( char const * ) { } @@ -66,13 +66,13 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) #if defined BRIDGES_DEBUG char const * start = p; #endif - + // example: N3com3sun4star4lang24IllegalArgumentExceptionE - + OUStringBuffer buf( 64 ); OSL_ASSERT( 'N' == *p ); ++p; // skip N - + while ('E' != *p) { // read chars count @@ -87,7 +87,7 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) if ('E' != *p) buf.append( (sal_Unicode)'.' ); } - + #if defined BRIDGES_DEBUG OUString ret( buf.makeStringAndClear() ); OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) ); @@ -102,17 +102,17 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) class RTTI { typedef hash_map< OUString, type_info *, OUStringHash > t_rtti_map; - + Mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; void * m_hApp; - + public: RTTI() SAL_THROW( () ); ~RTTI() SAL_THROW( () ); - + type_info * getRTTI( typelib_CompoundTypeDescription * ) SAL_THROW( () ); }; //__________________________________________________________________________________________________ @@ -130,9 +130,9 @@ RTTI::~RTTI() SAL_THROW( () ) type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () ) { type_info * rtti; - + OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - + MutexGuard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) @@ -150,7 +150,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR } while (index >= 0); buf.append( 'E' ); - + OString symName( buf.makeStringAndClear() ); rtti = (type_info *)dlsym( m_hApp, symName.getStr() ); @@ -186,7 +186,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR // this class has no base class rtti = new __class_type_info( strdup( rttiName ) ); } - + pair< t_rtti_map::iterator, bool > insertion( m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); @@ -201,7 +201,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR { rtti = iFind->second; } - + return rtti; } @@ -245,10 +245,10 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ), Reference< XInterface >() ); } - + pCppExc = __cxa_allocate_exception( pTypeDescr->nSize ); ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); - + // destruct uno exception ::uno_any_destruct( pUnoExc, 0 ); // avoiding locked counts @@ -277,7 +277,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) Reference< XInterface >() ); } } - + __cxa_throw( pCppExc, rtti, deleteException ); } @@ -297,7 +297,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping #endif return; } - + typelib_TypeDescription * pExcTypeDescr = 0; OUString unoName( toUNOname( header->exceptionType->name() ) ); #if defined BRIDGES_DEBUG diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/share.hxx b/bridges/source/cpp_uno/gcc3_linux_sparc/share.hxx index 3526f19082cd..eb1cb12f53a9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,25 +43,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx index 0cf6d21c80e7..02f951a59381 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -107,7 +107,7 @@ void callVirtualMethod( void * pAdjustedThisPtr, "mov %%l1, %%l7\n\t" // increase our own stackframe if necessary - "mov %%sp, %%l3\n\t" // save stack ptr for readjustment + "mov %%sp, %%l3\n\t" // save stack ptr for readjustment "subcc %%i5, 7, %%l0\n\t" "ble .LmoveOn\n\t" @@ -115,14 +115,14 @@ void callVirtualMethod( void * pAdjustedThisPtr, "sll %%l0, 2, %%l0\n\t" "add %%l0, 96, %%l0\n\t" - "mov %%sp, %%l1\n\t" // old stack ptr - "sub %%sp, %%l0, %%l0\n\t" // future stack ptr - "andcc %%l0, 7, %%g0\n\t" // align stack to 8 + "mov %%sp, %%l1\n\t" // old stack ptr + "sub %%sp, %%l0, %%l0\n\t" // future stack ptr + "andcc %%l0, 7, %%g0\n\t" // align stack to 8 "be .LisAligned\n\t" "nop\n\t" "sub %%l0, 4, %%l0\n" ".LisAligned:\n\t" - "mov %%l0, %%o5\n\t" // save newly computed stack ptr + "mov %%l0, %%o5\n\t" // save newly computed stack ptr "add %%g0, 16, %%o4\n" // now copy longs down to save register window @@ -135,11 +135,11 @@ void callVirtualMethod( void * pAdjustedThisPtr, "subcc %%o4, 1, %%o4\n\t" "bne .LcopyDown\n\t" - "mov %%o5, %%sp\n\t" // move new stack ptr (hopefully) atomically + "mov %%o5, %%sp\n\t" // move new stack ptr (hopefully) atomically // while register window is valid in both spaces // (scheduling might hit in copyDown loop) - "sub %%i5, 7, %%l0\n\t" // copy parameters past the sixth to stack + "sub %%i5, 7, %%l0\n\t" // copy parameters past the sixth to stack "add %%i4, 28, %%l1\n\t" "add %%sp, 92, %%l2\n" ".LcopyLong:\n\t" @@ -152,10 +152,10 @@ void callVirtualMethod( void * pAdjustedThisPtr, "nop\n" ".LmoveOn:\n\t" - "mov %%i5, %%l0\n\t" // prepare out registers + "mov %%i5, %%l0\n\t" // prepare out registers "mov %%i4, %%l1\n\t" - "ld [%%l1], %%o0\n\t" // prepare complex return ptr + "ld [%%l1], %%o0\n\t" // prepare complex return ptr "st %%o0, [%%sp+64]\n\t" "sub %%l0, 1, %%l0\n\t" "add %%l1, 4, %%l1\n\t" @@ -193,20 +193,20 @@ void callVirtualMethod( void * pAdjustedThisPtr, "ld [%%l1], %%o5\n" ".LdoCall:\n\t" - "ld [%%i0], %%l0\n\t" // get vtable ptr + "ld [%%i0], %%l0\n\t" // get vtable ptr "sll %%i1, 2, %%l6\n\t" // "add %%l6, 8, %%l6\n\t" "add %%l6, %%l0, %%l0\n\t" -// // vtable has 8byte wide entries, -// // upper half contains 2 half words, of which the first -// // is the this ptr patch ! -// // first entry is (or __tf) +// // vtable has 8byte wide entries, +// // upper half contains 2 half words, of which the first +// // is the this ptr patch ! +// // first entry is (or __tf) -// "ldsh [%%l0], %%l6\n\t" // load this ptr patch -// "add %%l6, %%o0, %%o0\n\t" // patch this ptr +// "ldsh [%%l0], %%l6\n\t" // load this ptr patch +// "add %%l6, %%o0, %%o0\n\t" // patch this ptr -// "add %%l0, 4, %%l0\n\t" // get virtual function ptr +// "add %%l0, 4, %%l0\n\t" // get virtual function ptr "ld [%%l0], %%l0\n\t" "ld [%%i4], %%l2\n\t" @@ -223,8 +223,8 @@ void callVirtualMethod( void * pAdjustedThisPtr, "unimp\n" ".LcallReturned:\n\t" - "mov %%l3, %%sp\n\t" // readjust stack so that our locals are where they belong - "st %%o0, %0\n\t" // save possible return registers into our locals + "mov %%l3, %%sp\n\t" // readjust stack so that our locals are where they belong + "st %%o0, %0\n\t" // save possible return registers into our locals "st %%o1, %1\n\t" "std %%f0, %2\n\t" "st %%f0, %3\n\t" @@ -289,17 +289,17 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: complex ret ptr, this, values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( (nParams+2) * sizeof(sal_Int64) ); - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -330,9 +330,9 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -341,7 +341,7 @@ static void cpp_call( if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { pCppArgs[ nPos ] = CPPU_CURRENT_NAMESPACE::adjustPointer(pCppStack, pParamTypeDescr ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -383,7 +383,7 @@ static void cpp_call( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -402,7 +402,7 @@ static void cpp_call( { int nStackLongs = (pCppStack - pCppStackStart)/sizeof(sal_Int32); OSL_ENSURE( !( (pCppStack - pCppStackStart ) & 3), "UNALIGNED STACK !!! (Please DO panic" ); - + if( nStackLongs & 1 ) // stack has to be 8 byte aligned nStackLongs++; @@ -421,7 +421,7 @@ static void cpp_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -438,7 +438,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -452,7 +452,7 @@ static void cpp_call( catch( ... ) { // get exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); // temporary params @@ -481,12 +481,12 @@ void unoInterfaceProxyDispatch( OString cstr( OUStringToOString( pMemberDescr->pTypeName, RTL_TEXTENCODING_ASCII_US ) ); fprintf( stderr, "received dispatch( %s )\n", cstr.getStr() ); #endif - + // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); -// typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; - +// typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -511,14 +511,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -529,7 +529,7 @@ void unoInterfaceProxyDispatch( typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -560,7 +560,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -590,7 +590,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx index e62f71d2c32a..57e135933b79 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,8 +38,8 @@ /* ----------------------------------------------------------------------- ffi.c - Copyright (c) 2002 Bo Thorsen <bo@suse.de> - - x86-64 Foreign Function Interface + + x86-64 Foreign Function Interface Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx index c9f71f18078b..b37a9daa5fa3 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/abi.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,7 +48,7 @@ const sal_uInt32 MAX_SSE_REGS = 8; Examine the argument and return set number of register required in each class. - + Return false iff parameter should be passed in memory. */ bool examine_argument( typelib_TypeDescriptionReference *pTypeRef, bool bInReturn, int &nUsedGPR, int &nUsedSSE ); diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx index 512b7d1f3f34..a208c2f10786 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -77,22 +77,22 @@ static typelib_TypeClass cpp2uno_call( { unsigned int nr_gpr = 0; //number of gpr registers used unsigned int nr_fpr = 0; //number of fpr registers used - + // return typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if ( pReturnTypeDescr ) { if ( x86_64::return_in_hidden_param( pReturnTypeRef ) ) { pCppReturn = *gpreg++; nr_gpr++; - + pUnoReturn = ( bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn ); // direct way @@ -102,7 +102,7 @@ static typelib_TypeClass cpp2uno_call( } // pop this - gpreg++; + gpreg++; nr_gpr++; // stack space @@ -113,7 +113,7 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) @@ -159,7 +159,7 @@ static typelib_TypeClass cpp2uno_call( void *pCppStack; if ( nr_gpr < x86_64::MAX_GPR_REGS ) - { + { pCppArgs[nPos] = pCppStack = *gpreg++; nr_gpr++; } @@ -191,14 +191,14 @@ static typelib_TypeClass cpp2uno_call( } } } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if ( pUnoExc ) { @@ -206,14 +206,14 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -225,7 +225,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if ( pParams[nIndex].bOut ) // inout/out { // convert and assign @@ -235,7 +235,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -307,7 +307,7 @@ extern "C" typelib_TypeClass cpp_vtable_call( { case typelib_TypeClass_INTERFACE_ATTRIBUTE: { - typelib_TypeDescriptionReference *pAttrTypeRef = + typelib_TypeDescriptionReference *pAttrTypeRef = reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>( aMemberDescr.get() )->pAttributeTypeRef; if ( pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nFunctionIndex ) @@ -322,8 +322,8 @@ extern "C" typelib_TypeClass cpp_vtable_call( // is SET method typelib_MethodParameter aParam; aParam.pTypeRef = pAttrTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -501,7 +501,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( { typelib_InterfaceMethodTypeDescription *pMethodTD = reinterpret_cast<typelib_InterfaceMethodTypeDescription *>( pTD ); - + (s++)->fn = code + writetoexecdiff; code = codeSnippet( code, nFunctionOffset++, nVtableOffset, x86_64::return_in_hidden_param( pMethodTD->pReturnTypeRef ) ); diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx index 759f28764fa7..dd41ad1bdbd7 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ using namespace ::__cxxabiv1; namespace CPPU_CURRENT_NAMESPACE { - + void dummy_can_throw_anything( char const * ) { } @@ -68,13 +68,13 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) #if OSL_DEBUG_LEVEL > 1 char const * start = p; #endif - + // example: N3com3sun4star4lang24IllegalArgumentExceptionE - + OUStringBuffer buf( 64 ); OSL_ASSERT( 'N' == *p ); ++p; // skip N - + while ('E' != *p) { // read chars count @@ -89,7 +89,7 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) if ('E' != *p) buf.append( (sal_Unicode)'.' ); } - + #if OSL_DEBUG_LEVEL > 1 OUString ret( buf.makeStringAndClear() ); OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) ); @@ -104,17 +104,17 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) class RTTI { typedef hash_map< OUString, type_info *, OUStringHash > t_rtti_map; - + Mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; void * m_hApp; - + public: RTTI() SAL_THROW( () ); ~RTTI() SAL_THROW( () ); - + type_info * getRTTI( typelib_CompoundTypeDescription * ) SAL_THROW( () ); }; //__________________________________________________________________________________________________ @@ -136,9 +136,9 @@ RTTI::~RTTI() SAL_THROW( () ) type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () ) { type_info * rtti; - + OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - + MutexGuard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) @@ -156,7 +156,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR } while (index >= 0); buf.append( 'E' ); - + OString symName( buf.makeStringAndClear() ); #if defined(FREEBSD) && __FreeBSD_version < 702104 /* #i22253# */ rtti = (type_info *)dlsym( RTLD_DEFAULT, symName.getStr() ); @@ -196,7 +196,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR // this class has no base class rtti = new __class_type_info( strdup( rttiName ) ); } - + pair< t_rtti_map::iterator, bool > insertion( m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); @@ -211,7 +211,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR { rtti = iFind->second; } - + return rtti; } diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx index da2367ad172b..e4a6b379a840 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,25 +48,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx index 767961b9c691..90acb02ff5db 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -114,7 +114,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, double xmm1; asm volatile ( - + // Fill the xmm registers "movq %2, %%rax\n\t" @@ -196,7 +196,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, } } -//================================================================================================== +//================================================================================================== // Macros for easier insertion of values to registers or stack // pSV - pointer to the source @@ -236,7 +236,7 @@ static void callVirtualMethod(void * pThis, sal_uInt32 nVtableIndex, else \ *pDS++ = *reinterpret_cast<sal_uInt8 *>( pSV ); -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, @@ -260,10 +260,10 @@ static void cpp_call( typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion (see below) - bool bSimpleReturn = true; + bool bSimpleReturn = true; if ( pReturnTypeDescr ) { if ( x86_64::return_in_hidden_param( pReturnTypeRef ) ) @@ -290,20 +290,20 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // Type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -353,7 +353,7 @@ static void cpp_call( uno_copyAndConvertData( pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -367,7 +367,7 @@ static void cpp_call( INSERT_INT64( &(pCppArgs[nPos]), nGPR, pGPR, pStack ); } } - + try { callVirtualMethod( @@ -378,13 +378,13 @@ static void cpp_call( pFPR, nFPR ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -401,7 +401,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -416,7 +416,7 @@ static void cpp_call( { // fill uno exception fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -445,7 +445,7 @@ void unoInterfaceProxyDispatch( #if OSL_DEBUG_LEVEL > 0 typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; #endif - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -460,7 +460,7 @@ void unoInterfaceProxyDispatch( reinterpret_cast< typelib_InterfaceAttributeTypeDescription const * >( pMemberDescr))); - + if (pReturn) { // dependent dispatch @@ -476,14 +476,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -491,10 +491,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -509,7 +509,7 @@ void unoInterfaceProxyDispatch( reinterpret_cast< typelib_InterfaceMethodTypeDescription const * >( pMemberDescr))); - + switch (aVtableSlot.index) { // standard calls @@ -531,7 +531,7 @@ void unoInterfaceProxyDispatch( (*pThis->getBridge()->getUnoEnv()->getRegisteredInterface)( pThis->getBridge()->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -561,7 +561,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_intel/cpp2uno.cxx index 11c1d0f10db2..2d406af78518 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_intel/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -66,10 +66,10 @@ void cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { // xxx todo: test PolyStructy<STRUCT<long>> foo() @@ -99,9 +99,9 @@ void cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -158,7 +158,7 @@ void cpp2uno_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; @@ -166,7 +166,7 @@ void cpp2uno_call( // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -174,14 +174,14 @@ void cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any @@ -193,7 +193,7 @@ void cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -203,7 +203,7 @@ void cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -236,7 +236,7 @@ extern "C" void cpp_vtable_call( void * pReturnValue ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); - + // pCallStack: ret adr, [ret *], this, params void * pThis; if( nFunctionIndex & 0x80000000 ) @@ -254,11 +254,11 @@ extern "C" void cpp_vtable_call( pThis); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "%p %p %p pThis=%p, pCppI=%p, function index=%d, vtable offset=%d\n", pCallStack[0], pCallStack[1], pCallStack[2], pThis, pCppI, nFunctionIndex, nVtableOffset ); -#endif +#endif typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); #if OSL_DEBUG_LEVEL > 1 fprintf( stderr, "name=%s\n", rtl::OUStringToOString(pTypeDescr->aBase.pTypeName, RTL_TEXTENCODING_UTF8).getStr() ); -#endif +#endif OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -266,7 +266,7 @@ extern "C" void cpp_vtable_call( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); @@ -274,7 +274,7 @@ extern "C" void cpp_vtable_call( TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); #if OSL_DEBUG_LEVEL > 1 fprintf(stderr, "calling %s\n", rtl::OUStringToOString(aMemberDescr.get()->pTypeName, RTL_TEXTENCODING_UTF8).getStr()); -#endif +#endif switch (aMemberDescr.get()->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -294,9 +294,9 @@ extern "C" void cpp_vtable_call( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -327,7 +327,7 @@ extern "C" void cpp_vtable_call( pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_intel/except.cxx index c8cc3cd17257..b6e170236d9d 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_intel/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/share.hxx b/bridges/source/cpp_uno/gcc3_macosx_intel/share.hxx index 8b105c0880b3..8fa373310d69 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_intel/share.hxx +++ b/bridges/source/cpp_uno/gcc3_macosx_intel/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,25 +50,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx index aaf696608e41..8610c3cf50d8 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_intel/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -73,11 +73,11 @@ void callVirtualMethod( { // parameter list is mixed list of * and values // reference parameters are pointers - + OSL_ENSURE( pStackLongs && pAdjustedThisPtr, "### null ptr!" ); OSL_ENSURE( (sizeof(void *) == 4) && (sizeof(sal_Int32) == 4), "### unexpected size of int!" ); OSL_ENSURE( nStackLongs && pStackLongs, "### no stack in callVirtualMethod !" ); - + // never called if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something @@ -159,7 +159,7 @@ void callVirtualMethod( } } -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -168,18 +168,18 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion bool bSimpleReturn = true; - + if (pReturnTypeDescr) { bSimpleReturn = CPPU_CURRENT_NAMESPACE::isSimpleReturnType( @@ -213,21 +213,21 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -260,7 +260,7 @@ static void cpp_call( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -284,13 +284,13 @@ static void cpp_call( (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -307,7 +307,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -325,7 +325,7 @@ static void cpp_call( #endif // fill uno exception fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -379,7 +379,7 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -404,14 +404,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -419,10 +419,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -453,7 +453,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -483,7 +483,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx index f3515a86ea08..e80a2a017459 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ static typelib_TypeClass cpp2uno_call( void ** gpreg, void ** fpreg, void ** ovrflw, sal_Int64 * pRegisterReturn /* space for register return */ ) { - + // gpreg: [ret *], this, [gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (space for entire parameter list in structure format properly aligned)] @@ -63,10 +63,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + sal_Int32 ngpreg = 0; sal_Int32 nfpreg = 0; @@ -80,7 +80,7 @@ static typelib_TypeClass cpp2uno_call( pCppReturn = *gpreg; ngpreg++; ++ovrflw; - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn); // direct way @@ -92,7 +92,7 @@ static typelib_TypeClass cpp2uno_call( // after handling optional return pointer and "this" // make use of the space that is allocated to store all parameters in the callers stack - // by comying the proper registers filled with parameters to that space + // by comying the proper registers filled with parameters to that space char * pCppStack = (char *)ovrflw; @@ -120,7 +120,7 @@ static typelib_TypeClass cpp2uno_call( } pCppStack += sizeof (float); ngpreg += 1; - break; + break; case typelib_TypeClass_DOUBLE: if (nfpreg < 13) { @@ -128,7 +128,7 @@ static typelib_TypeClass cpp2uno_call( } pCppStack += sizeof (double); ngpreg += 2; - break; + break; case typelib_TypeClass_UNSIGNED_HYPER: case typelib_TypeClass_HYPER: if (ngpreg < 8) @@ -163,16 +163,16 @@ static typelib_TypeClass cpp2uno_call( // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) // value { switch (pParamTypeDescr->eTypeClass) @@ -233,16 +233,16 @@ static typelib_TypeClass cpp2uno_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - - + + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call - (*pThis->getUnoI()->pDispatcher)( + (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -250,16 +250,16 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - - CPPU_CURRENT_NAMESPACE::raiseException( - &aUnoExc, pThis->getBridge()->getUno2Cpp() ); + + CPPU_CURRENT_NAMESPACE::raiseException( + &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any // is here for dummy return typelib_TypeClass_VOID; @@ -271,7 +271,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -281,7 +281,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -317,7 +317,7 @@ static typelib_TypeClass cpp_mediate( sal_Int64 * pRegisterReturn /* space for register return */ ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); - + // gpreg: [ret *], this, [other gpr params] // fpreg: [fpr params] // ovrflw: [gpr or fpr params (in space allocated for all params properly aligned)] @@ -332,14 +332,14 @@ static typelib_TypeClass cpp_mediate( { pThis = gpreg[0]; } - + pThis = static_cast< char * >(pThis) - nVtableOffset; - bridges::cpp_uno::shared::CppInterfaceProxy * pCppI + bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy(pThis); - + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -347,13 +347,13 @@ static typelib_TypeClass cpp_mediate( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + typelib_TypeClass eRet; switch (aMemberDescr.get()->eTypeClass) { @@ -374,9 +374,9 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -408,7 +408,7 @@ static typelib_TypeClass cpp_mediate( (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -455,7 +455,7 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg { sal_Int32 gpreg[8]; double fpreg[13]; - + // FIXME: why are we restoring the volatile ctr register here sal_Int32 ctrsave = ((sal_Int32*)gpregptr)[-1]; @@ -466,9 +466,9 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg // sal_Bool bComplex = nFunctionIndex & 0x80000000 ? sal_True : sal_False; - typelib_TypeClass aType = + typelib_TypeClass aType = cpp_mediate( nFunctionIndex, nVtableOffset, (void**)gpreg, (void**)fpreg, ovrflw, (sal_Int64*)nRegReturn ); - + // FIXME: why are we restoring the volatile ctr register here // FIXME: and why are we putting back the values for r4, r5, and r6 as well // FIXME: this makes no sense to me, all of these registers are volatile! @@ -490,7 +490,7 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg __asm__( "lbz r3,%0\n\t" : : "m"(nRegReturn[0]) ); break; - + case typelib_TypeClass_CHAR: case typelib_TypeClass_SHORT: case typelib_TypeClass_UNSIGNED_SHORT: @@ -523,7 +523,7 @@ static void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** gpreg int const codeSnippetSize = 136; -unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, +unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, sal_Int32 vtableOffset, bool simpleRetType ) { if (! simpleRetType ) @@ -535,17 +535,17 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, // FIXME: is this to allow room for signal handling frames? // FIXME: seems like overkill here but this is what was done for Mac OSX for gcc2 // FIXME: also why no saving of the non-volatile CR pieces here, to be safe - // FIXME: we probably should + // FIXME: we probably should /* generate this code */ // # so first save gpr 3 to gpr 10 (aligned to 4) // stw r3, -8000(r1) // stw r4, -7996(r1) - // stw r5, -7992(r1) + // stw r5, -7992(r1) // stw r6, -7988(r1) // stw r7, -7984(r1) - // stw r8, -7980(r1) + // stw r8, -7980(r1) // stw r9, -7976(r1) // stw r10,-7972(r1) @@ -580,18 +580,18 @@ unsigned char * codeSnippet( unsigned char * code, sal_Int32 functionIndex, // # now load up the vtableOffset // lis r4, 0xdead // ori r4,r4,0xbeef - + // #now load up the pointer to the saved gpr registers // addi r5,r1,-8000 // #now load up the pointer to the saved fpr registers // addi r6,r1,-7968 - + // #now load up the pointer to the overflow call stack - // addi r7,r1,24 # frame pointer plus 24 + // addi r7,r1,24 # frame pointer plus 24 // bctr - + unsigned long * p = (unsigned long *) code; * p++ = 0x9061e0c0; diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx index abc3ad10fc37..fc0720a0e52d 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,7 +55,7 @@ using namespace ::__cxxabiv1; namespace CPPU_CURRENT_NAMESPACE { - + void dummy_can_throw_anything( char const * ) { } @@ -66,13 +66,13 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) #ifdef DEBUG char const * start = p; #endif - + // example: N3com3sun4star4lang24IllegalArgumentExceptionE - + OUStringBuffer buf( 64 ); OSL_ASSERT( 'N' == *p ); ++p; // skip N - + while ('E' != *p) { // read chars count @@ -87,7 +87,7 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) if ('E' != *p) buf.append( (sal_Unicode)'.' ); } - + #ifdef DEBUG OUString ret( buf.makeStringAndClear() ); OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) ); @@ -102,17 +102,17 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) class RTTI { typedef hash_map< OUString, type_info *, OUStringHash > t_rtti_map; - + Mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; void * m_hApp; - + public: RTTI() SAL_THROW( () ); ~RTTI() SAL_THROW( () ); - + type_info * getRTTI( typelib_CompoundTypeDescription * ) SAL_THROW( () ); }; //__________________________________________________________________________________________________ @@ -130,9 +130,9 @@ RTTI::~RTTI() SAL_THROW( () ) type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () ) { type_info * rtti; - + OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - + MutexGuard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) @@ -150,7 +150,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR } while (index >= 0); buf.append( 'E' ); - + OString symName( buf.makeStringAndClear() ); rtti = (type_info *)dlsym( m_hApp, symName.getStr() ); @@ -186,7 +186,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR // this class has no base class rtti = new __class_type_info( strdup( rttiName ) ); } - + pair< t_rtti_map::iterator, bool > insertion( m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); @@ -201,7 +201,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR { rtti = iFind->second; } - + return rtti; } @@ -233,10 +233,10 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) OSL_ASSERT( pTypeDescr ); if (! pTypeDescr) terminate(); - + pCppExc = __cxa_allocate_exception( pTypeDescr->nSize ); ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); - + // destruct uno exception ::uno_any_destruct( pUnoExc, 0 ); // avoiding locked counts @@ -260,7 +260,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) if (! rtti) terminate(); } - + __cxa_throw( pCppExc, rtti, deleteException ); } @@ -270,14 +270,14 @@ void fillUnoException( __cxa_exception * header, uno_Any * pExc, uno_Mapping * p OSL_ENSURE( header, "### no exception header!!!" ); if (! header) terminate(); - + typelib_TypeDescription * pExcTypeDescr = 0; OUString unoName( toUNOname( header->exceptionType->name() ) ); ::typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData ); OSL_ENSURE( pExcTypeDescr, "### can not get type description for exception!!!" ); if (! pExcTypeDescr) terminate(); - + // construct uno exception any ::uno_any_constructAndConvert( pExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno ); ::typelib_typedescription_release( pExcTypeDescr ); diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/share.hxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/share.hxx index 4ec09c29ff0a..aa802babac96 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/share.hxx +++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -49,25 +49,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx index 39388fc602f0..09a1935c4598 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_powerpc/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -64,7 +64,7 @@ static void callVirtualMethod( // reference parameters are pointers // the basic idea here is to use gpr[8] as a storage area for - // the future values of registers r3 to r10 needed for the call, + // the future values of registers r3 to r10 needed for the call, // and similarly fpr[13] as a storage area for the future values // of floating point registers f1 to f13 @@ -91,10 +91,10 @@ static void callVirtualMethod( // FIXME: I do not believe the following is true but we will keep the // FIXME: extra space just to be safe until proven otherwise - - // Note: could require up to 2*nStackLongs words of parameter stack area - // if the call has many float parameters (i.e. floats take up only 1 - // word on the stack but take 2 words in parameter area in the + + // Note: could require up to 2*nStackLongs words of parameter stack area + // if the call has many float parameters (i.e. floats take up only 1 + // word on the stack but take 2 words in parameter area in the // stack frame . @@ -117,12 +117,12 @@ static void callVirtualMethod( // now we need to parse the entire signature string - // until we get the END indicator + // until we get the END indicator // treat complex return pointer like any other parameter // parse the argument list up to the ending ) - + while (*pPT != 'X') { c = *pPT; switch (c) { @@ -205,12 +205,12 @@ static void callVirtualMethod( /* figure out the address of the function we need to invoke */ - off = nVtableIndex; + off = nVtableIndex; off = off * 4; // 4 bytes per slot mfunc = *((unsigned long **)pAdjustedThisPtr); // get the address of the vtable - mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset + mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset mfunc = *((unsigned long **)mfunc); // the function is stored at the address - ptr = (void (*)())mfunc; + ptr = (void (*)())mfunc; /* Set up the machine registers and invoke the function */ @@ -289,7 +289,7 @@ static void callVirtualMethod( } -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -298,10 +298,10 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // need to know parameter types for callVirtualMethod so generate a signature string char * pParamType = (char *) alloca(nParams+2); char * pPT = pParamType; @@ -310,9 +310,9 @@ static void cpp_call( typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -322,7 +322,7 @@ static void cpp_call( else { // complex return via ptr - pCppReturn = *(void **)pCppStack + pCppReturn = *(void **)pCppStack = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pUnoReturn); // direct way @@ -345,21 +345,21 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - - if (!rParam.bOut + + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { @@ -423,7 +423,7 @@ static void cpp_call( uno_copyAndConvertData( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -438,7 +438,7 @@ static void cpp_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // terminate the signature string *pPT++='X'; *pPT=0; @@ -452,13 +452,13 @@ static void cpp_call( (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -475,7 +475,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -490,7 +490,7 @@ static void cpp_call( { // fill uno exception fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -514,10 +514,10 @@ void unoInterfaceProxyDispatch( void * pReturn, void * pArgs[], uno_Any ** ppException ) { // is my surrogate - bridges::cpp_uno::shared::UnoInterfaceProxy * pThis + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * > (pUnoI); - // typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; - + // typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -544,14 +544,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; //get then set method cpp_call( @@ -559,10 +559,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -594,7 +594,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -624,7 +624,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_os2_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_os2_intel/cpp2uno.cxx index 8b19ff92760c..3a068c4712f3 100644 --- a/bridges/source/cpp_uno/gcc3_os2_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_os2_intel/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -62,10 +62,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -76,7 +76,7 @@ static typelib_TypeClass cpp2uno_call( { pCppReturn = *(void **)pCppStack; pCppStack += sizeof(void *); - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) @@ -95,9 +95,9 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -152,7 +152,7 @@ static typelib_TypeClass cpp2uno_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // ExceptionHolder uno_Any aUnoExc = {0}; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; @@ -172,14 +172,14 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any @@ -193,7 +193,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -203,7 +203,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -239,7 +239,7 @@ static typelib_TypeClass cpp_mediate( sal_Int64 * pRegisterReturn /* space for register return */ ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); - + // pCallStack: ret adr, [ret *], this, params void * pThis; if( nFunctionIndex & 0x80000000 ) @@ -255,9 +255,9 @@ static typelib_TypeClass cpp_mediate( bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); - + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -265,13 +265,13 @@ static typelib_TypeClass cpp_mediate( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + typelib_TypeClass eRet; switch (aMemberDescr.get()->eTypeClass) { @@ -292,9 +292,9 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -327,7 +327,7 @@ static typelib_TypeClass cpp_mediate( pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -379,7 +379,7 @@ void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** pCallStack ) volatile long nRegReturn[2]; typelib_TypeClass aType = cpp_mediate( nFunctionIndex, nVtableOffset, pCallStack, (sal_Int64*)nRegReturn ); - + switch( aType ) { case typelib_TypeClass_HYPER: @@ -400,11 +400,11 @@ void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** pCallStack ) "fldl %0\n" : : "m"(*(double *)nRegReturn) ); break; -// case typelib_TypeClass_UNSIGNED_SHORT: -// case typelib_TypeClass_SHORT: -// __asm__( "movswl %0, %%eax\n" -// : : "m"(nRegReturn) ); -// break; +// case typelib_TypeClass_UNSIGNED_SHORT: +// case typelib_TypeClass_SHORT: +// __asm__( "movswl %0, %%eax\n" +// : : "m"(nRegReturn) ); +// break; default: __asm__( "movl %0, %%eax\n" : : "m"(nRegReturn[0]) ); diff --git a/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx b/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx index 99c2f62d1476..ec8447ba417c 100644 --- a/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_os2_intel/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -55,7 +55,7 @@ using namespace ::__cxxabiv1; //================================================================================================== //YD static handle to this dll, to allow rtti symbol lookup -static void* hmod; +static void* hmod; //================================================================================================== //YD required to run test programs, because exe cannot export symbols! diff --git a/bridges/source/cpp_uno/gcc3_os2_intel/share.hxx b/bridges/source/cpp_uno/gcc3_os2_intel/share.hxx index da2367ad172b..e4a6b379a840 100644 --- a/bridges/source/cpp_uno/gcc3_os2_intel/share.hxx +++ b/bridges/source/cpp_uno/gcc3_os2_intel/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,25 +48,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx index 64be1daa086e..d78ac1f62359 100644 --- a/bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_os2_intel/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -73,11 +73,11 @@ static void callVirtualMethod( { // parameter list is mixed list of * and values // reference parameters are pointers - + OSL_ENSURE( pStackLongs && pAdjustedThisPtr, "### null ptr!" ); OSL_ENSURE( (sizeof(void *) == 4) && (sizeof(sal_Int32) == 4), "### unexpected size of int!" ); OSL_ENSURE( nStackLongs && pStackLongs, "### no stack in callVirtualMethod !" ); - + // never called if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something @@ -85,10 +85,10 @@ static void callVirtualMethod( unsigned long * mfunc; // actual function to be invoked int off; // offset used to find function void (*ptr)(); - off = nVtableIndex; + off = nVtableIndex; off = off * 4; // 4 bytes per slot mfunc = *((unsigned long **)pAdjustedThisPtr); // get the address of the vtable - mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset + mfunc = (unsigned long *)((char *)mfunc + off); // get the address from the vtable entry at offset mfunc = *((unsigned long **)mfunc); // the function is stored at the address ptr = (void (*)())mfunc; @@ -152,7 +152,7 @@ static void callVirtualMethod( } } -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -161,17 +161,17 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -203,21 +203,21 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -248,7 +248,7 @@ static void cpp_call( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -272,13 +272,13 @@ static void cpp_call( (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -295,7 +295,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -310,7 +310,7 @@ static void cpp_call( { // fill uno exception fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -337,7 +337,7 @@ void unoInterfaceProxyDispatch( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -362,14 +362,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -377,10 +377,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -411,7 +411,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -441,7 +441,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx index 1c16f6550120..36c1a14e7792 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -64,10 +64,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -78,7 +78,7 @@ static typelib_TypeClass cpp2uno_call( { pCppReturn = *(void **)pCppStack; pCppStack += sizeof(void *); - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) @@ -97,9 +97,9 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -154,7 +154,7 @@ static typelib_TypeClass cpp2uno_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; @@ -162,7 +162,7 @@ static typelib_TypeClass cpp2uno_call( // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -170,14 +170,14 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any @@ -191,7 +191,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -201,7 +201,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -237,7 +237,7 @@ static typelib_TypeClass cpp_mediate( sal_Int64 * pRegisterReturn /* space for register return */ ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); - + // pCallStack: ret adr, [ret *], this, params void * pThis; if( nFunctionIndex & 0x80000000 ) @@ -253,9 +253,9 @@ static typelib_TypeClass cpp_mediate( bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); - + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -263,13 +263,13 @@ static typelib_TypeClass cpp_mediate( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + typelib_TypeClass eRet; switch (aMemberDescr.get()->eTypeClass) { @@ -290,9 +290,9 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -325,7 +325,7 @@ static typelib_TypeClass cpp_mediate( pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -377,7 +377,7 @@ void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** pCallStack ) volatile long nRegReturn[2]; typelib_TypeClass aType = cpp_mediate( nFunctionIndex, nVtableOffset, pCallStack, (sal_Int64*)nRegReturn ); - + switch( aType ) { case typelib_TypeClass_HYPER: @@ -398,11 +398,11 @@ void cpp_vtable_call( int nFunctionIndex, int nVtableOffset, void** pCallStack ) "fldl %0\n" : : "m"(*(double *)nRegReturn) ); break; -// case typelib_TypeClass_UNSIGNED_SHORT: -// case typelib_TypeClass_SHORT: -// __asm__( "movswl %0, %%eax\n" -// : : "m"(nRegReturn) ); -// break; +// case typelib_TypeClass_UNSIGNED_SHORT: +// case typelib_TypeClass_SHORT: +// __asm__( "movswl %0, %%eax\n" +// : : "m"(nRegReturn) ); +// break; default: __asm__( "movl %0, %%eax\n" : : "m"(nRegReturn[0]) ); diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx index 5dfc476edafd..69d3881a7606 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/share.hxx b/bridges/source/cpp_uno/gcc3_solaris_intel/share.hxx index da2367ad172b..e4a6b379a840 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/share.hxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,25 +48,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx index 8035256d4db8..d061e74fe83f 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -60,11 +60,11 @@ static void callVirtualMethod( { // parameter list is mixed list of * and values // reference parameters are pointers - + OSL_ENSURE( pStackLongs && pAdjustedThisPtr, "### null ptr!" ); OSL_ENSURE( (sizeof(void *) == 4) && (sizeof(sal_Int32) == 4), "### unexpected size of int!" ); OSL_ENSURE( nStackLongs && pStackLongs, "### no stack in callVirtualMethod !" ); - + // never called if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something @@ -128,7 +128,7 @@ static void callVirtualMethod( } } -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -137,17 +137,17 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -179,21 +179,21 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -224,7 +224,7 @@ static void cpp_call( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -248,13 +248,13 @@ static void cpp_call( (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -271,7 +271,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -286,7 +286,7 @@ static void cpp_call( { // fill uno exception fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -313,7 +313,7 @@ void unoInterfaceProxyDispatch( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -338,14 +338,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -353,10 +353,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -387,7 +387,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -417,7 +417,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx index e6b0273b97a9..1fb537cd474c 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_sparc/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -58,10 +58,10 @@ static typelib_TypeClass cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -88,9 +88,9 @@ static typelib_TypeClass cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -155,14 +155,14 @@ static typelib_TypeClass cpp2uno_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)(pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -170,7 +170,7 @@ static typelib_TypeClass cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); @@ -189,7 +189,7 @@ static typelib_TypeClass cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -199,7 +199,7 @@ static typelib_TypeClass cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -229,9 +229,9 @@ static typelib_TypeClass cpp2uno_call( //================================================================================================== static typelib_TypeClass cpp_mediate( - sal_Int32 nFunctionIndex, - sal_Int32 nVtableOffset, - void ** pCallStack, + sal_Int32 nFunctionIndex, + sal_Int32 nVtableOffset, + void ** pCallStack, sal_Int64 * pRegisterReturn /* space for register return */ ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); @@ -258,7 +258,7 @@ static typelib_TypeClass cpp_mediate( { throw RuntimeException( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pCppI ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); @@ -290,9 +290,9 @@ static typelib_TypeClass cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + eRet = cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -324,7 +324,7 @@ static typelib_TypeClass cpp_mediate( (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -378,8 +378,8 @@ static void cpp_vtable_call() "st %%i2, %2\n\t" : : "m"(nFunctionIndex), "m"(pCallStack), "m"(vTableOffset) ); -// fprintf(stderr,"cpp_mediate nFunctionIndex=%x\n",nFunctionIndex); -// fflush(stderr); +// fprintf(stderr,"cpp_mediate nFunctionIndex=%x\n",nFunctionIndex); +// fflush(stderr); sal_Bool bComplex = nFunctionIndex & 0x80000000 ? sal_True : sal_False; typelib_TypeClass aType = diff --git a/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx b/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx index 8d0be02e7d93..6833b9ed13ff 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ using namespace ::__cxxabiv1; namespace CPPU_CURRENT_NAMESPACE { - + void dummy_can_throw_anything( char const * ) { } @@ -65,13 +65,13 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) #if defined BRIDGES_DEBUG char const * start = p; #endif - + // example: N3com3sun4star4lang24IllegalArgumentExceptionE - + OUStringBuffer buf( 64 ); OSL_ASSERT( 'N' == *p ); ++p; // skip N - + while ('E' != *p) { // read chars count @@ -86,7 +86,7 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) if ('E' != *p) buf.append( (sal_Unicode)'.' ); } - + #if defined BRIDGES_DEBUG OUString ret( buf.makeStringAndClear() ); OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) ); @@ -101,17 +101,17 @@ static OUString toUNOname( char const * p ) SAL_THROW( () ) class RTTI { typedef hash_map< OUString, type_info *, OUStringHash > t_rtti_map; - + Mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; void * m_hApp; - + public: RTTI() SAL_THROW( () ); ~RTTI() SAL_THROW( () ); - + type_info * getRTTI( typelib_CompoundTypeDescription * ) SAL_THROW( () ); }; //__________________________________________________________________________________________________ @@ -129,9 +129,9 @@ RTTI::~RTTI() SAL_THROW( () ) type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THROW( () ) { type_info * rtti; - + OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - + MutexGuard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) @@ -149,7 +149,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR } while (index >= 0); buf.append( 'E' ); - + OString symName( buf.makeStringAndClear() ); rtti = (type_info *)dlsym( m_hApp, symName.getStr() ); @@ -185,7 +185,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR // this class has no base class rtti = new __class_type_info( strdup( rttiName ) ); } - + pair< t_rtti_map::iterator, bool > insertion( m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); OSL_ENSURE( insertion.second, "### inserting new generated rtti failed?!" ); @@ -200,7 +200,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) SAL_THR { rtti = iFind->second; } - + return rtti; } @@ -244,10 +244,10 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) *reinterpret_cast< OUString const * >( &pUnoExc->pType->pTypeName ), Reference< XInterface >() ); } - + pCppExc = __cxa_allocate_exception( pTypeDescr->nSize ); ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); - + // destruct uno exception ::uno_any_destruct( pUnoExc, 0 ); // avoiding locked counts @@ -276,7 +276,7 @@ void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) Reference< XInterface >() ); } } - + __cxa_throw( pCppExc, rtti, deleteException ); } @@ -296,7 +296,7 @@ void fillUnoException( __cxa_exception * header, uno_Any * pUnoExc, uno_Mapping #endif return; } - + typelib_TypeDescription * pExcTypeDescr = 0; OUString unoName( toUNOname( header->exceptionType->name() ) ); #if defined BRIDGES_DEBUG diff --git a/bridges/source/cpp_uno/gcc3_solaris_sparc/share.hxx b/bridges/source/cpp_uno/gcc3_solaris_sparc/share.hxx index 3526f19082cd..eb1cb12f53a9 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_sparc/share.hxx +++ b/bridges/source/cpp_uno/gcc3_solaris_sparc/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,25 +43,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx index b1c2767609f4..5d844835803d 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_sparc/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -104,7 +104,7 @@ void callVirtualMethod( void * pAdjustedThisPtr, "mov %%l1, %%l7\n\t" // increase our own stackframe if necessary - "mov %%sp, %%l3\n\t" // save stack ptr for readjustment + "mov %%sp, %%l3\n\t" // save stack ptr for readjustment "subcc %%i5, 7, %%l0\n\t" "ble .LmoveOn\n\t" @@ -112,14 +112,14 @@ void callVirtualMethod( void * pAdjustedThisPtr, "sll %%l0, 2, %%l0\n\t" "add %%l0, 96, %%l0\n\t" - "mov %%sp, %%l1\n\t" // old stack ptr - "sub %%sp, %%l0, %%l0\n\t" // future stack ptr - "andcc %%l0, 7, %%g0\n\t" // align stack to 8 + "mov %%sp, %%l1\n\t" // old stack ptr + "sub %%sp, %%l0, %%l0\n\t" // future stack ptr + "andcc %%l0, 7, %%g0\n\t" // align stack to 8 "be .LisAligned\n\t" "nop\n\t" "sub %%l0, 4, %%l0\n" ".LisAligned:\n\t" - "mov %%l0, %%o5\n\t" // save newly computed stack ptr + "mov %%l0, %%o5\n\t" // save newly computed stack ptr "add %%g0, 16, %%o4\n" // now copy longs down to save register window @@ -132,11 +132,11 @@ void callVirtualMethod( void * pAdjustedThisPtr, "subcc %%o4, 1, %%o4\n\t" "bne .LcopyDown\n\t" - "mov %%o5, %%sp\n\t" // move new stack ptr (hopefully) atomically + "mov %%o5, %%sp\n\t" // move new stack ptr (hopefully) atomically // while register window is valid in both spaces // (scheduling might hit in copyDown loop) - "sub %%i5, 7, %%l0\n\t" // copy parameters past the sixth to stack + "sub %%i5, 7, %%l0\n\t" // copy parameters past the sixth to stack "add %%i4, 28, %%l1\n\t" "add %%sp, 92, %%l2\n" ".LcopyLong:\n\t" @@ -149,10 +149,10 @@ void callVirtualMethod( void * pAdjustedThisPtr, "nop\n" ".LmoveOn:\n\t" - "mov %%i5, %%l0\n\t" // prepare out registers + "mov %%i5, %%l0\n\t" // prepare out registers "mov %%i4, %%l1\n\t" - "ld [%%l1], %%o0\n\t" // prepare complex return ptr + "ld [%%l1], %%o0\n\t" // prepare complex return ptr "st %%o0, [%%sp+64]\n\t" "sub %%l0, 1, %%l0\n\t" "add %%l1, 4, %%l1\n\t" @@ -190,20 +190,20 @@ void callVirtualMethod( void * pAdjustedThisPtr, "ld [%%l1], %%o5\n" ".LdoCall:\n\t" - "ld [%%i0], %%l0\n\t" // get vtable ptr + "ld [%%i0], %%l0\n\t" // get vtable ptr "sll %%i1, 2, %%l6\n\t" // "add %%l6, 8, %%l6\n\t" "add %%l6, %%l0, %%l0\n\t" -// // vtable has 8byte wide entries, -// // upper half contains 2 half words, of which the first -// // is the this ptr patch ! -// // first entry is (or __tf) +// // vtable has 8byte wide entries, +// // upper half contains 2 half words, of which the first +// // is the this ptr patch ! +// // first entry is (or __tf) -// "ldsh [%%l0], %%l6\n\t" // load this ptr patch -// "add %%l6, %%o0, %%o0\n\t" // patch this ptr +// "ldsh [%%l0], %%l6\n\t" // load this ptr patch +// "add %%l6, %%o0, %%o0\n\t" // patch this ptr -// "add %%l0, 4, %%l0\n\t" // get virtual function ptr +// "add %%l0, 4, %%l0\n\t" // get virtual function ptr "ld [%%l0], %%l0\n\t" "ld [%%i4], %%l2\n\t" @@ -220,8 +220,8 @@ void callVirtualMethod( void * pAdjustedThisPtr, "unimp\n" ".LcallReturned:\n\t" - "mov %%l3, %%sp\n\t" // readjust stack so that our locals are where they belong - "st %%o0, %0\n\t" // save possible return registers into our locals + "mov %%l3, %%sp\n\t" // readjust stack so that our locals are where they belong + "st %%o0, %0\n\t" // save possible return registers into our locals "st %%o1, %1\n\t" "std %%f0, %2\n\t" "st %%f0, %3\n\t" @@ -284,17 +284,17 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: complex ret ptr, this, values|ptr ... - char * pCppStack = + char * pCppStack = (char *)alloca( (nParams+2) * sizeof(sal_Int64) ); - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -325,9 +325,9 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -336,7 +336,7 @@ static void cpp_call( if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { pCppArgs[ nPos ] = CPPU_CURRENT_NAMESPACE::adjustPointer(pCppStack, pParamTypeDescr ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -378,7 +378,7 @@ static void cpp_call( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -397,7 +397,7 @@ static void cpp_call( { int nStackLongs = (pCppStack - pCppStackStart)/sizeof(sal_Int32); OSL_ENSURE( !( (pCppStack - pCppStackStart ) & 3), "UNALIGNED STACK !!! (Please DO panic" ); - + if( nStackLongs & 1 ) // stack has to be 8 byte aligned nStackLongs++; @@ -416,7 +416,7 @@ static void cpp_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -433,7 +433,7 @@ static void cpp_call( } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -447,7 +447,7 @@ static void cpp_call( catch( ... ) { // get exception - fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); // temporary params @@ -476,12 +476,12 @@ void unoInterfaceProxyDispatch( OString cstr( OUStringToOString( pMemberDescr->pTypeName, RTL_TEXTENCODING_ASCII_US ) ); fprintf( stderr, "received dispatch( %s )\n", cstr.getStr() ); #endif - + // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -506,14 +506,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -524,7 +524,7 @@ void unoInterfaceProxyDispatch( typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -555,7 +555,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -585,7 +585,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx b/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx index cd74da7462df..67864122bd2b 100644 --- a/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/mingw_intel/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -64,10 +64,10 @@ void cpp2uno_call( typelib_TypeDescription * pReturnTypeDescr = 0; if (pReturnTypeRef) TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); - + void * pUnoReturn = 0; void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -83,7 +83,7 @@ void cpp2uno_call( else { pCppReturn = pReturnValue; } - + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) @@ -102,9 +102,9 @@ void cpp2uno_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pUnoArgs + (2 * nParams)); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; @@ -162,7 +162,7 @@ void cpp2uno_call( } pCppStack += sizeof(sal_Int32); // standard parameter length } - + // ExceptionHolder uno_Any aUnoExc; // Any will be constructed by callee uno_Any * pUnoExc = &aUnoExc; @@ -170,7 +170,7 @@ void cpp2uno_call( // invoke uno dispatch call (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + // in case an exception occured... if (pUnoExc) { @@ -178,14 +178,14 @@ void cpp2uno_call( for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; - + if (pParams[nIndex].bIn) // is in/inout => was constructed uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndizes], 0 ); TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndizes] ); } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - + CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); // has to destruct the any @@ -197,7 +197,7 @@ void cpp2uno_call( { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bOut) // inout/out { // convert and assign @@ -207,7 +207,7 @@ void cpp2uno_call( } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return @@ -238,7 +238,7 @@ extern "C" void cpp_vtable_call( void * pReturnValue ) { OSL_ENSURE( sizeof(sal_Int32)==sizeof(void *), "### unexpected!" ); - + // pCallStack: ret adr, [ret *], this, params void * pThis; if( nFunctionIndex & 0x80000000 ) @@ -254,9 +254,9 @@ extern "C" void cpp_vtable_call( bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis); - + typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); - + OSL_ENSURE( nFunctionIndex < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { @@ -264,13 +264,13 @@ extern "C" void cpp_vtable_call( rtl::OUString::createFromAscii("illegal vtable index!"), (XInterface *)pThis ); } - + // determine called method sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); - + switch (aMemberDescr.get()->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -290,9 +290,9 @@ extern "C" void cpp_vtable_call( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + cpp2uno_call( pCppI, aMemberDescr.get(), 0, // indicates void return @@ -323,7 +323,7 @@ extern "C" void cpp_vtable_call( pCppI->getBridge()->getCppEnv(), (void **)&pInterface, pCppI->getOid().pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -374,9 +374,9 @@ unsigned char * codeSnippet( typelib_TypeDescription * returnTypeDescr = 0; if (returnType) TYPELIB_DANGER_GET( &returnTypeDescr, returnType ); - + typelib_TypeClass returnTypeClass = returnType ? returnType->eTypeClass : typelib_TypeClass_VOID; - if (!bridges::cpp_uno::shared::isSimpleType(returnTypeClass) && + if (!bridges::cpp_uno::shared::isSimpleType(returnTypeClass) && !bridges::cpp_uno::shared::isSmallStruct(returnTypeDescr)) { functionIndex |= 0x80000000; } diff --git a/bridges/source/cpp_uno/mingw_intel/dllinit.cxx b/bridges/source/cpp_uno/mingw_intel/dllinit.cxx index d215a3124470..8cc2af733a25 100644 --- a/bridges/source/cpp_uno/mingw_intel/dllinit.cxx +++ b/bridges/source/cpp_uno/mingw_intel/dllinit.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -33,7 +33,7 @@ #include <windows.h> - + void dso_init(void); void dso_exit(void); diff --git a/bridges/source/cpp_uno/mingw_intel/except.cxx b/bridges/source/cpp_uno/mingw_intel/except.cxx index 7a4aca8b1b4d..7ad94a9ac65f 100644 --- a/bridges/source/cpp_uno/mingw_intel/except.cxx +++ b/bridges/source/cpp_uno/mingw_intel/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/mingw_intel/share.hxx b/bridges/source/cpp_uno/mingw_intel/share.hxx index da2367ad172b..e4a6b379a840 100644 --- a/bridges/source/cpp_uno/mingw_intel/share.hxx +++ b/bridges/source/cpp_uno/mingw_intel/share.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,25 +48,25 @@ struct _Unwind_Exception } __attribute__((__aligned__)); struct __cxa_exception -{ +{ ::std::type_info *exceptionType; - void (*exceptionDestructor)(void *); - + void (*exceptionDestructor)(void *); + ::std::unexpected_handler unexpectedHandler; ::std::terminate_handler terminateHandler; - + __cxa_exception *nextException; - + int handlerCount; - + int handlerSwitchValue; const unsigned char *actionRecord; const unsigned char *languageSpecificData; void *catchTemp; void *adjustedPtr; - + _Unwind_Exception unwindHeader; -}; +}; extern "C" void *__cxa_allocate_exception( std::size_t thrown_size ) throw(); diff --git a/bridges/source/cpp_uno/mingw_intel/smallstruct.cxx b/bridges/source/cpp_uno/mingw_intel/smallstruct.cxx index bcfb0df87902..7e8fff8345c7 100644 --- a/bridges/source/cpp_uno/mingw_intel/smallstruct.cxx +++ b/bridges/source/cpp_uno/mingw_intel/smallstruct.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/mingw_intel/smallstruct.hxx b/bridges/source/cpp_uno/mingw_intel/smallstruct.hxx index f1eae96e6734..d24d5b274d60 100644 --- a/bridges/source/cpp_uno/mingw_intel/smallstruct.hxx +++ b/bridges/source/cpp_uno/mingw_intel/smallstruct.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx index cbbe1312c464..8cf382211680 100644 --- a/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/mingw_intel/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -73,11 +73,11 @@ void callVirtualMethod( { // parameter list is mixed list of * and values // reference parameters are pointers - + OSL_ENSURE( pStackLongs && pAdjustedThisPtr, "### null ptr!" ); OSL_ENSURE( (sizeof(void *) == 4) && (sizeof(sal_Int32) == 4), "### unexpected size of int!" ); OSL_ENSURE( nStackLongs && pStackLongs, "### no stack in callVirtualMethod !" ); - + // never called if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something @@ -161,7 +161,7 @@ void callVirtualMethod( } } -//================================================================================================== +//================================================================================================== static void cpp_call( bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, bridges::cpp_uno::shared::VtableSlot aVtableSlot, @@ -170,21 +170,21 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = + char * pCppStack = #ifdef BROKEN_ALLOCA (char *)malloc( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); #else (char *)alloca( sizeof(sal_Int32) + ((nParams+2) * sizeof(sal_Int64)) ); #endif - char * pCppStackStart = pCppStack; - + char * pCppStackStart = pCppStack; + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -227,21 +227,21 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -283,7 +283,7 @@ static void cpp_call( #endif pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -307,13 +307,13 @@ static void cpp_call( (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occured... *ppUnoExc = 0; - + // reconvert temporary params for ( ; nTempIndizes--; ) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -333,7 +333,7 @@ static void cpp_call( #ifdef BROKEN_ALLOCA free( pCppArgs[nIndex] ); #endif - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -348,7 +348,7 @@ static void cpp_call( { // fill uno exception fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); - + // temporary params for ( ; nTempIndizes--; ) { @@ -386,7 +386,7 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -411,14 +411,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -426,10 +426,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -460,7 +460,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -490,7 +490,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx index b2687fddc543..34e0de99c86f 100644 --- a/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx +++ b/bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -287,8 +287,8 @@ static typelib_TypeClass __cdecl cpp_mediate( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)aMemberDescr.get())->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; + aParam.bIn = sal_True; + aParam.bOut = sal_False; eRet = cpp2uno_call( pCppI, aMemberDescr.get(), @@ -370,40 +370,40 @@ static __declspec(naked) void __cdecl cpp_vtable_call(void) { __asm { - sub esp, 8 // space for immediate return type - push esp + sub esp, 8 // space for immediate return type + push esp push edx // vtable offset - push eax // function index - mov eax, esp - add eax, 20 - push eax // original stack ptr - - call cpp_mediate - add esp, 16 - - cmp eax, typelib_TypeClass_FLOAT - je Lfloat - cmp eax, typelib_TypeClass_DOUBLE - je Ldouble - cmp eax, typelib_TypeClass_HYPER - je Lhyper - cmp eax, typelib_TypeClass_UNSIGNED_HYPER - je Lhyper + push eax // function index + mov eax, esp + add eax, 20 + push eax // original stack ptr + + call cpp_mediate + add esp, 16 + + cmp eax, typelib_TypeClass_FLOAT + je Lfloat + cmp eax, typelib_TypeClass_DOUBLE + je Ldouble + cmp eax, typelib_TypeClass_HYPER + je Lhyper + cmp eax, typelib_TypeClass_UNSIGNED_HYPER + je Lhyper // rest is eax - pop eax - add esp, 4 + pop eax + add esp, 4 ret Lhyper: - pop eax - pop edx + pop eax + pop edx ret Lfloat: - fld dword ptr [esp] - add esp, 8 + fld dword ptr [esp] + add esp, 8 ret Ldouble: - fld qword ptr [esp] - add esp, 8 + fld qword ptr [esp] + add esp, 8 ret } } diff --git a/bridges/source/cpp_uno/msvc_win32_intel/dllinit.cxx b/bridges/source/cpp_uno/msvc_win32_intel/dllinit.cxx index cfbc58650f0d..4505157e2143 100644 --- a/bridges/source/cpp_uno/msvc_win32_intel/dllinit.cxx +++ b/bridges/source/cpp_uno/msvc_win32_intel/dllinit.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -35,7 +35,7 @@ #include <windows.h> #pragma warning(pop) - + void dso_init(void); void dso_exit(void); diff --git a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx index 4bda7cfa9074..a7648d2922d4 100644 --- a/bridges/source/cpp_uno/msvc_win32_intel/except.cxx +++ b/bridges/source/cpp_uno/msvc_win32_intel/except.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -102,8 +102,8 @@ typedef hash_map< OUString, void *, OUStringHash, equal_to< OUString > > t_strin //================================================================================================== class RTTInfos { - Mutex _aMutex; - t_string2PtrMap _allRTTI; + Mutex _aMutex; + t_string2PtrMap _allRTTI; static OUString toRawName( OUString const & rUNOname ) throw (); public: @@ -199,12 +199,12 @@ struct ObjectFunction inline static void * operator new ( size_t nSize ); inline static void operator delete ( void * pMem ); - + ObjectFunction( typelib_TypeDescription * pTypeDescr, void * fpFunc ) throw (); ~ObjectFunction() throw (); }; -inline void * ObjectFunction::operator new ( size_t nSize ) +inline void * ObjectFunction::operator new ( size_t nSize ) { void * pMem = rtl_allocateMemory( nSize ); if (pMem != 0) @@ -272,7 +272,7 @@ static __declspec(naked) void copyConstruct() throw () { // ObjectFunction this already on stack push [esp+8] // source exc object this - push ecx // exc object + push ecx // exc object call __copyConstruct add esp, 12 // + ObjectFunction this ret 4 @@ -284,7 +284,7 @@ static __declspec(naked) void destruct() throw () __asm { // ObjectFunction this already on stack - push ecx // exc object + push ecx // exc object call __destruct add esp, 8 // + ObjectFunction this ret @@ -294,11 +294,11 @@ static __declspec(naked) void destruct() throw () //================================================================================================== struct ExceptionType { - sal_Int32 _n0; - type_info * _pTypeInfo; - sal_Int32 _n1, _n2, _n3, _n4; - ObjectFunction * _pCopyCtor; - sal_Int32 _n5; + sal_Int32 _n0; + type_info * _pTypeInfo; + sal_Int32 _n1, _n2, _n3, _n4; + ObjectFunction * _pCopyCtor; + sal_Int32 _n5; inline ExceptionType( typelib_TypeDescription * pTypeDescr ) throw () : _n0( 0 ) @@ -315,11 +315,11 @@ struct ExceptionType //================================================================================================== struct RaiseInfo { - sal_Int32 _n0; - ObjectFunction * _pDtor; - sal_Int32 _n2; - void * _types; - sal_Int32 _n3, _n4; + sal_Int32 _n0; + ObjectFunction * _pDtor; + sal_Int32 _n2; + void * _types; + sal_Int32 _n3, _n4; RaiseInfo( typelib_TypeDescription * pTypeDescr ) throw (); ~RaiseInfo() throw (); @@ -374,8 +374,8 @@ RaiseInfo::~RaiseInfo() throw () //================================================================================================== class ExceptionInfos { - Mutex _aMutex; - t_string2PtrMap _allRaiseInfos; + Mutex _aMutex; + t_string2PtrMap _allRaiseInfos; public: static void * getRaiseInfo( typelib_TypeDescription * pTypeDescr ) throw (); @@ -393,7 +393,7 @@ ExceptionInfos::~ExceptionInfos() throw () #if OSL_DEBUG_LEVEL > 1 OSL_TRACE( "> freeing exception infos... <\n" ); #endif - + MutexGuard aGuard( _aMutex ); for ( t_string2PtrMap::const_iterator iPos( _allRaiseInfos.begin() ); iPos != _allRaiseInfos.end(); ++iPos ) @@ -513,7 +513,7 @@ int msci_filterCppException( // handle only C++ exceptions: if (pRecord == 0 || pRecord->ExceptionCode != MSVC_ExceptionCode) return EXCEPTION_CONTINUE_SEARCH; - + #if _MSC_VER < 1300 // MSVC -6 bool rethrow = (pRecord->NumberParameters < 3 || pRecord->ExceptionInformation[ 2 ] == 0); @@ -546,9 +546,9 @@ int msci_filterCppException( // rethrow: handle only C++ exceptions: if (pRecord == 0 || pRecord->ExceptionCode != MSVC_ExceptionCode) return EXCEPTION_CONTINUE_SEARCH; - + if (pRecord->NumberParameters == 3 && -// pRecord->ExceptionInformation[ 0 ] == MSVC_magic_number && +// pRecord->ExceptionInformation[ 0 ] == MSVC_magic_number && pRecord->ExceptionInformation[ 1 ] != 0 && pRecord->ExceptionInformation[ 2 ] != 0) { @@ -566,7 +566,7 @@ int msci_filterCppException( pType->_pTypeInfo )->_m_d_name, RTL_TEXTENCODING_ASCII_US ) ); OUString aUNOname( toUNOname( aRTTIname ) ); - + typelib_TypeDescription * pExcTypeDescr = 0; typelib_typedescription_getByName( &pExcTypeDescr, aUNOname.pData ); @@ -610,7 +610,7 @@ int msci_filterCppException( #endif typelib_typedescription_release( pExcTypeDescr ); } - + return EXCEPTION_EXECUTE_HANDLER; } } diff --git a/bridges/source/cpp_uno/msvc_win32_intel/msci.hxx b/bridges/source/cpp_uno/msvc_win32_intel/msci.hxx index ecc4e22960d7..7f8cf6ed746c 100644 --- a/bridges/source/cpp_uno/msvc_win32_intel/msci.hxx +++ b/bridges/source/cpp_uno/msvc_win32_intel/msci.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,7 +45,7 @@ const long MSVC_magic_number = 0x19930520L; //============================================================================== type_info * msci_getRTTI( ::rtl::OUString const & rUNOname ); - + //============================================================================== int msci_filterCppException( EXCEPTION_POINTERS * pPointers, uno_Any * pUnoExc, uno_Mapping * pCpp2Uno ); diff --git a/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx b/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx index 0a131e94a05b..1667e216e3be 100644 --- a/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx +++ b/bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -59,91 +59,91 @@ inline static void callVirtualMethod( OSL_ENSURE( pStackLongs && pAdjustedThisPtr, "### null ptr!" ); OSL_ENSURE( (sizeof(void *) == 4) && (sizeof(sal_Int32) == 4), "### unexpected size of int!" ); - + __asm { - mov eax, nStackLongs - test eax, eax - je Lcall + mov eax, nStackLongs + test eax, eax + je Lcall // copy values - mov ecx, eax - shl eax, 2 // sizeof(sal_Int32) == 4 - add eax, pStackLongs // params stack space -Lcopy: sub eax, 4 - push dword ptr [eax] - dec ecx - jne Lcopy + mov ecx, eax + shl eax, 2 // sizeof(sal_Int32) == 4 + add eax, pStackLongs // params stack space +Lcopy: sub eax, 4 + push dword ptr [eax] + dec ecx + jne Lcopy Lcall: // call - mov ecx, pAdjustedThisPtr - push ecx // this ptr - mov edx, [ecx] // pvft - mov eax, nVtableIndex - shl eax, 2 // sizeof(void *) == 4 - add edx, eax - call [edx] // interface method call must be __cdecl!!! + mov ecx, pAdjustedThisPtr + push ecx // this ptr + mov edx, [ecx] // pvft + mov eax, nVtableIndex + shl eax, 2 // sizeof(void *) == 4 + add edx, eax + call [edx] // interface method call must be __cdecl!!! // register return - mov ecx, eReturnTypeClass - cmp ecx, typelib_TypeClass_VOID - je Lcleanup - mov ebx, pRegisterReturn + mov ecx, eReturnTypeClass + cmp ecx, typelib_TypeClass_VOID + je Lcleanup + mov ebx, pRegisterReturn // int32 - cmp ecx, typelib_TypeClass_LONG - je Lint32 - cmp ecx, typelib_TypeClass_UNSIGNED_LONG - je Lint32 - cmp ecx, typelib_TypeClass_ENUM - je Lint32 + cmp ecx, typelib_TypeClass_LONG + je Lint32 + cmp ecx, typelib_TypeClass_UNSIGNED_LONG + je Lint32 + cmp ecx, typelib_TypeClass_ENUM + je Lint32 // int8 - cmp ecx, typelib_TypeClass_BOOLEAN - je Lint8 - cmp ecx, typelib_TypeClass_BYTE - je Lint8 + cmp ecx, typelib_TypeClass_BOOLEAN + je Lint8 + cmp ecx, typelib_TypeClass_BYTE + je Lint8 // int16 - cmp ecx, typelib_TypeClass_CHAR - je Lint16 - cmp ecx, typelib_TypeClass_SHORT - je Lint16 - cmp ecx, typelib_TypeClass_UNSIGNED_SHORT - je Lint16 + cmp ecx, typelib_TypeClass_CHAR + je Lint16 + cmp ecx, typelib_TypeClass_SHORT + je Lint16 + cmp ecx, typelib_TypeClass_UNSIGNED_SHORT + je Lint16 // float - cmp ecx, typelib_TypeClass_FLOAT - je Lfloat + cmp ecx, typelib_TypeClass_FLOAT + je Lfloat // double - cmp ecx, typelib_TypeClass_DOUBLE - je Ldouble + cmp ecx, typelib_TypeClass_DOUBLE + je Ldouble // int64 - cmp ecx, typelib_TypeClass_HYPER - je Lint64 - cmp ecx, typelib_TypeClass_UNSIGNED_HYPER - je Lint64 - jmp Lcleanup // no simple type + cmp ecx, typelib_TypeClass_HYPER + je Lint64 + cmp ecx, typelib_TypeClass_UNSIGNED_HYPER + je Lint64 + jmp Lcleanup // no simple type Lint8: - mov byte ptr [ebx], al - jmp Lcleanup + mov byte ptr [ebx], al + jmp Lcleanup Lint16: - mov word ptr [ebx], ax - jmp Lcleanup + mov word ptr [ebx], ax + jmp Lcleanup Lfloat: - fstp dword ptr [ebx] - jmp Lcleanup + fstp dword ptr [ebx] + jmp Lcleanup Ldouble: - fstp qword ptr [ebx] - jmp Lcleanup + fstp qword ptr [ebx] + jmp Lcleanup Lint64: - mov dword ptr [ebx], eax - mov dword ptr [ebx+4], edx - jmp Lcleanup + mov dword ptr [ebx], eax + mov dword ptr [ebx+4], edx + jmp Lcleanup Lint32: - mov dword ptr [ebx], eax - jmp Lcleanup + mov dword ptr [ebx], eax + jmp Lcleanup Lcleanup: // cleanup stack (obsolete though because of function) - mov eax, nStackLongs - shl eax, 2 // sizeof(sal_Int32) == 4 - add eax, 4 // this ptr - add esp, eax + mov eax, nStackLongs + shl eax, 2 // sizeof(sal_Int32) == 4 + add eax, 4 // this ptr + add esp, eax } } @@ -156,16 +156,16 @@ static void cpp_call( void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) throw () { // max space for: [complex ret ptr], values|ptr ... - char * pCppStack = (char *)alloca( sizeof(sal_Int32) + (nParams * sizeof(sal_Int64)) ); - char * pCppStackStart = pCppStack; - + char * pCppStack = (char *)alloca( sizeof(sal_Int32) + (nParams * sizeof(sal_Int64)) ); + char * pCppStackStart = pCppStack; + // return typelib_TypeDescription * pReturnTypeDescr = 0; TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); OSL_ENSURE( pReturnTypeDescr, "### expected return type description!" ); - + void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion - + if (pReturnTypeDescr) { if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) @@ -193,22 +193,22 @@ static void cpp_call( sal_Int32 * pTempIndizes = (sal_Int32 *)(pCppArgs + nParams); // type descriptions for reconversions typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); - + sal_Int32 nTempIndizes = 0; - + for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - + if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { ::uno_copyAndConvertData( pCppArgs[nPos] = pCppStack, pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -242,7 +242,7 @@ static void cpp_call( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); - + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -290,17 +290,17 @@ static void cpp_call( // end here return; } - + // NO exception occured *ppUnoExc = 0; - + // reconvert temporary params while (nTempIndizes--) { sal_Int32 nIndex = pTempIndizes[nTempIndizes]; typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndizes]; - + if (pParams[nIndex].bIn) { if (pParams[nIndex].bOut) // inout @@ -321,7 +321,7 @@ static void cpp_call( // destroy temp cpp param => cpp: every param was constructed ::uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); - + TYPELIB_DANGER_RELEASE( pParamTypeDescr ); } // return value @@ -351,7 +351,7 @@ void unoInterfaceProxyDispatch( // is my surrogate bridges::cpp_uno::shared::UnoInterfaceProxy * pThis = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy * >(pUnoI); - + switch (pMemberDescr->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: @@ -376,14 +376,14 @@ void unoInterfaceProxyDispatch( typelib_MethodParameter aParam; aParam.pTypeRef = ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; - aParam.bIn = sal_True; - aParam.bOut = sal_False; - + aParam.bIn = sal_True; + aParam.bOut = sal_False; + typelib_TypeDescriptionReference * pReturnTypeRef = 0; OUString aVoidName( RTL_CONSTASCII_USTRINGPARAM("void") ); typelib_typedescriptionreference_new( &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); - + // dependent dispatch aVtableSlot.index += 1; // get, then set method cpp_call( @@ -391,10 +391,10 @@ void unoInterfaceProxyDispatch( pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } - + break; } case typelib_TypeClass_INTERFACE_METHOD: @@ -425,7 +425,7 @@ void unoInterfaceProxyDispatch( (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( pThis->pBridge->getUnoEnv(), (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); - + if (pInterface) { ::uno_any_construct( @@ -455,7 +455,7 @@ void unoInterfaceProxyDispatch( ::com::sun::star::uno::RuntimeException aExc( OUString( RTL_CONSTASCII_USTRINGPARAM("illegal member type description!") ), ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); - + Type const & rExcType = ::getCppuType( &aExc ); // binary identical null reference ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); diff --git a/bridges/source/cpp_uno/shared/bridge.cxx b/bridges/source/cpp_uno/shared/bridge.cxx index 0b76b0ca1a8a..922a5bd40a99 100644 --- a/bridges/source/cpp_uno/shared/bridge.cxx +++ b/bridges/source/cpp_uno/shared/bridge.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/shared/component.cxx b/bridges/source/cpp_uno/shared/component.cxx index 2c89217c9721..32365c307bf6 100644 --- a/bridges/source/cpp_uno/shared/component.cxx +++ b/bridges/source/cpp_uno/shared/component.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/shared/component.hxx b/bridges/source/cpp_uno/shared/component.hxx index 7be6cd7a6355..f700b6f58147 100644 --- a/bridges/source/cpp_uno/shared/component.hxx +++ b/bridges/source/cpp_uno/shared/component.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx index 5b3c8eeba37e..4ebe6c042571 100644 --- a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx +++ b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -62,7 +62,7 @@ void dso_init(void) { } void dso_exit(void) { - if (pInstance) + if (pInstance) { delete pInstance; pInstance = NULL; diff --git a/bridges/source/cpp_uno/shared/guardedarray.hxx b/bridges/source/cpp_uno/shared/guardedarray.hxx index 9e4e0f3b0cad..bd22752ee0f0 100644 --- a/bridges/source/cpp_uno/shared/guardedarray.hxx +++ b/bridges/source/cpp_uno/shared/guardedarray.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/shared/types.cxx b/bridges/source/cpp_uno/shared/types.cxx index cf442082f283..efa657725248 100644 --- a/bridges/source/cpp_uno/shared/types.cxx +++ b/bridges/source/cpp_uno/shared/types.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx b/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx index e3159f12190d..7cced6e19ae7 100644 --- a/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx +++ b/bridges/source/cpp_uno/shared/unointerfaceproxy.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/shared/vtablefactory.cxx b/bridges/source/cpp_uno/shared/vtablefactory.cxx index 02247de10bf3..667fe7f56ec3 100644 --- a/bridges/source/cpp_uno/shared/vtablefactory.cxx +++ b/bridges/source/cpp_uno/shared/vtablefactory.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/cpp_uno/shared/vtables.cxx b/bridges/source/cpp_uno/shared/vtables.cxx index 40436d0224fb..eb65e3bb46a9 100644 --- a/bridges/source/cpp_uno/shared/vtables.cxx +++ b/bridges/source/cpp_uno/shared/vtables.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java index 223b53a7013f..8041d9a7f96c 100644 --- a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java +++ b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_info_holder.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,12 +38,12 @@ public final class JNI_info_holder } private static JNI_info_holder s_holder = new JNI_info_holder(); - + private static long s_jni_info_handle; - + //__________________________________________________________________________ private native void finalize( long jni_info_handle ); - + //__________________________________________________________________________ protected void finalize() { diff --git a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java index 076d568e9c91..877b08287320 100644 --- a/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java +++ b/bridges/source/jni_uno/java/com/sun/star/bridges/jni_uno/JNI_proxy.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -46,14 +46,14 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler JNI_proxy.class.getClassLoader(); protected static Class s_InvocationHandler [] = new Class [] { java.lang.reflect.InvocationHandler.class }; - + protected long m_bridge_handle; protected IEnvironment m_java_env; protected long m_receiver_handle; protected long m_td_handle; protected Type m_type; protected String m_oid; - protected Class m_class; + protected Class m_class; //__________________________________________________________________________ public static String get_stack_trace( Throwable throwable ) @@ -83,10 +83,10 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler } return "\njava stack trace:\n" + trace; } - + //__________________________________________________________________________ private native void finalize( long bridge_handle ); - + //__________________________________________________________________________ public void finalize() { @@ -96,7 +96,7 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler } }); } - + //__________________________________________________________________________ private JNI_proxy( long bridge_handle, IEnvironment java_env, @@ -110,7 +110,7 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler m_oid = oid; m_class = m_type.getZClass(); } - + //__________________________________________________________________________ public static Object create( long bridge_handle, IEnvironment java_env, @@ -123,7 +123,7 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler Object proxy = proxy_ctor.newInstance( new Object [] { handler } ); return java_env.registerInterface( proxy, new String [] { oid }, type ); } - + //__________________________________________________________________________ public static java.lang.reflect.Constructor get_proxy_ctor( Class clazz ) throws Throwable @@ -134,12 +134,12 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler com.sun.star.lib.uno.Proxy.class } ); return proxy_class.getConstructor( s_InvocationHandler ); } - + //__________________________________________________________________________ private native Object dispatch_call( long bridge_handle, String decl_class, String method, Object args [] ) throws Throwable; - + // InvocationHandler impl //__________________________________________________________________________ public Object invoke( @@ -148,7 +148,7 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler { Class decl_class = method.getDeclaringClass(); String method_name = method.getName(); - + if (Object.class.equals( decl_class )) { if (method_name.equals( "hashCode" )) @@ -205,7 +205,7 @@ public final class JNI_proxy implements java.lang.reflect.InvocationHandler return m_oid; } } - + throw new com.sun.star.uno.RuntimeException( "[jni_uno bridge error] unexpected call on proxy " + proxy.toString() + ": " + method.toString() ); diff --git a/bridges/source/jni_uno/jni_base.h b/bridges/source/jni_uno/jni_base.h index 7601648ad93a..ce8498826dd8 100644 --- a/bridges/source/jni_uno/jni_base.h +++ b/bridges/source/jni_uno/jni_base.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -62,7 +62,7 @@ class JNI_info; struct BridgeRuntimeError { ::rtl::OUString m_message; - + inline BridgeRuntimeError( ::rtl::OUString const & message ) : m_message( message ) {} @@ -75,10 +75,10 @@ class JNI_context JNI_info const * m_jni_info; JNIEnv * m_env; jobject m_class_loader; - + JNI_context( JNI_context & ); // not impl void operator = ( JNI_context ); // not impl - + void java_exc_occured() const; public: inline explicit JNI_context( @@ -87,10 +87,10 @@ public: m_env( env ), m_class_loader( class_loader ) {} - + inline JNI_info const * get_info() const { return m_jni_info; } - + inline JNIEnv * operator -> () const { return m_env; } inline JNIEnv * get_jni_env() const @@ -105,10 +105,10 @@ public: jclass findClass( char const * name, jclass classClass, jmethodID methodForName, bool inException) const; - + inline void ensure_no_exception() const; // throws BridgeRuntimeError inline bool assert_no_exception() const; // asserts and clears exception - + ::rtl::OUString get_stack_trace( jobject jo_exc = 0 ) const; }; @@ -141,7 +141,7 @@ class JNI_guarded_context { JNI_guarded_context( JNI_guarded_context & ); // not impl void operator = ( JNI_guarded_context ); // not impl - + public: inline explicit JNI_guarded_context( JNI_info const * jni_info, ::jvmaccess::UnoVirtualMachine * vm_access ) @@ -158,7 +158,7 @@ class JLocalAutoRef { JNI_context const & m_jni; jobject m_jo; - + public: inline JLocalAutoRef( JNI_context const & jni ) : m_jni( jni ), @@ -170,7 +170,7 @@ public: {} inline JLocalAutoRef( JLocalAutoRef & auto_ref ); inline ~JLocalAutoRef() SAL_THROW( () ); - + inline jobject get() const { return m_jo; } inline bool is() const @@ -244,7 +244,7 @@ struct rtl_mem { return mem; } inline static void operator delete ( void *, void * ) {} - + static inline ::std::auto_ptr< rtl_mem > allocate( ::std::size_t bytes ); }; @@ -262,15 +262,15 @@ inline ::std::auto_ptr< rtl_mem > rtl_mem::allocate( ::std::size_t bytes ) class TypeDescr { typelib_TypeDescription * m_td; - + TypeDescr( TypeDescr & ); // not impl void operator = ( TypeDescr ); // not impl - + public: inline explicit TypeDescr( typelib_TypeDescriptionReference * td_ref ); inline ~TypeDescr() SAL_THROW( () ) { TYPELIB_DANGER_RELEASE( m_td ); } - + inline typelib_TypeDescription * get() const { return m_td; } }; diff --git a/bridges/source/jni_uno/jni_bridge.cxx b/bridges/source/jni_uno/jni_bridge.cxx index 3f9f22a98c38..cf572395726d 100644 --- a/bridges/source/jni_uno/jni_bridge.cxx +++ b/bridges/source/jni_uno/jni_bridge.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -72,7 +72,7 @@ void SAL_CALL Mapping_map_to_uno( { uno_Interface ** ppUnoI = (uno_Interface **)ppOut; jobject javaI = (jobject) pIn; - + OSL_ASSERT( sizeof (void *) == sizeof (jobject) ); OSL_ENSURE( ppUnoI && td, "### null ptr!" ); @@ -95,7 +95,7 @@ void SAL_CALL Mapping_map_to_uno( bridge->m_jni_info, reinterpret_cast< ::jvmaccess::UnoVirtualMachine * >( bridge->m_java_env->pContext ) ); - + JNI_interface_type_info const * info = static_cast< JNI_interface_type_info const * >( bridge->m_jni_info->get_type_info( @@ -166,7 +166,7 @@ void SAL_CALL Mapping_map_to_java( bridge->m_jni_info, reinterpret_cast< ::jvmaccess::UnoVirtualMachine * >( bridge->m_java_env->pContext ) ); - + JNI_interface_type_info const * info = static_cast< JNI_interface_type_info const * >( bridge->m_jni_info->get_type_info( @@ -337,7 +337,7 @@ void JNI_context::java_exc_occured() const OUSTR("error examining java exception object!") + get_stack_trace() ); } - + jsize len = m_env->GetStringLength( (jstring) jo_descr.get() ); auto_ptr< rtl_mem > ustr_mem( rtl_mem::allocate( @@ -507,7 +507,7 @@ void SAL_CALL uno_ext_getMapping( OUString::unacquired( &pFrom->pTypeName ); OUString const & to_env_typename = OUString::unacquired( &pTo->pTypeName ); - + uno_Mapping * mapping = 0; try diff --git a/bridges/source/jni_uno/jni_bridge.h b/bridges/source/jni_uno/jni_bridge.h index f2298fbdbe46..3bb1f0372456 100644 --- a/bridges/source/jni_uno/jni_bridge.h +++ b/bridges/source/jni_uno/jni_bridge.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -56,25 +56,25 @@ struct Mapping : public uno_Mapping struct Bridge { mutable oslInterlockedCount m_ref; - + uno_ExtEnvironment * m_uno_env; uno_Environment * m_java_env; - + Mapping m_java2uno; Mapping m_uno2java; bool m_registered_java2uno; - + JNI_info const * m_jni_info; - + // ~Bridge() SAL_THROW( () ); explicit Bridge( uno_Environment * java_env, uno_ExtEnvironment * uno_env, bool registered_java2uno ); - + void acquire() const; void release() const; - + // jni_data.cxx void map_to_uno( JNI_context const & jni, @@ -90,7 +90,7 @@ struct Bridge JNI_type_info const * info /* maybe 0 */, bool in_param, bool out_param, bool special_wrapped_integral_types = false ) const; - + // jni_uno2java.cxx void handle_uno_exc( JNI_context const & jni, uno_Any * uno_exc ) const; @@ -104,7 +104,7 @@ struct Bridge jobject map_to_java( JNI_context const & jni, uno_Interface * pUnoI, JNI_interface_type_info const * info ) const; - + // jni_java2uno.cxx void handle_java_exc( JNI_context const & jni, diff --git a/bridges/source/jni_uno/jni_data.cxx b/bridges/source/jni_uno/jni_data.cxx index aca455d154ed..b8dc895b35fd 100644 --- a/bridges/source/jni_uno/jni_data.cxx +++ b/bridges/source/jni_uno/jni_data.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -230,7 +230,7 @@ void Bridge::map_to_uno( OSL_ASSERT( !out_param || (1 == jni->GetArrayLength( (jarray) java_data.l )) ); - + switch (type->eTypeClass) { case typelib_TypeClass_CHAR: @@ -486,7 +486,7 @@ void Bridge::map_to_uno( JLocalAutoRef jo_type( jni ); JLocalAutoRef jo_wrapped_holder( jni ); - + if (JNI_FALSE != jni->IsInstanceOf( java_data.l, m_jni_info->m_class_Any )) { @@ -534,7 +534,7 @@ void Bridge::map_to_uno( jni.ensure_no_exception(); OUString type_name( jstring_to_oustring( jni, (jstring) jo_type_name.get() ) ); - + ::com::sun::star::uno::TypeDescription value_td( type_name ); if (! value_td.is()) { @@ -725,7 +725,7 @@ void Bridge::map_to_uno( buf.append( jni.get_stack_trace() ); throw BridgeRuntimeError( buf.makeStringAndClear() ); } - + *(jint *) uno_data = jni->GetIntField( java_data.l, m_jni_info->m_field_Enum_m_value ); break; @@ -1029,7 +1029,7 @@ void Bridge::map_to_uno( auto_ptr< rtl_mem > seq; sal_Int32 nElements = jni->GetArrayLength( (jarray) java_data.l ); - + switch (element_type->eTypeClass) { case typelib_TypeClass_CHAR: @@ -1869,7 +1869,7 @@ void Bridge::map_to_java( OUStringToOString( type_name, RTL_TEXTENCODING_JAVA_UTF8 ) ); JLocalAutoRef jo_enum_class( jni, find_class( jni, class_name.getStr() ) ); - + JLocalAutoRef jo_enum( jni ); if (in_param) { @@ -2354,7 +2354,7 @@ void Bridge::map_to_java( element_type_name, RTL_TEXTENCODING_JAVA_UTF8 ) ); JLocalAutoRef jo_enum_class( jni, find_class( jni, class_name.getStr() ) ); - + jo_ar.reset( jni->NewObjectArray( nElements, (jclass) jo_enum_class.get(), 0 ) ); @@ -2394,7 +2394,7 @@ void Bridge::map_to_java( { JNI_type_info const * element_info = m_jni_info->get_type_info( jni, element_type ); - + jo_ar.reset( jni->NewObjectArray( nElements, element_info->m_class, 0 ) ); jni.ensure_no_exception(); @@ -2427,7 +2427,7 @@ void Bridge::map_to_java( OString class_name( buf.makeStringAndClear() ); JLocalAutoRef jo_seq_class( jni, find_class( jni, class_name.getStr() ) ); - + jo_ar.reset( jni->NewObjectArray( nElements, (jclass) jo_seq_class.get(), 0 ) ); @@ -2456,7 +2456,7 @@ void Bridge::map_to_java( JNI_interface_type_info const * iface_info = static_cast< JNI_interface_type_info const * >( m_jni_info->get_type_info( jni, element_type ) ); - + jo_ar.reset( jni->NewObjectArray( nElements, iface_info->m_class, 0 ) ); jni.ensure_no_exception(); diff --git a/bridges/source/jni_uno/jni_helper.h b/bridges/source/jni_uno/jni_helper.h index 293bf82d868e..80376dc63085 100644 --- a/bridges/source/jni_uno/jni_helper.h +++ b/bridges/source/jni_uno/jni_helper.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx index 6df598859d0a..d4ec229b852f 100644 --- a/bridges/source/jni_uno/jni_info.cxx +++ b/bridges/source/jni_uno/jni_info.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -83,10 +83,10 @@ JNI_interface_type_info::JNI_interface_type_info( : JNI_type_info( jni, td_ ) { OSL_ASSERT( typelib_TypeClass_INTERFACE == m_td.get()->eTypeClass ); - + OUString const & uno_name = OUString::unacquired( &m_td.get()->pTypeName ); JNI_info const * jni_info = jni.get_info(); - + JLocalAutoRef jo_class( jni, find_class( @@ -94,7 +94,7 @@ JNI_interface_type_info::JNI_interface_type_info( ( OUStringToOString( uno_name, RTL_TEXTENCODING_JAVA_UTF8 ). getStr() ) ) ); JLocalAutoRef jo_type( jni, create_type( jni, (jclass) jo_class.get() ) ); - + // get proxy ctor jvalue arg; arg.l = jo_class.get(); @@ -102,7 +102,7 @@ JNI_interface_type_info::JNI_interface_type_info( jni, jni->CallStaticObjectMethodA( jni_info->m_class_JNI_proxy, jni_info->m_method_JNI_proxy_get_proxy_ctor, &arg ) ); - + if (is_XInterface( m_td.get()->pWeakRef )) { m_methods = 0; // no methods @@ -111,21 +111,21 @@ JNI_interface_type_info::JNI_interface_type_info( { // retrieve method ids for all direct members try - { + { typelib_InterfaceTypeDescription * td = reinterpret_cast< typelib_InterfaceTypeDescription * >( m_td.get() ); m_methods = new jmethodID[ td->nMapFunctionIndexToMemberIndex ]; sal_Int32 nMethodIndex = 0; typelib_TypeDescriptionReference ** ppMembers = td->ppMembers; - sal_Int32 nMembers = td->nMembers; - + sal_Int32 nMembers = td->nMembers; + for ( sal_Int32 nPos = 0; nPos < nMembers; ++nPos ) { TypeDescr member_td( ppMembers[ nPos ] ); - + OStringBuffer sig_buf( 64 ); - + if (typelib_TypeClass_INTERFACE_METHOD == member_td.get()->eTypeClass) // method { @@ -133,7 +133,7 @@ JNI_interface_type_info::JNI_interface_type_info( reinterpret_cast< typelib_InterfaceMethodTypeDescription * >( member_td.get() ); - + sig_buf.append( '(' ); for ( sal_Int32 i = 0; i < method_td->nParams; ++i ) { @@ -145,13 +145,13 @@ JNI_interface_type_info::JNI_interface_type_info( } sig_buf.append( ')' ); JNI_info::append_sig( &sig_buf, method_td->pReturnTypeRef ); - + OString method_signature( sig_buf.makeStringAndClear() ); OString method_name( OUStringToOString( OUString::unacquired( &method_td->aBase.pMemberName ), RTL_TEXTENCODING_JAVA_UTF8 ) ); - + m_methods[ nMethodIndex ] = jni->GetMethodID( (jclass) jo_class.get(), method_name.getStr(), method_signature.getStr() ); @@ -168,7 +168,7 @@ JNI_interface_type_info::JNI_interface_type_info( reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >( member_td.get() ); - + // type sig JNI_info::append_sig( &sig_buf, attribute_td->pAttributeTypeRef ); @@ -178,7 +178,7 @@ JNI_interface_type_info::JNI_interface_type_info( OUString const & member_name = OUString::unacquired( &attribute_td->aBase.pMemberName ); - + // getter sig_buf.append( RTL_CONSTASCII_STRINGPARAM("()") ); sig_buf.append( type_sig ); @@ -252,7 +252,7 @@ JNI_compound_type_info::JNI_compound_type_info( typelib_TypeClass_EXCEPTION == m_td.get()->eTypeClass ); typelib_CompoundTypeDescription * td = reinterpret_cast< typelib_CompoundTypeDescription * >( m_td.get() ); - + OUString const & uno_name = OUString::unacquired( &((typelib_TypeDescription *)td)->pTypeName ); @@ -270,7 +270,7 @@ JNI_compound_type_info::JNI_compound_type_info( jni, OUStringToOString( nucleus, RTL_TEXTENCODING_JAVA_UTF8 ).getStr() ) ); - + JNI_info const * jni_info = jni.get_info(); if (typelib_TypeClass_EXCEPTION == m_td.get()->eTypeClass) @@ -281,15 +281,15 @@ JNI_compound_type_info::JNI_compound_type_info( jni.ensure_no_exception(); OSL_ASSERT( 0 != m_exc_ctor ); } - + // retrieve info for base type typelib_TypeDescription * base_td = reinterpret_cast< typelib_TypeDescription * >( td->pBaseTypeDescription ); m_base = (0 == base_td ? 0 : jni_info->get_type_info( jni, base_td )); - + try - { + { if (type_equals( ((typelib_TypeDescription *)td)->pWeakRef, jni_info->m_Exception_type.getTypeLibType() ) || @@ -308,9 +308,9 @@ JNI_compound_type_info::JNI_compound_type_info( else { // retrieve field ids for all direct members - sal_Int32 nMembers = td->nMembers; + sal_Int32 nMembers = td->nMembers; m_fields = new jfieldID[ nMembers ]; - + for ( sal_Int32 nPos = 0; nPos < nMembers; ++nPos ) { OString sig; @@ -327,12 +327,12 @@ JNI_compound_type_info::JNI_compound_type_info( JNI_info::append_sig( &sig_buf, td->ppTypeRefs[ nPos ] ); sig = sig_buf.makeStringAndClear(); } - + OString member_name( OUStringToOString( OUString::unacquired( &td->ppMemberNames[ nPos ] ), RTL_TEXTENCODING_JAVA_UTF8 ) ); - + m_fields[ nPos ] = jni->GetFieldID( (jclass) jo_class.get(), member_name.getStr(), sig.getStr() ); @@ -346,7 +346,7 @@ JNI_compound_type_info::JNI_compound_type_info( delete [] m_fields; throw; } - + m_class = (jclass) jni->NewGlobalRef( jo_class.get() ); } @@ -356,7 +356,7 @@ JNI_type_info const * JNI_info::create_type_info( JNI_context const & jni, typelib_TypeDescription * td ) const { OUString const & uno_name = OUString::unacquired( &td->pTypeName ); - + JNI_type_info * new_info; switch (td->eTypeClass) { @@ -381,7 +381,7 @@ JNI_type_info const * JNI_info::create_type_info( throw BridgeRuntimeError( buf.makeStringAndClear() ); } } - + // look up JNI_type_info * info; ClearableMutexGuard guard( m_mutex ); @@ -397,7 +397,7 @@ JNI_type_info const * JNI_info::create_type_info( info = holder.m_info; guard.clear(); new_info->destroy( jni.get_jni_env() ); - } + } return info; } @@ -409,7 +409,7 @@ JNI_type_info const * JNI_info::get_type_info( { return m_XInterface_type_info; } - + OUString const & uno_name = OUString::unacquired( &td->pTypeName ); JNI_type_info const * info; ClearableMutexGuard guard( m_mutex ); @@ -424,7 +424,7 @@ JNI_type_info const * JNI_info::get_type_info( { info = iFind->second.m_info; } - + return info; } @@ -436,7 +436,7 @@ JNI_type_info const * JNI_info::get_type_info( { return m_XInterface_type_info; } - + OUString const & uno_name = OUString::unacquired( &type->pTypeName ); JNI_type_info const * info; ClearableMutexGuard guard( m_mutex ); @@ -451,7 +451,7 @@ JNI_type_info const * JNI_info::get_type_info( { info = iFind->second.m_info; } - + return info; } @@ -464,13 +464,13 @@ JNI_type_info const * JNI_info::get_type_info( { return m_XInterface_type_info; } - + JNI_type_info const * info; ClearableMutexGuard guard( m_mutex ); t_str2type::const_iterator iFind( m_type_map.find( uno_name ) ); if (iFind == m_type_map.end()) { - guard.clear(); + guard.clear(); css::uno::TypeDescription td( uno_name ); if (! td.is()) { @@ -487,7 +487,7 @@ JNI_type_info const * JNI_info::get_type_info( { info = iFind->second.m_info; } - + return info; } @@ -553,7 +553,7 @@ JNI_info::JNI_info( jni, find_class( jni, "com.sun.star.uno.IEnvironment" ) ); JLocalAutoRef jo_JNI_proxy( jni, find_class( jni, "com.sun.star.bridges.jni_uno.JNI_proxy" ) ); - + // method Object.toString() m_method_Object_toString = jni->GetMethodID( (jclass) jo_Object.get(), "toString", "()Ljava/lang/String;" ); @@ -564,13 +564,13 @@ JNI_info::JNI_info( (jclass) jo_Class.get(), "getName", "()Ljava/lang/String;" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_method_Class_getName ); - + // method Throwable.getMessage() m_method_Throwable_getMessage = jni->GetMethodID( (jclass) jo_Throwable.get(), "getMessage", "()Ljava/lang/String;" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_method_Throwable_getMessage ); - + // method Character.charValue() m_method_Character_charValue = jni->GetMethodID( (jclass) jo_Character.get(), "charValue", "()C" ); @@ -611,7 +611,7 @@ JNI_info::JNI_info( (jclass) jo_Double.get(), "doubleValue", "()D" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_method_Double_doubleValue ); - + // ctor Character( char ) m_ctor_Character_with_char = jni->GetMethodID( (jclass) jo_Character.get(), "<init>", "(C)V" ); @@ -652,7 +652,7 @@ JNI_info::JNI_info( (jclass) jo_Double.get(), "<init>", "(D)V" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_ctor_Double_with_double ); - + // static method UnoRuntime.generateOid() m_method_UnoRuntime_generateOid = jni->GetStaticMethodID( (jclass) jo_UnoRuntime.get(), @@ -666,20 +666,20 @@ JNI_info::JNI_info( "(Lcom/sun/star/uno/Type;Ljava/lang/Object;)Ljava/lang/Object;" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_method_UnoRuntime_queryInterface ); - + // field Enum.m_value m_field_Enum_m_value = jni->GetFieldID( (jclass) jo_Enum.get(), "m_value", "I" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_field_Enum_m_value ); - + // static method TypeClass.fromInt() m_method_TypeClass_fromInt = jni->GetStaticMethodID( (jclass) jo_TypeClass.get(), "fromInt", "(I)Lcom/sun/star/uno/TypeClass;" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_method_TypeClass_fromInt ); - + // ctor Type( Class ) m_ctor_Type_with_Class = jni->GetMethodID( (jclass) jo_Type.get(), "<init>", "(Ljava/lang/Class;)V" ); @@ -703,7 +703,7 @@ JNI_info::JNI_info( "<init>", "(Lcom/sun/star/uno/Type;Ljava/lang/Object;)V" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_ctor_Any_with_Type_Object ); - + // field Any._type m_field_Any__type = jni->GetFieldID( (jclass) jo_Any.get(), "_type", "Lcom/sun/star/uno/Type;" ); @@ -714,7 +714,7 @@ JNI_info::JNI_info( (jclass) jo_Any.get(), "_object", "Ljava/lang/Object;" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_field_Any__object ); - + // method IEnvironment.getRegisteredInterface() m_method_IEnvironment_getRegisteredInterface = jni->GetMethodID( (jclass) jo_IEnvironment.get(), @@ -729,7 +729,7 @@ JNI_info::JNI_info( "Ljava/lang/Object;" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_method_IEnvironment_registerInterface ); - + // static method JNI_proxy.get_proxy_ctor() m_method_JNI_proxy_get_proxy_ctor = jni->GetStaticMethodID( (jclass) jo_JNI_proxy.get(), "get_proxy_ctor", @@ -763,7 +763,7 @@ JNI_info::JNI_info( (jclass) jo_JNI_proxy.get(), "m_oid", "Ljava/lang/String;" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != m_field_JNI_proxy_m_oid ); - + // get java env OUString java_env_type_name( RTL_CONSTASCII_USTRINGPARAM(UNO_LB_JAVA) ); JLocalAutoRef jo_java( @@ -780,7 +780,7 @@ JNI_info::JNI_info( JLocalAutoRef jo_java_env( jni, jni->CallStaticObjectMethodA( (jclass) jo_UnoRuntime.get(), method_getEnvironment, args ) ); - + // get com.sun.star.uno.Any.VOID jfieldID field_Any_VOID = jni->GetStaticFieldID( (jclass) jo_Any.get(), "VOID", "Lcom/sun/star/uno/Any;" ); @@ -813,7 +813,7 @@ JNI_info::JNI_info( JLocalAutoRef jo_Type_UNSIGNED_HYPER( jni, jni->GetStaticObjectField( (jclass) jo_Type.get(), field_Type_UNSIGNED_HYPER ) ); - + // make global refs m_class_UnoRuntime = (jclass) jni->NewGlobalRef( jo_UnoRuntime.get() ); @@ -827,7 +827,7 @@ JNI_info::JNI_info( (jclass) jni->NewGlobalRef( jo_TypeClass.get() ); m_class_JNI_proxy = (jclass) jni->NewGlobalRef( jo_JNI_proxy.get() ); - + m_class_Character = (jclass) jni->NewGlobalRef( jo_Character.get() ); m_class_Boolean = @@ -850,7 +850,7 @@ JNI_info::JNI_info( (jclass) jni->NewGlobalRef( jo_Object.get() ); m_class_Class = (jclass) jni->NewGlobalRef( m_class_Class ); - + m_object_Any_VOID = jni->NewGlobalRef( jo_Any_VOID.get() ); m_object_Type_UNSIGNED_SHORT = @@ -860,7 +860,7 @@ JNI_info::JNI_info( m_object_Type_UNSIGNED_HYPER = jni->NewGlobalRef( jo_Type_UNSIGNED_HYPER.get() ); m_object_java_env = jni->NewGlobalRef( jo_java_env.get() ); - + try { css::uno::TypeDescription XInterface_td( @@ -890,14 +890,14 @@ void JNI_info::destruct( JNIEnv * jni_env ) const_cast< JNI_interface_type_info * >( m_XInterface_type_info )->destroy( jni_env ); } - + // free global refs jni_env->DeleteGlobalRef( m_object_java_env ); jni_env->DeleteGlobalRef( m_object_Any_VOID ); jni_env->DeleteGlobalRef( m_object_Type_UNSIGNED_SHORT ); jni_env->DeleteGlobalRef( m_object_Type_UNSIGNED_LONG ); jni_env->DeleteGlobalRef( m_object_Type_UNSIGNED_HYPER ); - + jni_env->DeleteGlobalRef( m_class_Class ); jni_env->DeleteGlobalRef( m_class_Object ); jni_env->DeleteGlobalRef( m_class_String ); @@ -909,7 +909,7 @@ void JNI_info::destruct( JNIEnv * jni_env ) jni_env->DeleteGlobalRef( m_class_Byte ); jni_env->DeleteGlobalRef( m_class_Boolean ); jni_env->DeleteGlobalRef( m_class_Character ); - + jni_env->DeleteGlobalRef( m_class_JNI_proxy ); jni_env->DeleteGlobalRef( m_class_RuntimeException ); jni_env->DeleteGlobalRef( m_class_UnoRuntime ); @@ -944,7 +944,7 @@ JNI_info const * JNI_info::get_jni_info( (jclass) jo_JNI_info_holder.get(), "s_jni_info_handle", "J" ); jni.ensure_no_exception(); OSL_ASSERT( 0 != field_s_jni_info_handle ); - + JNI_info const * jni_info = reinterpret_cast< JNI_info const * >( jni->GetStaticLongField( @@ -954,7 +954,7 @@ JNI_info const * JNI_info::get_jni_info( JNI_info * new_info = new JNI_info( jni_env, static_cast< jobject >(uno_vm->getClassLoader()), jo_class, jo_forName ); - + ClearableMutexGuard g( Mutex::getGlobalMutex() ); jni_info = reinterpret_cast< JNI_info const * >( @@ -974,7 +974,7 @@ JNI_info const * JNI_info::get_jni_info( new_info->destroy( jni_env ); } } - + return jni_info; } @@ -993,7 +993,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1info_1holder_finalize__J( reinterpret_cast< ::jni_uno::JNI_info * >( jni_info_handle ); jni_info->destroy( jni_env ); } - + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/source/jni_uno/jni_info.h b/bridges/source/jni_uno/jni_info.h index 1382c6f9f4d8..e8cacd8bbc05 100644 --- a/bridges/source/jni_uno/jni_info.h +++ b/bridges/source/jni_uno/jni_info.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -75,7 +75,7 @@ struct JNI_type_info { ::com::sun::star::uno::TypeDescription m_td; jclass m_class; - + virtual void destroy( JNIEnv * jni_env ) = 0; protected: inline void destruct( JNIEnv * jni_env ) @@ -91,8 +91,8 @@ struct JNI_interface_type_info : public JNI_type_info jobject m_proxy_ctor; // proxy ctor jobject m_type; // sorted via typelib function index - jmethodID * m_methods; - + jmethodID * m_methods; + virtual void destroy( JNIEnv * jni_env ); explicit JNI_interface_type_info( JNI_context const & jni, typelib_TypeDescription * td ); @@ -106,7 +106,7 @@ struct JNI_compound_type_info : public JNI_type_info jmethodID m_exc_ctor; // sorted via typelib member index jfieldID * m_fields; - + virtual void destroy( JNIEnv * jni_env ); explicit JNI_compound_type_info( JNI_context const & jni, typelib_TypeDescription * td ); @@ -129,7 +129,7 @@ class JNI_info { mutable ::osl::Mutex m_mutex; mutable t_str2type m_type_map; - + public: // These two are needed very early by find_class from within the ctor: jclass m_class_Class; @@ -141,7 +141,7 @@ public: jobject m_object_Type_UNSIGNED_SHORT; jobject m_object_Type_UNSIGNED_LONG; jobject m_object_Type_UNSIGNED_HYPER; - + // jclass m_class_Object; jclass m_class_Character; @@ -153,14 +153,14 @@ public: jclass m_class_Float; jclass m_class_Double; jclass m_class_String; - + jclass m_class_UnoRuntime; jclass m_class_RuntimeException; jclass m_class_Any; jclass m_class_Type; jclass m_class_TypeClass; jclass m_class_JNI_proxy; - + // jmethodID m_method_Object_toString; jmethodID m_method_Class_getName; @@ -172,7 +172,7 @@ public: jmethodID m_ctor_Integer_with_int; jmethodID m_ctor_Long_with_long; jmethodID m_ctor_Float_with_float; - jmethodID m_ctor_Double_with_double; + jmethodID m_ctor_Double_with_double; jmethodID m_method_Boolean_booleanValue; jmethodID m_method_Byte_byteValue; jmethodID m_method_Character_charValue; @@ -181,7 +181,7 @@ public: jmethodID m_method_Integer_intValue; jmethodID m_method_Long_longValue; jmethodID m_method_Short_shortValue; - + // jmethodID m_method_IEnvironment_getRegisteredInterface; jmethodID m_method_IEnvironment_registerInterface; @@ -195,7 +195,7 @@ public: jfieldID m_field_Type__typeName; jmethodID m_method_TypeClass_fromInt; jfieldID m_field_Enum_m_value; - + // jmethodID m_method_JNI_proxy_get_proxy_ctor; jmethodID m_method_JNI_proxy_create; @@ -210,8 +210,8 @@ public: ::com::sun::star::uno::Type const & m_RuntimeException_type; ::com::sun::star::uno::Type const & m_void_type; // - JNI_interface_type_info const * m_XInterface_type_info; - + JNI_interface_type_info const * m_XInterface_type_info; + // JNI_type_info const * get_type_info( JNI_context const & jni, @@ -226,18 +226,18 @@ public: inline static void append_sig( ::rtl::OStringBuffer * buf, typelib_TypeDescriptionReference * type, bool use_Object_for_type_XInterface = true, bool use_slashes = true ); - + // get this static JNI_info const * get_jni_info( rtl::Reference< jvmaccess::UnoVirtualMachine > const & uno_vm ); inline void destroy( JNIEnv * jni_env ); - + private: JNI_type_info const * create_type_info( JNI_context const & jni, typelib_TypeDescription * td ) const; - + void destruct( JNIEnv * jni_env ); - + JNI_info( JNIEnv * jni_env, jobject class_loader, jclass classClass, jmethodID methodForName ); inline ~JNI_info() {} diff --git a/bridges/source/jni_uno/jni_java2uno.cxx b/bridges/source/jni_uno/jni_java2uno.cxx index fa32e879f1bd..bd1bd2d734e0 100644 --- a/bridges/source/jni_uno/jni_java2uno.cxx +++ b/bridges/source/jni_uno/jni_java2uno.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -198,7 +198,7 @@ jobject Bridge::call_uno( return_size = sizeof (largest); break; } - + #ifdef BROKEN_ALLOCA char * mem = (char *) malloc( #else @@ -210,7 +210,7 @@ jobject Bridge::call_uno( void * uno_ret = return_size == 0 ? 0 : (mem + (nParams * sizeof (void *))); largest * uno_args_mem = (largest *) (mem + (nParams * sizeof (void *)) + return_size); - + OSL_ASSERT( (0 == nParams) || (nParams == jni->GetArrayLength( jo_args )) ); for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) { @@ -506,14 +506,14 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call( } typelib_InterfaceTypeDescription * td = - reinterpret_cast< typelib_InterfaceTypeDescription * >( + reinterpret_cast< typelib_InterfaceTypeDescription * >( jni->GetLongField( jo_proxy, jni_info->m_field_JNI_proxy_m_td_handle ) ); uno_Interface * pUnoI = reinterpret_cast< uno_Interface * >( jni->GetLongField( jo_proxy, jni_info->m_field_JNI_proxy_m_receiver_handle ) ); - + typelib_TypeDescriptionReference ** ppAllMembers = td->ppAllMembers; for ( sal_Int32 nPos = td->nAllMembers; nPos--; ) { @@ -522,7 +522,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_dispatch_1call( // typelib_typedescriptionreference_getDescription() typelib_TypeDescriptionReference * member_type = ppAllMembers[ nPos ]; - + // check method_name against fully qualified type_name // of member_type; type_name is of the form // <name> "::" <method_name> *(":@" <idx> "," <idx> ":" <name>) @@ -677,7 +677,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_finalize__J( reinterpret_cast< typelib_TypeDescription * >( jni->GetLongField( jo_proxy, jni_info->m_field_JNI_proxy_m_td_handle ) ); - + #if OSL_DEBUG_LEVEL > 1 { JLocalAutoRef jo_oid( @@ -685,7 +685,7 @@ JNICALL Java_com_sun_star_bridges_jni_1uno_JNI_1proxy_finalize__J( jo_proxy, jni_info->m_field_JNI_proxy_m_oid ) ); OUString oid( jstring_to_oustring( jni, (jstring) jo_oid.get() ) ); OString cstr_msg( - OUStringToOString( + OUStringToOString( OUSTR("freeing java uno proxy: ") + oid, RTL_TEXTENCODING_ASCII_US ) ); OSL_TRACE( cstr_msg.getStr() ); diff --git a/bridges/source/jni_uno/jni_uno2java.cxx b/bridges/source/jni_uno/jni_uno2java.cxx index 70e139d66aab..d4c59ab2ad11 100644 --- a/bridges/source/jni_uno/jni_uno2java.cxx +++ b/bridges/source/jni_uno/jni_uno2java.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -89,7 +89,7 @@ void Bridge::handle_java_exc( jni.ensure_no_exception(); OUString exc_name( jstring_to_oustring( jni, (jstring) jo_class_name.get() ) ); - + ::com::sun::star::uno::TypeDescription td( exc_name.pData ); if (!td.is() || (typelib_TypeClass_EXCEPTION != td.get()->eTypeClass)) { @@ -148,11 +148,11 @@ void Bridge::call_java( void * uno_ret, void * uno_args [], uno_Any ** uno_exc ) const { OSL_ASSERT( function_pos_offset == 0 || function_pos_offset == 1 ); - + JNI_guarded_context jni( m_jni_info, reinterpret_cast< ::jvmaccess::UnoVirtualMachine * >( m_java_env->pContext ) ); - + // assure fully initialized iface_td: ::com::sun::star::uno::TypeDescription iface_holder; if (! iface_td->aBase.bComplete) { @@ -171,14 +171,14 @@ void Bridge::call_java( iface_holder.get() ); OSL_ASSERT( iface_td->aBase.eTypeClass == typelib_TypeClass_INTERFACE ); } - + // prepare java args, save param td #ifdef BROKEN_ALLOCA jvalue * java_args = (jvalue *) malloc( sizeof (jvalue) * nParams ); #else jvalue * java_args = (jvalue *) alloca( sizeof (jvalue) * nParams ); #endif - + sal_Int32 nPos; for ( nPos = 0; nPos < nParams; ++nPos ) { @@ -227,7 +227,7 @@ void Bridge::call_java( && function_pos < iface_td->nMapFunctionIndexToMemberIndex, "### illegal function index!" ); function_pos -= base_members_function_pos; - + JNI_interface_type_info const * info = static_cast< JNI_interface_type_info const * >( m_jni_info->get_type_info( jni, &iface_td->aBase ) ); @@ -525,7 +525,7 @@ uno_Interface * Bridge::map_to_uno( pUnoI = new UNO_proxy( jni, const_cast< Bridge * >( this ), javaI, (jstring) jo_oid.get(), oid, info ); - + (*m_uno_env->registerProxyInterface)( m_uno_env, (void **)&pUnoI, UNO_proxy_free, @@ -555,7 +555,7 @@ void SAL_CALL UNO_proxy_free( uno_ExtEnvironment * env, void * proxy ) } #if OSL_DEBUG_LEVEL > 1 OString cstr_msg( - OUStringToOString( + OUStringToOString( OUSTR("freeing binary uno proxy: ") + that->m_oid, RTL_TEXTENCODING_ASCII_US ) ); OSL_TRACE( cstr_msg.getStr() ); @@ -567,7 +567,7 @@ void SAL_CALL UNO_proxy_free( uno_ExtEnvironment * env, void * proxy ) bridge->m_jni_info, reinterpret_cast< ::jvmaccess::UnoVirtualMachine * >( bridge->m_java_env->pContext ) ); - + jni->DeleteGlobalRef( that->m_javaI ); jni->DeleteGlobalRef( that->m_jo_oid ); } @@ -740,7 +740,7 @@ void SAL_CALL UNO_proxy_dispatch( jni_info->m_class_UnoRuntime, jni_info->m_method_UnoRuntime_queryInterface, args ) ); - + if (jni->ExceptionCheck()) { JLocalAutoRef jo_exc( jni, jni->ExceptionOccurred() ); @@ -772,7 +772,7 @@ void SAL_CALL UNO_proxy_dispatch( reinterpret_cast< typelib_InterfaceTypeDescription * >( info->m_td.get() ) ); - + uno_any_construct( (uno_Any *)uno_ret, &pUnoI2, demanded_td.get(), 0 ); diff --git a/bridges/source/jni_uno/nativethreadpool.cxx b/bridges/source/jni_uno/nativethreadpool.cxx index 9c92e89c5b07..870b67844806 100644 --- a/bridges/source/jni_uno/nativethreadpool.cxx +++ b/bridges/source/jni_uno/nativethreadpool.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/context/context.cxx b/bridges/source/remote/context/context.cxx index 3e0ffeac894f..75991d45f546 100644 --- a/bridges/source/remote/context/context.cxx +++ b/bridges/source/remote/context/context.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -77,7 +77,7 @@ public: static void SAL_CALL thisRemoveDisposingListener( remote_Context *, remote_DisposingListener *); static void SAL_CALL thisDispose( remote_Context *); public: - oslInterlockedCount m_nRef; + oslInterlockedCount m_nRef; sal_Bool m_bDisposed; list < remote_DisposingListener * > m_lstListener; Mutex m_mutex; diff --git a/bridges/source/remote/idl/corba.idl b/bridges/source/remote/idl/corba.idl index b71d16e2eff1..63f93283d41e 100644 --- a/bridges/source/remote/idl/corba.idl +++ b/bridges/source/remote/idl/corba.idl @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,7 +50,7 @@ module corba { ThreadIDs IDs; }; - + struct CorbaString8 { string theString; @@ -80,9 +80,9 @@ module corba tk_value, tk_value_box, tk_native, tk_abstract_interface - }; + }; }; -}; -}; -}; +}; +}; +}; diff --git a/bridges/source/remote/static/helper.cxx b/bridges/source/remote/static/helper.cxx index f0fc40106d36..d120d38b80df 100644 --- a/bridges/source/remote/static/helper.cxx +++ b/bridges/source/remote/static/helper.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -44,7 +44,7 @@ using namespace ::com::sun::star::uno; namespace bridges_remote { - + void SAL_CALL remote_createStub ( remote_Interface **ppRemoteI, rtl_uString *pOid , @@ -53,7 +53,7 @@ void SAL_CALL remote_createStub ( ReleaseRemoteCallbackFunc releaseRemoteCallback ) { typelib_TypeDescription *pType = 0; - typelib_typedescriptionreference_getDescription( &pType, pTypeRef ); + typelib_typedescriptionreference_getDescription( &pType, pTypeRef ); (void) pEnvRemote->pExtEnv->getRegisteredInterface( pEnvRemote->pExtEnv, @@ -90,7 +90,7 @@ void SAL_CALL remote_createStub ( (typelib_InterfaceTypeDescription * ) pType, pEnvRemote, pImpl->m_sendRequest); - + // ppRemoteI may change during registration pEnvRemote->pExtEnv->registerProxyInterface( pEnvRemote->pExtEnv, @@ -115,17 +115,17 @@ void SAL_CALL remote_sendQueryInterface( typelib_InterfaceTypeDescription *pType = 0; typelib_typedescriptionreference_getDescription( (typelib_TypeDescription ** )&pType, pTypeRef ); - + if( *ppRemoteI ) { (*ppRemoteI)->release( *ppRemoteI ); (*ppRemoteI) = 0; } - + remote_BridgeImpl *pImpl = ((remote_Context *)pEnvRemote->pContext)->m_pBridgeImpl; - + Type type = ::getCppuType( (Reference < XInterface > *)0 ); - + // get type for queryInterface OUString sCompleteMethodName = type.getTypeName(); sCompleteMethodName += OUString(RTL_CONSTASCII_USTRINGPARAM("::queryInterface")); @@ -134,13 +134,13 @@ void SAL_CALL remote_sendQueryInterface( typelib_typedescription_getByName( (typelib_TypeDescription **) &pMemberType, sCompleteMethodName.pData ); - + OSL_ASSERT( pMemberType ); - + uno_Any anyInterface; anyInterface.pType = 0; anyInterface.pData = 0; - + void *pReturn = &anyInterface; void *ppArgs[1]; @@ -151,9 +151,9 @@ void SAL_CALL remote_sendQueryInterface( pType->aBase.pTypeName); ppArgs[0] = &pRef; - -// uno_Any anyException; -// uno_Any *pAnyException = &anyException; + +// uno_Any anyException; +// uno_Any *pAnyException = &anyException; // do the queryInterface pImpl->m_sendRequest( @@ -165,11 +165,11 @@ void SAL_CALL remote_sendQueryInterface( ppArgs, ppException ); - + // now release everything typelib_typedescriptionreference_release( pRef ); typelib_typedescription_release( (typelib_TypeDescription * ) pMemberType ); - + if( *ppException ) { *ppRemoteI = 0; diff --git a/bridges/source/remote/static/mapping.cxx b/bridges/source/remote/static/mapping.cxx index 3402cfe68268..cd0201cbb87c 100644 --- a/bridges/source/remote/static/mapping.cxx +++ b/bridges/source/remote/static/mapping.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -60,7 +60,7 @@ static void SAL_CALL thisAcquire( uno_Mapping *pMap ) p->pEnvRemote , p->m_sPurpose.pData ); } - + } } @@ -76,12 +76,12 @@ static void SAL_CALL thisRelease( uno_Mapping *pMap ) } namespace bridges_remote { - + void remoteToUno( uno_Mapping *pMapping, void **ppUnoI, void *pRemoteI, typelib_InterfaceTypeDescription *pTypeDescr ) { remote_Mapping *pRemoteMapping = ( remote_Mapping * ) pMapping; - + OSL_ASSERT( ppUnoI && pTypeDescr ); if (*ppUnoI) { @@ -110,7 +110,7 @@ void remoteToUno( uno_Mapping *pMapping, void **ppUnoI, void *pRemoteI, ppUnoI, pOid, pTypeDescr); - + if ( ! *ppUnoI) // already existing interface { // try to publish a new proxy; proxy may be exchanged during registration @@ -120,14 +120,14 @@ void remoteToUno( uno_Mapping *pMapping, void **ppUnoI, void *pRemoteI, pTypeDescr , pRemoteMapping->pEnvUno, pRemoteMapping->pEnvRemote); - + pRemoteMapping->pEnvUno->pExtEnv->registerProxyInterface( pRemoteMapping->pEnvUno->pExtEnv, ppUnoI, freeRemote2UnoProxy, pOid, pTypeDescr ); - + OSL_ASSERT( *ppUnoI ); } rtl_uString_release( pOid ); @@ -158,7 +158,7 @@ void unoToRemote( uno_Mapping *pMapping, void **ppRemoteI, void *pUnoI, { return; } - + pRemoteMapping->pEnvRemote->pExtEnv->getRegisteredInterface( pRemoteMapping->pEnvRemote->pExtEnv, (void**)ppRemoteI, @@ -173,8 +173,8 @@ void unoToRemote( uno_Mapping *pMapping, void **ppRemoteI, void *pUnoI, pOid, pTypeDescr, pRemoteMapping->pEnvUno, - pRemoteMapping->pEnvRemote ); - + pRemoteMapping->pEnvRemote ); + // note : ppRemoteI may change during registration pRemoteMapping->pEnvRemote->pExtEnv->registerProxyInterface( pRemoteMapping->pEnvRemote->pExtEnv, @@ -201,7 +201,7 @@ RemoteMapping::RemoteMapping( uno_Environment *pEnvUno_ , { pEnvUno = pEnvUno_; pEnvRemote = pEnvRemote_; - + pEnvUno->acquire( pEnvUno ); pEnvRemote->acquire( pEnvRemote ); diff --git a/bridges/source/remote/static/proxy.cxx b/bridges/source/remote/static/proxy.cxx index db7b9a67a903..bf8428264ab6 100644 --- a/bridges/source/remote/static/proxy.cxx +++ b/bridges/source/remote/static/proxy.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -85,7 +85,7 @@ void releaseRemote2UnoProxy( uno_Interface *pThis ) Remote2UnoProxy *p = ( Remote2UnoProxy * ) pThis; if ( 0 == osl_decrementInterlockedCount( &(p->m_nRef) )) { - p->m_pEnvUno->pExtEnv->revokeInterface( p->m_pEnvUno->pExtEnv, p ); + p->m_pEnvUno->pExtEnv->revokeInterface( p->m_pEnvUno->pExtEnv, p ); } } diff --git a/bridges/source/remote/static/remote.cxx b/bridges/source/remote/static/remote.cxx index e94743469271..24e7674f8cf1 100644 --- a/bridges/source/remote/static/remote.cxx +++ b/bridges/source/remote/static/remote.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/static/remote_types.cxx b/bridges/source/remote/static/remote_types.cxx index f47580d8da92..95f023508ee4 100644 --- a/bridges/source/remote/static/remote_types.cxx +++ b/bridges/source/remote/static/remote_types.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -31,7 +31,7 @@ #include "remote_types.hxx" namespace bridges_remote { - + sal_Bool SAL_CALL remote_relatesToInterface2( typelib_TypeDescription * pTypeDescr ) { switch (pTypeDescr->eTypeClass) @@ -93,7 +93,7 @@ sal_Bool SAL_CALL remote_relatesToInterface2( typelib_TypeDescription * pTypeDes } return sal_False; } - + } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/bridges/source/remote/static/remote_types.hxx b/bridges/source/remote/static/remote_types.hxx index 9325cbc18167..024f38037349 100644 --- a/bridges/source/remote/static/remote_types.hxx +++ b/bridges/source/remote/static/remote_types.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ namespace bridges_remote { - + inline sal_Bool SAL_CALL remote_relatesToInterface( typelib_TypeDescription *pTypeDescr ); sal_Bool SAL_CALL remote_relatesToInterface2( typelib_TypeDescription * pTypeDescr ); diff --git a/bridges/source/remote/static/stub.cxx b/bridges/source/remote/static/stub.cxx index 58796351d5bd..ee6d33184eca 100644 --- a/bridges/source/remote/static/stub.cxx +++ b/bridges/source/remote/static/stub.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/urp/urp_bridgeimpl.cxx b/bridges/source/remote/urp/urp_bridgeimpl.cxx index 0e25746f0a42..53443a0ecf63 100644 --- a/bridges/source/remote/urp/urp_bridgeimpl.cxx +++ b/bridges/source/remote/urp/urp_bridgeimpl.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -199,7 +199,7 @@ void urp_BridgeImpl::applyProtocolChanges( const Properties &props ) { m_properties.bForceSynchronous = props.bForceSynchronous; } - + m_properties.bCurrentContext = props.bCurrentContext; } diff --git a/bridges/source/remote/urp/urp_bridgeimpl.hxx b/bridges/source/remote/urp/urp_bridgeimpl.hxx index 4e6d31d22505..59795fac17cd 100644 --- a/bridges/source/remote/urp/urp_bridgeimpl.hxx +++ b/bridges/source/remote/urp/urp_bridgeimpl.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,7 +48,7 @@ namespace bridges_urp { class PropertyObject; - + struct equalOUString { sal_Int32 operator() ( const ::rtl::OUString &s1, const ::rtl::OUString &s2 ) const @@ -56,8 +56,8 @@ struct equalOUString return s1 == s2; } }; - -struct equalType + +struct equalType { sal_Int32 operator() ( const ::com::sun::star::uno::Type &t1, const ::com::sun::star::uno::Type &t2 ) const @@ -68,13 +68,13 @@ struct equalType class OWriterThread; class OReaderThread; - + struct urp_BridgeImpl : public remote_BridgeImpl { urp_BridgeImpl( sal_Int32 nCacheSize , sal_uInt32 nInitialMarshalerSize ); ~urp_BridgeImpl(); - + void applyProtocolChanges( const Properties & ); void startBlockBridge(); @@ -89,7 +89,7 @@ struct urp_BridgeImpl : ::osl::Mutex m_errorListMutex; Marshal m_blockMarshaler; sal_Int32 m_nMarshaledMessages; - + // Caches for vars, that go from local process to the remote process Cache < ::rtl::OUString , equalOUString > m_oidCacheOut; Cache < ::rtl::ByteSequence , EqualThreadId > m_tidCacheOut; @@ -107,9 +107,9 @@ struct urp_BridgeImpl : ::com::sun::star::uno::Type m_lastInType; ::rtl::ByteSequence m_lastInTid; ::rtl::OUString m_lastInOid; - + urp_ClientJobContainer m_clientJobContainer; - + OWriterThread *m_pWriter; OReaderThread *m_pReader; ::rtl::OString m_sLogFileName; diff --git a/bridges/source/remote/urp/urp_cache.h b/bridges/source/remote/urp/urp_cache.h index a0150c854594..ca3dec9c8298 100644 --- a/bridges/source/remote/urp/urp_cache.h +++ b/bridges/source/remote/urp/urp_cache.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/urp/urp_cache.hxx b/bridges/source/remote/urp/urp_cache.hxx index 5aec834199be..e8677116cb96 100644 --- a/bridges/source/remote/urp/urp_cache.hxx +++ b/bridges/source/remote/urp/urp_cache.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,8 +41,8 @@ namespace bridges_urp m_pCache( new t[nMaxEntries] ), m_nMaxEntries( nMaxEntries ), m_nEntries( 0 ) - { - + { + } template < class t , class tequals > @@ -81,7 +81,7 @@ namespace bridges_urp } return nEntry; } - + template < class t , class tequals > inline sal_uInt16 Cache< t , tequals >::seek( const t & value ) { @@ -110,7 +110,7 @@ namespace bridges_urp sal_Int32 operator () ( const t &value ) const { return value >= m_; } }; - + template < class t, class tequals > inline void Cache < t , tequals >::resize( sal_uInt16 nNewMaxEntries ) { diff --git a/bridges/source/remote/urp/urp_dispatch.cxx b/bridges/source/remote/urp/urp_dispatch.cxx index 459900b2460a..c8c405403938 100644 --- a/bridges/source/remote/urp/urp_dispatch.cxx +++ b/bridges/source/remote/urp/urp_dispatch.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/urp/urp_dispatch.hxx b/bridges/source/remote/urp/urp_dispatch.hxx index 2b44854e3350..146732d339b2 100644 --- a/bridges/source/remote/urp/urp_dispatch.hxx +++ b/bridges/source/remote/urp/urp_dispatch.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ namespace bridges_urp { const sal_uInt8 HDRFLAG_EXCEPTION = 0x20; void SAL_CALL urp_sendCloseConnection( uno_Environment *pEnvRemote ); - + extern "C" void SAL_CALL urp_sendRequest( uno_Environment *pEnvRemote, typelib_TypeDescription const * pMemberType, diff --git a/bridges/source/remote/urp/urp_environment.cxx b/bridges/source/remote/urp/urp_environment.cxx index f1a61896202b..9f13e60c35e4 100644 --- a/bridges/source/remote/urp/urp_environment.cxx +++ b/bridges/source/remote/urp/urp_environment.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -73,18 +73,18 @@ rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT; // static void dumpProperties( struct Properties *p ) // { -// fprintf( stderr , "FlushBlockSize : %d\n" , p->nFlushBlockSize ); -// fprintf( stderr , "OnewayTimeoutMUSEC : %d\n" , p->nOnewayTimeoutMUSEC ); -// fprintf( stderr , "OidCacheSize : %d\n" , p->nOidCacheSize ); -// fprintf( stderr , "TypeCacheSize : %d\n" , p->nTypeCacheSize ); -// fprintf( stderr , "TidCacheSize : %d\n" , p->nTidCacheSize ); -// OString o = OUStringToOString( p->sSupportedVersions , RTL_TEXTENCODING_ASCII_US ); -// fprintf( stderr , "SupportedVersions : %s\n" , o.pData->buffer ); -// o = OUStringToOString( p->sVersion , RTL_TEXTENCODING_ASCII_US ); -// fprintf( stderr , "Version : %s\n" , o.pData->buffer ); -// fprintf( stderr , "SupportsMultipleSynchronous : %d\n" , p->bSupportsMultipleSynchronous ); -// fprintf( stderr , "SupportsMustReply : %d\n" , p->bSupportsMustReply ); -// fprintf( stderr , "SupportsSynchronous : %d\n" , p->bSupportsSynchronous ); +// fprintf( stderr , "FlushBlockSize : %d\n" , p->nFlushBlockSize ); +// fprintf( stderr , "OnewayTimeoutMUSEC : %d\n" , p->nOnewayTimeoutMUSEC ); +// fprintf( stderr , "OidCacheSize : %d\n" , p->nOidCacheSize ); +// fprintf( stderr , "TypeCacheSize : %d\n" , p->nTypeCacheSize ); +// fprintf( stderr , "TidCacheSize : %d\n" , p->nTidCacheSize ); +// OString o = OUStringToOString( p->sSupportedVersions , RTL_TEXTENCODING_ASCII_US ); +// fprintf( stderr , "SupportedVersions : %s\n" , o.pData->buffer ); +// o = OUStringToOString( p->sVersion , RTL_TEXTENCODING_ASCII_US ); +// fprintf( stderr , "Version : %s\n" , o.pData->buffer ); +// fprintf( stderr , "SupportsMultipleSynchronous : %d\n" , p->bSupportsMultipleSynchronous ); +// fprintf( stderr , "SupportsMustReply : %d\n" , p->bSupportsMustReply ); +// fprintf( stderr , "SupportsSynchronous : %d\n" , p->bSupportsSynchronous ); // } // PropertySetterThread diff --git a/bridges/source/remote/urp/urp_job.cxx b/bridges/source/remote/urp/urp_job.cxx index 8af686fa3ef3..62d43863276d 100644 --- a/bridges/source/remote/urp/urp_job.cxx +++ b/bridges/source/remote/urp/urp_job.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -98,7 +98,7 @@ namespace bridges_urp } return bReturn; } - + //-------------------------------------------------------------------------------------- static void prepareRuntimeExceptionClientSide( uno_Any **ppException , const OUString &s) { @@ -114,7 +114,7 @@ namespace bridges_urp uno_type_any_construct( *ppException , &exception , type.getTypeLibType() , 0 ); } - + Job::Job( uno_Environment *pEnvRemote, remote_Context *pContext, sal_Sequence *pTid, @@ -146,19 +146,19 @@ namespace bridges_urp - + //-------------------------------------------------------------------------------------- sal_Bool ClientJob::extract( ) { sal_Bool bReturn = sal_True; //------------------------------- - // Handle the reply, unpack data + // Handle the reply, unpack data //------------------------------- if( m_bExceptionOccured ) { bReturn = m_pUnmarshal->unpackAny( *m_ppException ); } - else + else { //--------------------------------- // alles ist gut @@ -215,7 +215,7 @@ namespace bridges_urp uno_threadpool_putJob( m_pBridgeImpl->m_hThreadPool, m_pTid , this, 0, sal_False); } - //-------------------------------------------------------------------------------------------- + //-------------------------------------------------------------------------------------------- sal_Bool ClientJob::pack() { sal_Bool bSuccess = sal_True; @@ -295,7 +295,7 @@ namespace bridges_urp // the flag byte is needed + request nFlags = nFlags | HDRFLAG_LONGHEADER | HDRFLAG_REQUEST; // - // as long as we do not have customized calls, no MOREFLAGS must be set + // as long as we do not have customized calls, no MOREFLAGS must be set if( m_nMethodIndex >= 0x100 ) { nFlags = nFlags | HDRFLAG_LONGMETHODID; @@ -347,7 +347,7 @@ namespace bridges_urp if( bOid ) { m_pBridgeImpl->m_lastOutOid = *(OUString *)&m_pOid; - m_pBridgeImpl->m_blockMarshaler.packOid( m_pBridgeImpl->m_lastOutOid ); + m_pBridgeImpl->m_blockMarshaler.packOid( m_pBridgeImpl->m_lastOutOid ); } if( bTid ) { @@ -359,7 +359,7 @@ namespace bridges_urp && m_nMethodIndex != REMOTE_RELEASE_METHOD_INDEX && m_pContext != 0 ) { - void * pCc = 0; + void * pCc = 0; rtl::OUString aEnvName( RTL_CONSTASCII_USTRINGPARAM( "urp" ) ); bSuccess = bSuccess && uno_getCurrentContext( &pCc, aEnvName.pData, m_pContext ); @@ -375,7 +375,7 @@ namespace bridges_urp p->release( p ); } } - + // marshal arguments ! #ifdef BRIDGES_URP_PROT sal_Int32 nLogHeader = m_pBridgeImpl->m_blockMarshaler.getPos(); @@ -439,7 +439,7 @@ namespace bridges_urp m_pMethodType ? m_pMethodType->aBase.pMemberName : m_pAttributeType->aBase.pMemberName ); #endif - + if( bSuccess ) { if( ! m_bOneway ) @@ -453,7 +453,7 @@ namespace bridges_urp // Inform the writer thread, that there is some work to do //--------------------------- m_pBridgeImpl->m_pWriter->touch( ! m_bOneway ); - + if( m_bOneway ) { *m_ppException = 0; @@ -489,9 +489,9 @@ namespace bridges_urp // Wait for the reply //--------------------------- void * pDisposeReason = 0; - + uno_threadpool_enter(m_pBridgeImpl->m_hThreadPool, &pDisposeReason ); - + if( ! pDisposeReason ) { // thread has been disposed ! @@ -501,14 +501,14 @@ namespace bridges_urp // it won't be in the container anymore, but it is eiterway safe to call // the method ClientJob *pJob = - m_pBridgeImpl->m_clientJobContainer.remove( *(ByteSequence*) &m_pTid ); + m_pBridgeImpl->m_clientJobContainer.remove( *(ByteSequence*) &m_pTid ); if( pJob != this ) { // this is not our job, it is probably one of the callstack below, so // push it back m_pBridgeImpl->m_clientJobContainer.add( *(ByteSequence*) &m_pTid , pJob ); } - + OUStringBuffer sMessage( 256 ); sMessage.appendAscii( RTL_CONSTASCII_STRINGPARAM( "URP_Bridge : disposed\n" ) ); sMessage.append( m_pBridgeImpl->getErrorsAsString() ); @@ -543,7 +543,7 @@ namespace bridges_urp , m_nCurrentMemPosition( 0 ) { m_pEnvRemote->acquire( m_pEnvRemote ); - m_nCurrentMemSize = MULTIJOB_STANDARD_MEMORY_SIZE + m_nMaxMessages * ( + m_nCurrentMemSize = MULTIJOB_STANDARD_MEMORY_SIZE + m_nMaxMessages * ( MULTIJOB_PER_CALL_MEMORY_SIZE + sizeof(ServerJobEntry) + sizeof(MemberTypeInfo) ); m_pCurrentMem = ( sal_Int8 * ) rtl_allocateMemory( m_nCurrentMemSize ); m_aEntries = ( ServerJobEntry * ) getHeap( m_nMaxMessages * sizeof( ServerJobEntry ) ); @@ -557,7 +557,7 @@ namespace bridges_urp { struct MemberTypeInfo *const pMTI = &( m_aTypeInfo[i] ); struct ServerJobEntry *const pSJE = &( m_aEntries[i] ); - + if( pSJE->m_pRemoteI ) pSJE->m_pRemoteI->release( pSJE->m_pRemoteI ); @@ -566,10 +566,10 @@ namespace bridges_urp if( pSJE->m_pInterfaceTypeRef ) typelib_typedescriptionreference_release( pSJE->m_pInterfaceTypeRef ); - + if( pMTI->m_pInterfaceType ) TYPELIB_DANGER_RELEASE( (typelib_TypeDescription *)pMTI->m_pInterfaceType ); - + for( sal_Int32 iArgs = 0 ; iArgs < pMTI->m_nArgCount ; iArgs ++ ) { if( pMTI->m_ppArgType[iArgs] ) @@ -635,10 +635,10 @@ namespace bridges_urp // is not a release call. remote_Context *pRemoteC = ((remote_Context*)m_pEnvRemote->pContext); - if( ! pMTI->m_bIsReleaseCall && pRemoteC->m_pInstanceProvider ) + if( ! pMTI->m_bIsReleaseCall && pRemoteC->m_pInstanceProvider ) { pSJE->m_pException = &(pSJE->m_exception); - + pRemoteC->m_pInstanceProvider->getInstance( pRemoteC->m_pInstanceProvider, m_pEnvRemote, @@ -667,7 +667,7 @@ namespace bridges_urp else { pSJE->m_pException = &(pSJE->m_exception ); - + if( pMTI->m_bIsReleaseCall ) { pSJE->m_pRemoteI->release( pSJE->m_pRemoteI ); @@ -708,18 +708,18 @@ namespace bridges_urp uno_destructData( pSJE->m_ppArgs[j] , pMTI->m_ppArgType[j] , 0 ); } } - + if( pSJE->m_pException ) { uno_any_destruct( pSJE->m_pException, ::bridges_remote::remote_release ); } - + } else { // synchron, get the mutex to marshal reply and send immeadiatly MutexGuard guard( m_pBridgeImpl->m_marshalingMutex ); - + sal_Bool bTid = sal_False; sal_uInt8 nFlags = HDRFLAG_LONGHEADER; ByteSequence tid = m_pTid; @@ -729,7 +729,7 @@ namespace bridges_urp nFlags = nFlags | HDRFLAG_NEWTID; bTid = sal_True; } - + if( pSJE->m_pException ) { nFlags = nFlags | HDRFLAG_EXCEPTION; @@ -738,7 +738,7 @@ namespace bridges_urp sal_Int32 nLogStart = m_pBridgeImpl->m_blockMarshaler.getPos(); #endif m_pBridgeImpl->m_blockMarshaler.packInt8( &nFlags ); - + if( bTid ) { if( ! pSJE->m_bIgnoreCache ) @@ -759,7 +759,7 @@ namespace bridges_urp //-------------------- m_pBridgeImpl->m_blockMarshaler.packAny( &(pSJE->m_exception) ); uno_any_destruct( &(pSJE->m_exception) , ::bridges_remote::remote_release ); - + // destroy in parameters for( sal_Int32 j = 0 ; j < pMTI->m_nArgCount ; j ++ ) { @@ -799,21 +799,21 @@ namespace bridges_urp } } } - + #ifdef BRIDGES_URP_PROT { typelib_InterfaceMemberTypeDescription *pMemberType = pMTI->m_pMethodType ? (typelib_InterfaceMemberTypeDescription*)pMTI->m_pMethodType : (typelib_InterfaceMemberTypeDescription*)pMTI->m_pAttributeType; - + urp_logReplying( m_pBridgeImpl , m_pBridgeImpl->m_blockMarshaler.getPos() - nLogStart, m_pBridgeImpl->m_blockMarshaler.getPos() - nLogHeader, pMemberType->pMemberName ); - } + } #endif - + m_pBridgeImpl->m_nMarshaledMessages ++; // put it on the wire m_pBridgeImpl->m_pWriter->touch( sal_True ); @@ -832,7 +832,7 @@ namespace bridges_urp } } } - + //------------------------------------------------------------------------------------- void ServerMultiJob::prepareRuntimeException( const OUString & sMessage , sal_Int32 nCall ) { @@ -876,7 +876,7 @@ namespace bridges_urp pSJE->m_ppArgs = 0; pSJE->m_pReturn = 0; pMTI->m_pReturnType = 0; - + if( pMTI->m_nArgCount ) { pMTI->m_ppArgType = @@ -888,11 +888,11 @@ namespace bridges_urp if( pMTI->m_pMethodType && pMTI->m_pMethodType->pReturnTypeRef->eTypeClass != typelib_TypeClass_VOID ) { - TYPELIB_DANGER_GET( &(pMTI->m_pReturnType), pMTI->m_pMethodType->pReturnTypeRef ); + TYPELIB_DANGER_GET( &(pMTI->m_pReturnType), pMTI->m_pMethodType->pReturnTypeRef ); } else if( pMTI->m_pAttributeType && ! pMTI->m_nArgCount ) { - TYPELIB_DANGER_GET( &(pMTI->m_pReturnType) , pMTI->m_pAttributeType->pAttributeTypeRef ); + TYPELIB_DANGER_GET( &(pMTI->m_pReturnType) , pMTI->m_pAttributeType->pAttributeTypeRef ); } // normal method @@ -901,10 +901,10 @@ namespace bridges_urp for( sal_Int32 i = 0 ; i < pMTI->m_nArgCount ; i ++ ) { pMTI->m_ppArgType[i] = 0; - TYPELIB_DANGER_GET( & ( pMTI->m_ppArgType[i] ) , pMTI->m_pMethodType->pParams[i].pTypeRef); + TYPELIB_DANGER_GET( & ( pMTI->m_ppArgType[i] ) , pMTI->m_pMethodType->pParams[i].pTypeRef); pMTI->m_pbIsIn[i] = pMTI->m_pMethodType->pParams[i].bIn; pMTI->m_pbIsOut[i] = pMTI->m_pMethodType->pParams[i].bOut; - + pSJE->m_ppArgs[i] = getHeap( pMTI->m_ppArgType[i]->nSize ); if( pMTI->m_pbIsIn[i] ) { diff --git a/bridges/source/remote/urp/urp_job.hxx b/bridges/source/remote/urp/urp_job.hxx index ed31e33c387b..08bc43f89184 100644 --- a/bridges/source/remote/urp/urp_job.hxx +++ b/bridges/source/remote/urp/urp_job.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,12 +45,12 @@ const sal_Int32 MULTIJOB_PER_CALL_MEMORY_SIZE = 96; class Unmarshal; struct urp_BridgeImpl; -template < class t > +template < class t > inline t mymax( const t &t1 , const t &t2 ) { return t1 > t2 ? t1 : t2; } - + class Job { public: @@ -80,7 +80,7 @@ public: public: remote_Context *m_pContext; Unmarshal *m_pUnmarshal; - struct urp_BridgeImpl *m_pBridgeImpl; + struct urp_BridgeImpl *m_pBridgeImpl; sal_Sequence *m_pTid; ::bridges_remote::RemoteThreadCounter m_counter; }; @@ -92,17 +92,17 @@ public: inline ClientJob( uno_Environment *pEnvRemote, // weak ! remote_Context *pContext, struct urp_BridgeImpl *pBridgeImpl, - rtl_uString *pOid, // weak - typelib_TypeDescription const * pMemberType, // weak + rtl_uString *pOid, // weak + typelib_TypeDescription const * pMemberType, // weak typelib_InterfaceTypeDescription *pInterfaceType, // weak void *pReturn, void *ppArgs[], - uno_Any **ppException ); + uno_Any **ppException ); // ~ClientJob // no release for method type and attribute type necessary, because // it was acquired by the caller of urp_sendRequest. The lifetime - // of the ClientJob object is always shorter than the urp_sendRequest call. + // of the ClientJob object is always shorter than the urp_sendRequest call. inline ~ClientJob() { if( m_bReleaseForTypeDescriptionNecessary ) @@ -134,7 +134,7 @@ private: void *m_pReturn; typelib_InterfaceTypeDescription *m_pInterfaceType; sal_Bool m_bReleaseForTypeDescriptionNecessary; - + uno_Any **m_ppException; sal_Bool m_bOneway; sal_Bool m_bBridgePropertyCall; @@ -158,7 +158,7 @@ struct MemberTypeInfo typelib_TypeDescription **m_ppArgType; }; - + struct ServerJobEntry { rtl_uString *m_pOid; @@ -201,7 +201,7 @@ public: m_aTypeInfo[m_nCalls].m_bIsReleaseCall = bIsReleaseCall; m_aTypeInfo[m_nCalls].m_bIsOneway = bIsOneway; } - + inline void setAttributeType( typelib_InterfaceAttributeTypeDescription *pAttributeType, sal_Bool bIsSetter, sal_Bool bIsOneway ) { @@ -221,13 +221,13 @@ public: pTypeRef ); } // setOid or setInterface MUST be called before extract - inline void setOid( rtl_uString *pOid ) + inline void setOid( rtl_uString *pOid ) { m_aEntries[m_nCalls].m_pOid = pOid; rtl_uString_acquire( m_aEntries[m_nCalls].m_pOid ); m_aEntries[m_nCalls].m_pRemoteI = 0; } - + // setOid or setInterface MUST be called inline void setInterface( remote_Interface *pRemoteI ) { @@ -258,7 +258,7 @@ public: m_lstMem.push_back( m_pCurrentMem ); m_nCurrentMemSize = mymax( nSizeToAlloc , MULTIJOB_STANDARD_MEMORY_SIZE ) + (m_nMaxMessages -m_nCalls)*MULTIJOB_PER_CALL_MEMORY_SIZE; - m_pCurrentMem = (sal_Int8*) rtl_allocateMemory( m_nCurrentMemSize ); + m_pCurrentMem = (sal_Int8*) rtl_allocateMemory( m_nCurrentMemSize ); m_nCurrentMemPosition = 0; } sal_Int8 *pHeap = m_pCurrentMem + m_nCurrentMemPosition; @@ -277,7 +277,7 @@ private: uno_Environment *m_pEnvRemote; sal_Int32 m_nCalls; sal_Int32 m_nMaxMessages; - + ServerJobEntry *m_aEntries; MemberTypeInfo *m_aTypeInfo; @@ -306,7 +306,7 @@ inline ClientJob::ClientJob( pEnvRemote, pContext, pBridgeImpl, ::bridges_remote::RTC_HOLDENVWEAK ) , m_ppArgs( ppArgs ) , m_pReturn( pReturn ) - , m_pInterfaceType( pInterfaceType ) // weak + , m_pInterfaceType( pInterfaceType ) // weak , m_bReleaseForTypeDescriptionNecessary( sal_False ) , m_ppException( ppException ) , m_bBridgePropertyCall( sal_False ) @@ -341,7 +341,7 @@ inline ClientJob::ClientJob( } m_nMethodIndex = (sal_uInt16) m_pInterfaceType->pMapMemberIndexToFunctionIndex[ ((typelib_InterfaceMemberTypeDescription*)pMemberType)->nPosition ]; - + if( m_pAttributeType && m_ppArgs ) { // setter @@ -350,12 +350,12 @@ inline ClientJob::ClientJob( if( typelib_TypeClass_INTERFACE_METHOD == pMemberType->eTypeClass ) { -// if( (( typelib_InterfaceMemberTypeDescription * ) pMemberType)->nPosition -// == REMOTE_RELEASE_METHOD_INDEX ) -// { -// m_bOneway = sal_True; -// } -// else +// if( (( typelib_InterfaceMemberTypeDescription * ) pMemberType)->nPosition +// == REMOTE_RELEASE_METHOD_INDEX ) +// { +// m_bOneway = sal_True; +// } +// else if( pBridgeImpl->m_properties.bForceSynchronous ) { m_bOneway = sal_False; diff --git a/bridges/source/remote/urp/urp_log.cxx b/bridges/source/remote/urp/urp_log.cxx index cdaa1727e6b9..48c8543a8ebd 100644 --- a/bridges/source/remote/urp/urp_log.cxx +++ b/bridges/source/remote/urp/urp_log.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -71,7 +71,7 @@ namespace bridges_urp MutexGuard guard; FILE *f; }; - + void urp_logCall( urp_BridgeImpl *pBridgeImpl, sal_Int32 nSize, sal_Int32 nUseData, sal_Bool bSynchron , const ::rtl::OUString &sMethodName ) { diff --git a/bridges/source/remote/urp/urp_log.hxx b/bridges/source/remote/urp/urp_log.hxx index 8eb3751932a6..cc352e85f848 100644 --- a/bridges/source/remote/urp/urp_log.hxx +++ b/bridges/source/remote/urp/urp_log.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -30,7 +30,7 @@ namespace bridges_urp #ifdef DBG_UTIL #define BRIDGES_URP_PROT #endif - + #ifdef BRIDGES_URP_PROT void urp_logCall( urp_BridgeImpl *pBridgeImpl , sal_Int32 nSize, sal_Int32 nUseData, sal_Bool bSynchron , diff --git a/bridges/source/remote/urp/urp_marshal.cxx b/bridges/source/remote/urp/urp_marshal.cxx index ae23cfb87eb5..29f8b35cec0f 100644 --- a/bridges/source/remote/urp/urp_marshal.cxx +++ b/bridges/source/remote/urp/urp_marshal.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -43,9 +43,9 @@ using namespace ::com::sun::star::uno; namespace bridges_urp { -static int g_nDetectLittleEndian = 1; +static int g_nDetectLittleEndian = 1; char g_bMarshalSystemIsLittleEndian = ((char*)&g_nDetectLittleEndian)[0]; - + Marshal::Marshal( urp_BridgeImpl *pBridgeImpl, sal_Int32 nBufferSize, urp_extractOidCallback callback) : @@ -96,7 +96,7 @@ void Marshal::packTid( const ByteSequence & threadId, sal_Bool bIgnoreCache ) { nIndex = m_pBridgeImpl->m_tidCacheOut.seek( threadId ); } - + if( 0xffff == nIndex ) { if( ! bIgnoreCache ) @@ -117,11 +117,11 @@ void Marshal::packType( void *pSource ) { typelib_TypeDescriptionReference *pRef = *(typelib_TypeDescriptionReference ** ) pSource; - + OSL_ASSERT( pRef ); - + sal_uInt8 nTypeClass = ( sal_uInt8 ) pRef->eTypeClass; - + if( nTypeClass <= /* any*/ 14 ) { packInt8( (sal_Int8*)&nTypeClass ); @@ -130,7 +130,7 @@ void Marshal::packType( void *pSource ) { OUString sTypeName; sal_uInt16 nIndex = 0xffff; - + nIndex = m_pBridgeImpl->m_typeCacheOut.seek( *(Type*)&pRef ); if( 0xffff == nIndex ) { @@ -155,7 +155,7 @@ sal_Bool Marshal::packRecursive( void *pSource , typelib_TypeDescription *pType { case typelib_TypeClass_EXCEPTION: case typelib_TypeClass_STRUCT: - { + { typelib_CompoundTypeDescription * pCompType = (typelib_CompoundTypeDescription*)pType; if (pCompType->pBaseTypeDescription) @@ -167,7 +167,7 @@ sal_Bool Marshal::packRecursive( void *pSource , typelib_TypeDescription *pType typelib_TypeDescriptionReference ** ppTypeRefs = pCompType->ppTypeRefs; sal_Int32 * pMemberOffsets = pCompType->pMemberOffsets; sal_Int32 nDescr = pCompType->nMembers; - + for ( sal_Int32 nPos = 0; nPos < nDescr; ++nPos ) { typelib_TypeDescription * pMemberType = 0; @@ -192,10 +192,10 @@ sal_Bool Marshal::packRecursive( void *pSource , typelib_TypeDescription *pType { typelib_IndirectTypeDescription *pIndirectType = ( typelib_IndirectTypeDescription* ) pType; - - const sal_Int32 nElements = (*(uno_Sequence **)pSource)->nElements; - char * pSourceElements = (char *)(*(uno_Sequence **)pSource)->elements; - + + const sal_Int32 nElements = (*(uno_Sequence **)pSource)->nElements; + char * pSourceElements = (char *)(*(uno_Sequence **)pSource)->elements; + if( typelib_TypeClass_BYTE == pIndirectType->pType->eTypeClass ) { // Byte sequences are optimized @@ -207,8 +207,8 @@ sal_Bool Marshal::packRecursive( void *pSource , typelib_TypeDescription *pType TYPELIB_DANGER_GET( &pElementType, pIndirectType->pType ); if( pElementType ) { - const sal_Int32 nElementSize = pElementType->nSize; - + const sal_Int32 nElementSize = pElementType->nSize; + packCompressedSize( nElements ); for ( sal_Int32 i = 0 ; i < nElements; i++ ) { diff --git a/bridges/source/remote/urp/urp_marshal.hxx b/bridges/source/remote/urp/urp_marshal.hxx index f66528d74703..c4ed70e9bbbd 100644 --- a/bridges/source/remote/urp/urp_marshal.hxx +++ b/bridges/source/remote/urp/urp_marshal.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -42,7 +42,7 @@ namespace bridges_urp // methods for accessing marshaling buffer inline void Marshal::finish( sal_Int32 nMessageCount ) { - sal_Int32 nSize = getSize() - 2*sizeof( sal_Int32 ); + sal_Int32 nSize = getSize() - 2*sizeof( sal_Int32 ); // save the state sal_Int8 *pos = m_pos; @@ -53,7 +53,7 @@ namespace bridges_urp // reset the state m_pos = pos; } - + inline void Marshal::restart() { m_pos = m_base + 2*sizeof( sal_Int32 ); @@ -63,7 +63,7 @@ namespace bridges_urp { return m_base; } - + inline sal_Bool Marshal::empty() const { return ( m_pos - m_base ) == 2*sizeof( sal_Int32 ); @@ -73,7 +73,7 @@ namespace bridges_urp { return ((sal_Int32) (m_pos - m_base)); } - + inline void Marshal::ensureAdditionalMem( sal_Int32 nMemToAdd ) { sal_Int32 nDiff = m_pos - m_base; @@ -82,7 +82,7 @@ namespace bridges_urp m_nBufferSize = m_nBufferSize * 2 > nDiff + nMemToAdd ? m_nBufferSize* 2 : nDiff + nMemToAdd; - + m_base = ( sal_Int8 * ) rtl_reallocateMemory( m_base , m_nBufferSize ); m_pos = m_base + nDiff; } @@ -115,12 +115,12 @@ namespace bridges_urp inline void Marshal::packByteSequence( sal_Int8 *pData , sal_Int32 nLength ) { packCompressedSize( nLength ); - + ensureAdditionalMem( nLength ); memcpy( m_pos , pData , nLength ); m_pos += nLength; } - + inline void Marshal::packString( void *pSource ) { rtl_uString *p = *( rtl_uString ** ) pSource; @@ -130,9 +130,9 @@ namespace bridges_urp ::rtl::OString o = ::rtl::OUStringToOString( p , RTL_TEXTENCODING_UTF8 ); sal_Int32 nLength = o.pData->length; packCompressedSize( nLength ); - + ensureAdditionalMem( nLength ); - + memcpy( m_pos , o.pData->buffer , nLength ); m_pos += nLength; } @@ -262,7 +262,7 @@ namespace bridges_urp m_pos += 8; break; } - + case typelib_TypeClass_STRING: { packString( pSource ); @@ -293,7 +293,7 @@ namespace bridges_urp if( pRemoteI ) { m_callback( pRemoteI , &(sOid.pData) ); - + nIndex = m_pBridgeImpl->m_oidCacheOut.seek( sOid ); if( 0xffff == nIndex ) { diff --git a/bridges/source/remote/urp/urp_marshal_decl.hxx b/bridges/source/remote/urp/urp_marshal_decl.hxx index a07f6ea48f5a..411730bacf2f 100644 --- a/bridges/source/remote/urp/urp_marshal_decl.hxx +++ b/bridges/source/remote/urp/urp_marshal_decl.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -37,7 +37,7 @@ namespace bridges_urp { struct urp_BridgeImpl; - + typedef void ( SAL_CALL * urp_extractOidCallback )( remote_Interface *pRemoteI, rtl_uString **ppOid ); @@ -50,11 +50,11 @@ namespace bridges_urp urp_extractOidCallback callback = 0 ); ~Marshal( ); - + inline sal_Bool pack( void *pSource , typelib_TypeDescription *pType ); sal_Bool packRecursive( void *pSource, typelib_TypeDescription *pType ); - + void packTid( const ::rtl::ByteSequence &id, sal_Bool bIgnoreCache = sal_False ); void packOid( const ::rtl::OUString &oid ); void packType( void *pSource ); @@ -80,25 +80,25 @@ namespace bridges_urp // a new marshalling session is started invalidating // the previous bufer inline void restart(); - + // is only valid, after finish has been called. // valid until destructed. inline sal_Int8 *getBuffer(); - + // is only valid, after finish has been called. // valid until destructed. inline sal_Int32 getSize(); - + inline sal_Int32 getPos() { return m_pos - m_base; } - + inline sal_Bool isSystemLittleEndian() { return g_bMarshalSystemIsLittleEndian; } - + private: inline void ensureAdditionalMem( sal_Int32 nMemToAdd ); sal_Int32 m_nBufferSize; - sal_Int8 *m_base; + sal_Int8 *m_base; sal_Int8 *m_pos; struct urp_BridgeImpl *m_pBridgeImpl; urp_extractOidCallback m_callback; diff --git a/bridges/source/remote/urp/urp_property.hxx b/bridges/source/remote/urp/urp_property.hxx index 0cd5525e63ad..530cea697e56 100644 --- a/bridges/source/remote/urp/urp_property.hxx +++ b/bridges/source/remote/urp/urp_property.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/urp/urp_propertyobject.cxx b/bridges/source/remote/urp/urp_propertyobject.cxx index 323faee2e929..95c290ef08f0 100644 --- a/bridges/source/remote/urp/urp_propertyobject.cxx +++ b/bridges/source/remote/urp/urp_propertyobject.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ static void SAL_CALL staticAcquire( remote_Interface *pRemoteI ) PropertyObject *pProperties = (PropertyObject *) pRemoteI; pProperties->thisAcquire(); } - + static void SAL_CALL staticRelease( remote_Interface *pRemoteI ) { PropertyObject *pProperties = (PropertyObject *) pRemoteI; @@ -76,7 +76,7 @@ static void SAL_CALL staticDispatch( namespace bridges_urp { -// some nice constants .... +// some nice constants .... static const sal_Int32 METHOD_QUERY_INTERFACE = 0; static const sal_Int32 METHOD_GET_PROPERTIES = 3; static const sal_Int32 METHOD_REQUEST_CHANGE = 4; @@ -118,9 +118,9 @@ const sal_Char *g_aPropertyName[] = "ForceSynchronous", "CurrentContext" }; - + // nice little helper functions for conversion -template< class t > +template< class t > void assignToIdl( ProtocolProperty *pIdl, sal_Int32 nIndex, const t &value ) { pIdl->Name = OUString::createFromAscii( g_aPropertyName[nIndex] ); @@ -173,7 +173,7 @@ static sal_Bool assignFromIdlToStruct( Properties *pProps, const ProtocolPropert case PROPERTY_SUPPORTSMULTIPLESYNCHRONOUS: assignFromIdl( &(pProps->bSupportsMultipleSynchronous) , idl ); break; - case PROPERTY_SUPPERTSSYNCHRONOUS: + case PROPERTY_SUPPERTSSYNCHRONOUS: assignFromIdl( &(pProps->bSupportsMustReply) , idl ); break; case PROPERTY_SUPPORTSMUSTREPLY: @@ -249,7 +249,7 @@ static void assignFromStringToPropSeq( const OUString &sProps, uno_Sequence **pp { ::std::list< OUString > lst; extractTokens( sProps , lst ); - + typelib_TypeDescription *pSequenceType = 0; getCppuType( (Sequence< ProtocolProperty > *)0).getDescription( &pSequenceType ); uno_Sequence *pSeq = 0; @@ -302,7 +302,7 @@ static void assignFromStringToPropSeq( const OUString &sProps, uno_Sequence **pp break; } - // strings + // strings case PROPERTY_VERSION: assignToIdl( &(pElements[i]) , nIndex , sValue ); break; @@ -362,7 +362,7 @@ void SAL_CALL PropertyObject::thisDispatch( uno_Any ** ppException ) { OSL_ASSERT( pMemberType->eTypeClass == typelib_TypeClass_INTERFACE_METHOD ); - + typelib_InterfaceMethodTypeDescription *pMethodType = ( typelib_InterfaceMethodTypeDescription * ) pMemberType; @@ -403,12 +403,12 @@ void SAL_CALL PropertyObject::localGetPropertiesFromRemote( struct Properties *p { typelib_typedescription_complete( &pInterfaceType ); } - + typelib_TypeDescription *pMethodType = 0; typelib_typedescriptionreference_getDescription( &pMethodType, ((typelib_InterfaceTypeDescription*) pInterfaceType)->ppAllMembers[METHOD_GET_PROPERTIES] ); - + uno_Sequence *pResult = 0; uno_Any exception; @@ -442,7 +442,7 @@ void SAL_CALL PropertyObject::localGetPropertiesFromRemote( struct Properties *p } -// implementation for call from remote +// implementation for call from remote void SAL_CALL PropertyObject::implGetProperties( uno_Sequence **ppReturnValue ) { typelib_TypeDescription *pElementType= 0; @@ -467,7 +467,7 @@ void SAL_CALL PropertyObject::implGetProperties( uno_Sequence **ppReturnValue ) assignToIdl( &(pElements[PROPERTY_SUPPERTSSYNCHRONOUS]), PROPERTY_SUPPERTSSYNCHRONOUS, pP->bSupportsSynchronous ); assignToIdl( &(pElements[PROPERTY_SUPPORTSMULTIPLESYNCHRONOUS]), PROPERTY_SUPPORTSMULTIPLESYNCHRONOUS, pP->bSupportsMultipleSynchronous ); assignToIdl( &(pElements[PROPERTY_CLEARCACHE]), PROPERTY_CLEARCACHE, pP->bClearCache ); - + typelib_typedescription_release( pElementType ); } @@ -497,20 +497,20 @@ sal_Int32 SAL_CALL PropertyObject::localRequestChange( ) rtl_random_destroyPool( pool ); } } - + if( bCall ) { OUString oid = OUString::createFromAscii( g_NameOfUrpProtocolPropertiesObject ); - // gather types for calling + // gather types for calling typelib_TypeDescription *pInterfaceType = 0; getCppuType( (Reference< XProtocolProperties > *) 0 ).getDescription( &pInterfaceType ); - + if( !pInterfaceType->bComplete ) { typelib_typedescription_complete( &pInterfaceType ); } - + typelib_TypeDescription *pMethodType = 0; typelib_typedescriptionreference_getDescription( &pMethodType, @@ -518,10 +518,10 @@ sal_Int32 SAL_CALL PropertyObject::localRequestChange( ) void *pArg1 = &m_nRandomNumberOfRequest; void **ppArgs = &pArg1; - + uno_Any exception; uno_Any *pException = &exception; - + ClientJob job( m_pEnvRemote, 0, m_pBridgeImpl, @@ -546,7 +546,7 @@ sal_Int32 SAL_CALL PropertyObject::localRequestChange( ) if( bSuccess ) { job.wait(); - + if( pException ) { // the object is unknown on the other side. @@ -570,7 +570,7 @@ sal_Int32 SAL_CALL PropertyObject::localRequestChange( ) return nResult; } -// implementation for call from remote +// implementation for call from remote sal_Int32 SAL_CALL PropertyObject::implRequestChange( sal_Int32 nRandomNumber, uno_Any **ppException ) { sal_Int32 nResult = 0; @@ -616,13 +616,13 @@ void SAL_CALL PropertyObject::localCommitChange( const ::rtl::OUString &sProps , // The remote counterpart cannot if the call following the commit already uses // the new properties or not. MutexGuard guard( m_pBridgeImpl->m_marshalingMutex ); - + OUString oid = OUString::createFromAscii( g_NameOfUrpProtocolPropertiesObject ); osl_resetCondition( m_commitChangeCondition ); Properties props = *m_pLocalSetting; - + typelib_TypeDescription *pInterfaceType = 0; getCppuType( (Reference< XProtocolProperties > *) 0 ).getDescription( &pInterfaceType ); @@ -630,75 +630,75 @@ void SAL_CALL PropertyObject::localCommitChange( const ::rtl::OUString &sProps , { typelib_typedescription_complete( &pInterfaceType ); } - + typelib_TypeDescription *pMethodType = 0; typelib_typedescriptionreference_getDescription( &pMethodType, ((typelib_InterfaceTypeDescription*) pInterfaceType)->ppAllMembers[METHOD_COMMIT_CHANGE] ); + +// typelib_TypeDescription *pSequenceType= 0; -// typelib_TypeDescription *pSequenceType= 0; - - + // extract name/value pairs uno_Sequence *pSeq = 0; assignFromStringToPropSeq( sProps, &pSeq ); assignFromPropSeqToStruct( pSeq , &props ); -// ::std::list< OUString > lst; -// extractTokens( sProps , lst ); - -// getCppuType( (Sequence< ProtocolProperty > *)0).getDescription( &pSequenceType ); -// uno_sequence_construct( &pSeq , pSequenceType , 0, lst.size() , 0 ); -// ProtocolProperty *pElements = (ProtocolProperty * ) pSeq->elements; - -// sal_Int32 i = 0; -// for( ::std::list< OUString >::iterator ii = lst.begin() ; ii != lst.end() ; ++ ii, i++ ) -// { -// sal_Int32 nAssign = (*ii).indexOf( '=' ); -// if( -1 == nAssign ) -// { -// OString o = OUStringToOString( *ii, RTL_TEXTENCODING_ASCII_US ); -// OSL_ENSURE( !"wrong protocol propertyt format, ignored", o.getStr() ); -// } -// OUString sPropName = (*ii).copy( 0, nAssign ); -// OUString sValue = (*ii).copy( nAssign +1, (*ii).getLength() - nAssign -1 ); - -// sal_Int32 nIndex = getIndexFromString( sPropName ); -// if( -1 == nIndex ) -// { -// OString o = OUStringToOString( sPropName , RTL_TEXTENCODING_ASCII_US); -// OSL_ENSURE( !"unknown protocol property, ignored", o.getStr() ); -// } -// switch( nIndex ) -// { -// // bools -// case PROPERTY_CLEARCACHE: -// { -// sal_Bool bClearCache = (sal_Bool ) sValue.toInt32(); -// assignToIdl( &(pElements[i]) , nIndex , bClearCache ); -// break; -// } -// // ints -// case PROPERTY_TYPECACHESIZE: -// case PROPERTY_OIDCACHESIZE: -// case PROPERTY_TIDCACHESIZE: -// case PROPERTY_FLUSHBLOCKSIZE: -// case PROPERTY_ONEWAYTIMEOUT_MUSEC: -// { -// sal_Int32 nValue = sValue.toInt32(); -// assignToIdl( &(pElements[i]) , nIndex , nValue ); -// break; -// } - -// // strings -// case PROPERTY_VERSION: -// assignToIdl( &(pElements[i]) , nIndex , sValue ); -// break; -// default: -// OString o = OUStringToOString( sPropName, RTL_TEXTENCODING_ASCII_US ); -// OSL_ENSURE( !"readonly protocol property, ignored" , o.getStr() ); -// } -// assignFromIdlToStruct( &props, pElements[i] ); -// } +// ::std::list< OUString > lst; +// extractTokens( sProps , lst ); + +// getCppuType( (Sequence< ProtocolProperty > *)0).getDescription( &pSequenceType ); +// uno_sequence_construct( &pSeq , pSequenceType , 0, lst.size() , 0 ); +// ProtocolProperty *pElements = (ProtocolProperty * ) pSeq->elements; + +// sal_Int32 i = 0; +// for( ::std::list< OUString >::iterator ii = lst.begin() ; ii != lst.end() ; ++ ii, i++ ) +// { +// sal_Int32 nAssign = (*ii).indexOf( '=' ); +// if( -1 == nAssign ) +// { +// OString o = OUStringToOString( *ii, RTL_TEXTENCODING_ASCII_US ); +// OSL_ENSURE( !"wrong protocol propertyt format, ignored", o.getStr() ); +// } +// OUString sPropName = (*ii).copy( 0, nAssign ); +// OUString sValue = (*ii).copy( nAssign +1, (*ii).getLength() - nAssign -1 ); + +// sal_Int32 nIndex = getIndexFromString( sPropName ); +// if( -1 == nIndex ) +// { +// OString o = OUStringToOString( sPropName , RTL_TEXTENCODING_ASCII_US); +// OSL_ENSURE( !"unknown protocol property, ignored", o.getStr() ); +// } +// switch( nIndex ) +// { +// // bools +// case PROPERTY_CLEARCACHE: +// { +// sal_Bool bClearCache = (sal_Bool ) sValue.toInt32(); +// assignToIdl( &(pElements[i]) , nIndex , bClearCache ); +// break; +// } +// // ints +// case PROPERTY_TYPECACHESIZE: +// case PROPERTY_OIDCACHESIZE: +// case PROPERTY_TIDCACHESIZE: +// case PROPERTY_FLUSHBLOCKSIZE: +// case PROPERTY_ONEWAYTIMEOUT_MUSEC: +// { +// sal_Int32 nValue = sValue.toInt32(); +// assignToIdl( &(pElements[i]) , nIndex , nValue ); +// break; +// } + +// // strings +// case PROPERTY_VERSION: +// assignToIdl( &(pElements[i]) , nIndex , sValue ); +// break; +// default: +// OString o = OUStringToOString( sPropName, RTL_TEXTENCODING_ASCII_US ); +// OSL_ENSURE( !"readonly protocol property, ignored" , o.getStr() ); +// } +// assignFromIdlToStruct( &props, pElements[i] ); +// } void *pArg1 = &pSeq; uno_Any exception; @@ -722,7 +722,7 @@ void SAL_CALL PropertyObject::localCommitChange( const ::rtl::OUString &sProps , { OSL_ASSERT( pException != NULL ); } - + ::uno_type_destructData( &pSeq, getCppuType( (Sequence< ProtocolProperty > *)0).getTypeLibType(), 0 ); @@ -748,7 +748,7 @@ void SAL_CALL PropertyObject::localCommitChange( const ::rtl::OUString &sProps , typelib_typedescription_release( pMethodType ); typelib_typedescription_release( pInterfaceType ); } - + void SAL_CALL PropertyObject::implCommitChange( uno_Sequence *pSequence, uno_Any **ppException ) { MutexGuard guard( m_mutex ); diff --git a/bridges/source/remote/urp/urp_propertyobject.hxx b/bridges/source/remote/urp/urp_propertyobject.hxx index d6cfbc84ff95..49628f522e3d 100644 --- a/bridges/source/remote/urp/urp_propertyobject.hxx +++ b/bridges/source/remote/urp/urp_propertyobject.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ namespace bridges_urp { struct urp_BridgeImpl; const sal_Char g_NameOfUrpProtocolPropertiesObject[] = "UrpProtocolProperties"; -// helper functions +// helper functions void assignFromStringToStruct( const ::rtl::OUString & sProps , struct Properties *pProps ); class PropertyObject : public remote_Interface @@ -49,17 +49,17 @@ class PropertyObject : public remote_Interface private: ::osl::Mutex m_mutex; oslCondition m_commitChangeCondition; - oslInterlockedCount m_nRefCount; + oslInterlockedCount m_nRefCount; urp_BridgeImpl *m_pBridgeImpl; struct Properties *m_pLocalSetting; struct Properties m_propsToBeApplied; - + uno_Environment *m_pEnvRemote; sal_Int32 m_nRandomNumberOfRequest; sal_Bool m_bRequestChangeHasBeenCalled; sal_Bool m_bServerWaitingForCommit; sal_Bool m_bApplyProperties; - + public: PropertyObject( struct Properties *pLocalSetting , uno_Environment *pEnvRemote, urp_BridgeImpl *pImpl ); @@ -83,7 +83,7 @@ public: void * pArgs[], uno_Any ** ppException ); -public: // local +public: // local sal_Int32 SAL_CALL localRequestChange( ); void SAL_CALL localCommitChange( const ::rtl::OUString &properties, sal_Bool *pbExceptionThrown ); void SAL_CALL localGetPropertiesFromRemote( struct Properties * ); @@ -92,9 +92,9 @@ public: // local inline sal_Bool SAL_CALL changesHaveBeenCommited() { return m_bApplyProperties; } Properties SAL_CALL getCommitedChanges(); - + void SAL_CALL waitUntilChangesAreCommitted(); - + protected: // these methods are called by thisDispatch void SAL_CALL implGetProperties( uno_Sequence **ppReturnValue ); diff --git a/bridges/source/remote/urp/urp_reader.cxx b/bridges/source/remote/urp/urp_reader.cxx index 00941c468e1b..1dfaf30d4d1f 100644 --- a/bridges/source/remote/urp/urp_reader.cxx +++ b/bridges/source/remote/urp/urp_reader.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -66,7 +66,7 @@ namespace bridges_urp ***/ void SAL_CALL urp_releaseRemoteCallback ( remote_Interface *, rtl_uString *pOid, - typelib_TypeDescriptionReference *pTypeRef, uno_Environment *pEnvRemote ) + typelib_TypeDescriptionReference *pTypeRef, uno_Environment *pEnvRemote ) { remote_Context *pContext = (remote_Context *) pEnvRemote->pContext; urp_BridgeImpl *pImpl = (urp_BridgeImpl*) ( pContext->m_pBridgeImpl ); @@ -758,7 +758,7 @@ void OReaderThread::run() pLastRemoteI = 0; } ClientJob *pClientJob = - m_pBridgeImpl->m_clientJobContainer.remove( *( ByteSequence * )ppLastTid ); + m_pBridgeImpl->m_clientJobContainer.remove( *( ByteSequence * )ppLastTid ); // Bridge MUST be already disposed, otherwise we got a wrong threadid // from remote ! diff --git a/bridges/source/remote/urp/urp_reader.hxx b/bridges/source/remote/urp/urp_reader.hxx index aa4042ce197b..409cce526caf 100644 --- a/bridges/source/remote/urp/urp_reader.hxx +++ b/bridges/source/remote/urp/urp_reader.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -34,7 +34,7 @@ typedef struct _uno_Environment uno_Environment; namespace bridges_urp { - + class OWriterThread; struct MessageFlags; @@ -46,9 +46,9 @@ public: uno_Environment *pEnvRemote, OWriterThread *pWriterThread ); ~OReaderThread(); - + // may only be called in the callstack of this thread !!!!! - // run() -> disposeEnvironment() -> dispose() -> destroyYourself() + // run() -> disposeEnvironment() -> dispose() -> destroyYourself() void destroyYourself(); private: @@ -66,7 +66,7 @@ private: sal_Bool *pbIsSetter, sal_uInt16 nMethodId , typelib_TypeDescriptionReference *pITypeRef); - + remote_Connection *m_pConnection; uno_Environment *m_pEnvRemote; OWriterThread *m_pWriterThread; diff --git a/bridges/source/remote/urp/urp_replycontainer.hxx b/bridges/source/remote/urp/urp_replycontainer.hxx index c8b05ea47435..ff04a15a8f94 100644 --- a/bridges/source/remote/urp/urp_replycontainer.hxx +++ b/bridges/source/remote/urp/urp_replycontainer.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/urp/urp_threadid.cxx b/bridges/source/remote/urp/urp_threadid.cxx index e603a73bab83..4554057d22a8 100644 --- a/bridges/source/remote/urp/urp_threadid.cxx +++ b/bridges/source/remote/urp/urp_threadid.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/urp/urp_threadid.hxx b/bridges/source/remote/urp/urp_threadid.hxx index e920e2c1e9c3..d26b1cdc0af9 100644 --- a/bridges/source/remote/urp/urp_threadid.hxx +++ b/bridges/source/remote/urp/urp_threadid.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,7 +45,7 @@ namespace bridges_urp struct HashThreadId { - sal_Int32 operator () ( const ::rtl::ByteSequence &a ) const + sal_Int32 operator () ( const ::rtl::ByteSequence &a ) const { if( a.getLength() >= 4 ) { diff --git a/bridges/source/remote/urp/urp_unmarshal.cxx b/bridges/source/remote/urp/urp_unmarshal.cxx index 5fd124017d4a..43802bc78d8a 100644 --- a/bridges/source/remote/urp/urp_unmarshal.cxx +++ b/bridges/source/remote/urp/urp_unmarshal.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/urp/urp_unmarshal.hxx b/bridges/source/remote/urp/urp_unmarshal.hxx index 04881d456cce..07b03b606641 100644 --- a/bridges/source/remote/urp/urp_unmarshal.hxx +++ b/bridges/source/remote/urp/urp_unmarshal.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,7 +50,7 @@ struct urp_BridgeImpl; void SAL_CALL urp_releaseRemoteCallback( remote_Interface *pRemoteI,rtl_uString *pOid, typelib_TypeDescriptionReference *pTypeRef, - uno_Environment *pEnvRemote ); + uno_Environment *pEnvRemote ); struct UnpackItem { diff --git a/bridges/source/remote/urp/urp_writer.cxx b/bridges/source/remote/urp/urp_writer.cxx index 58795d9f3359..38f85a7c4194 100644 --- a/bridges/source/remote/urp/urp_writer.cxx +++ b/bridges/source/remote/urp/urp_writer.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/bridges/source/remote/urp/urp_writer.hxx b/bridges/source/remote/urp/urp_writer.hxx index 041f0b4d753f..f491bc9aadbc 100644 --- a/bridges/source/remote/urp/urp_writer.hxx +++ b/bridges/source/remote/urp/urp_writer.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -45,7 +45,7 @@ namespace bridges_urp ::rtl::OUString sOid; ::com::sun::star::uno::Type typeInterface; }; - + struct urp_BridgeImpl; class OWriterThread : public ::osl::Thread @@ -55,18 +55,18 @@ namespace bridges_urp urp_BridgeImpl *m_pBridgeImpl, uno_Environment *pEnvRemote); ~OWriterThread( ); - + virtual void SAL_CALL run(); - + void touch( sal_Bool bImmediately ); void sendEmptyMessage(); - + void abortThread(); void SAL_CALL insertReleaseRemoteCall ( rtl_uString *pOid,typelib_TypeDescriptionReference *pTypeRef); void SAL_CALL executeReleaseRemoteCalls(); - + private: void write(); oslCondition m_oslCondition; |