diff options
Diffstat (limited to 'bridges/source/cpp_uno/msvc_win32_intel')
-rw-r--r-- | bridges/source/cpp_uno/msvc_win32_intel/cpp2uno.cxx | 58 | ||||
-rw-r--r-- | bridges/source/cpp_uno/msvc_win32_intel/dllinit.cxx | 4 | ||||
-rw-r--r-- | bridges/source/cpp_uno/msvc_win32_intel/except.cxx | 50 | ||||
-rw-r--r-- | bridges/source/cpp_uno/msvc_win32_intel/msci.hxx | 4 | ||||
-rw-r--r-- | bridges/source/cpp_uno/msvc_win32_intel/uno2cpp.cxx | 176 |
5 files changed, 146 insertions, 146 deletions
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 ); |