Index: source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx =================================================================== RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx,v retrieving revision 1.2.62.1 diff -u -u -r1.2.62.1 cpp2uno.cxx --- source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx 27 Dec 2003 09:50:06 -0000 1.2.62.1 +++ source/cpp_uno/gcc3_linux_sparc/cpp2uno.cxx 18 Jan 2004 03:56:56 -0000 @@ -63,46 +63,31 @@ // #define TRACE(x) OSL_TRACE(x) #define TRACE(x) -#include #include #include #include -#ifndef _RTL_ALLOC_H_ -#include -#endif -#ifndef _OSL_MUTEX_HXX_ -#include -#endif - +#include #ifndef _TYPELIB_TYPEDESCRIPTION_HXX_ #include #endif #ifndef _UNO_DATA_H_ #include #endif -#ifndef _BRIDGES_CPP_UNO_BRIDGE_HXX_ -#include -#endif -#ifndef _BRIDGES_CPP_UNO_TYPE_MISC_HXX_ -#include -#endif - +#include "bridges/cpp_uno/shared/bridge.hxx" +#include "bridges/cpp_uno/shared/cppinterfaceproxy.hxx" +#include "bridges/cpp_uno/shared/types.hxx" +#include "bridges/cpp_uno/shared/vtablefactory.hxx" #include "share.hxx" using namespace com::sun::star::uno; using namespace std; -using namespace osl; -using namespace rtl; namespace CPPU_CURRENT_NAMESPACE { //================================================================================================== -rtl_StandardModuleCount g_moduleCount = MODULE_COUNT_INIT; - -//================================================================================================== static typelib_TypeClass cpp2uno_call( - cppu_cppInterfaceProxy * pThis, + bridges::cpp_uno::shared::CppInterfaceProxy * pThis, const typelib_TypeDescription * pMemberTypeDescr, typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void return sal_Int32 nParams, typelib_MethodParameter * pParams, @@ -122,16 +107,19 @@ if (pReturnTypeDescr) { - if (cppu_isSimpleType( pReturnTypeDescr )) + if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) + { pUnoReturn = pRegisterReturn; // direct way for simple types + } else // complex return via ptr (pCppReturn) { pCppReturn = *(void**)pCppStack; - - pUnoReturn = (cppu_relatesToInterface( pReturnTypeDescr ) + pCppStack += sizeof( void* ); + pUnoReturn = (bridges::cpp_uno::shared::relatesToInterfaceType( + pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pCppReturn); // direct way - pCppStack += sizeof( void* ); + } } // pop this @@ -155,7 +143,9 @@ typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - if (!rParam.bOut && cppu_isSimpleType( pParamTypeDescr )) // value + if (!rParam.bOut + && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) + // value { pCppArgs[nPos] = pUnoArgs[nPos] = adjustPointer( pCppStack, pParamTypeDescr ); @@ -182,11 +172,12 @@ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; } // is in/inout - else if (cppu_relatesToInterface( pParamTypeDescr )) + else if (bridges::cpp_uno::shared::relatesToInterfaceType( + pParamTypeDescr )) { uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), *(void **)pCppStack, pParamTypeDescr, - &pThis->pBridge->aCpp2Uno ); + pThis->getBridge()->getCpp2Uno() ); pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -206,8 +197,8 @@ uno_Any * pUnoExc = &aUnoExc; // invoke uno dispatch call - (*pThis->pUnoI->pDispatcher)( pThis->pUnoI, pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); - + (*pThis->getUnoI()->pDispatcher)( + pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); // in case an exception occured... if (pUnoExc) { @@ -222,9 +213,10 @@ } if (pReturnTypeDescr) TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); - - raiseException( &aUnoExc, &pThis->pBridge->aUno2Cpp ); // has to destruct the any - // is here for dummy + CPPU_CURRENT_NAMESPACE::raiseException( + &aUnoExc, pThis->getBridge()->getUno2Cpp() ); + // has to destruct the any + // is here for dummy return typelib_TypeClass_VOID; } else // else no exception occured... @@ -240,7 +232,7 @@ // convert and assign uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr, - &pThis->pBridge->aUno2Cpp ); + pThis->getBridge()->getUno2Cpp() ); } // destroy temp uno param uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); @@ -253,7 +245,7 @@ if (pUnoReturn != pCppReturn) // needs reconversion { uno_copyAndConvertData( pCppReturn, pUnoReturn, pReturnTypeDescr, - &pThis->pBridge->aUno2Cpp ); + pThis->getBridge()->getUno2Cpp() ); // destroy temp uno return uno_destructData( pUnoReturn, pReturnTypeDescr, 0 ); } @@ -274,7 +266,8 @@ //================================================================================================== static typelib_TypeClass cpp_mediate( - sal_Int32 nVtableCall, + sal_Int32 nFunctionIndex, + sal_Int32 nVtableOffset, void ** pCallStack, sal_Int64 * pRegisterReturn /* space for register return */ ) { @@ -283,27 +276,31 @@ // pCallStack: this, params // eventual [ret*] lies at pCallStack -1 // so count down pCallStack by one to keep it simple - // _this_ ptr is patched cppu_XInterfaceProxy object - cppu_cppInterfaceProxy * pCppI = NULL; - pCppI = (cppu_cppInterfaceProxy *)(XInterface *)*pCallStack; - if( nVtableCall & 0x80000000 ) + +void * pThis; + if( nFunctionIndex & 0x80000000 ) { - pCallStack--; - nVtableCall &= 0x7fffffff; + nFunctionIndex &= 0x7fffffff; + pThis = pCallStack[1]; //jw: from solaris/sparc, linux/intel has 2 } - - typelib_InterfaceTypeDescription * pTypeDescr = pCppI->pTypeDescr; - - OSL_ENSURE( nVtableCall < pTypeDescr->nMapFunctionIndexToMemberIndex, +else + { + pThis = pCallStack[0]; //jw: from solaris/sparc, linux/intel has 1 + } +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 (nVtableCall >= pTypeDescr->nMapFunctionIndexToMemberIndex) + if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) { throw RuntimeException( OUString::createFromAscii("illegal vtable index!"), (XInterface *)pCppI ); } - + // determine called method - OSL_ENSURE( nVtableCall < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); - sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nVtableCall]; + sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### illegal member index!" ); TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); @@ -318,7 +315,7 @@ { case typelib_TypeClass_INTERFACE_ATTRIBUTE: { - if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nVtableCall) + if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nFunctionIndex) { // is GET method eRet = cpp2uno_call( @@ -347,7 +344,7 @@ case typelib_TypeClass_INTERFACE_METHOD: { // is METHOD - switch (nVtableCall) + switch (nFunctionIndex) { case 1: // acquire() pCppI->acquireProxy(); // non virtual call! @@ -364,9 +361,10 @@ if (pTD) { XInterface * pInterface = 0; - (*pCppI->pBridge->pCppEnv->getRegisteredInterface)( - pCppI->pBridge->pCppEnv, - (void **)&pInterface, pCppI->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); + (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface)( + pCppI->getBridge()->getCppEnv(), + (void **)&pInterface, pCppI->getOid().pData, + (typelib_InterfaceTypeDescription *)pTD ); if (pInterface) { @@ -394,79 +392,23 @@ } default: { - throw RuntimeException( OUString::createFromAscii("no member description found!"), (XInterface *)pCppI ); + throw RuntimeException( + rtl::OUString::createFromAscii("no member description found!"), + (XInterface *)pThis ); // is here for dummy eRet = typelib_TypeClass_VOID; } } - - return eRet; -} - -//================================================================================================== -class MediateClassData -{ -public: - struct ClassDataBuffer - { - void* m_pVTable; - - ~ClassDataBuffer(); - }; -private: - - map< OUString, ClassDataBuffer* > m_aClassData; - Mutex m_aMutex; - - void createVTable( ClassDataBuffer*, typelib_InterfaceTypeDescription* ); -public: - const ClassDataBuffer* getClassData( typelib_InterfaceTypeDescription* ); - - MediateClassData() {} - ~MediateClassData(); -}; -//__________________________________________________________________________________________________ -MediateClassData::ClassDataBuffer::~ClassDataBuffer() -{ - delete m_pVTable; -} - -//__________________________________________________________________________________________________ -MediateClassData::~MediateClassData() -{ - TRACE( "> calling ~MediateClassData(): freeing mediate vtables... <\n" ); - - // this MUST be the absolute last one which is called! - for ( map< OUString, ClassDataBuffer* >::iterator iPos( m_aClassData.begin() ); iPos != m_aClassData.end(); ++iPos ) - { - // todo -// delete (*iPos).second; - } -} - -//__________________________________________________________________________________________________ - -const MediateClassData::ClassDataBuffer* MediateClassData::getClassData( typelib_InterfaceTypeDescription* pType ) -{ - MutexGuard aGuard( m_aMutex ); - map< OUString, ClassDataBuffer* >::iterator element = m_aClassData.find( pType->aBase.pTypeName ); - if( element != m_aClassData.end() ) - return (*element).second; - - ClassDataBuffer* pBuffer = new ClassDataBuffer(); - createVTable( pBuffer, pType ); - m_aClassData[ pType->aBase.pTypeName ] = pBuffer; - return pBuffer; + return eRet; } - //================================================================================================== /** * is called on incoming vtable calls * (called by asm snippets) */ -static void cpp_vtable_call() + static void cpp_vtable_call() { int nTableEntry; void** pCallStack; @@ -513,7 +455,6 @@ "ld %1, %%l0\n\t" "ld [%%l0], %%i1\n\t" : : "m"(&nRegReturn), "m"(((long*)&nRegReturn) +1) ); - break; case typelib_TypeClass_FLOAT: __asm__( "ld %0, %%l0\n\t" @@ -577,7 +518,7 @@ const int nSnippetSize = 64; char * pSpace = (char *)rtl_allocateMemory( (2*(nSize+2)*sizeof(void *)) + (nSize*nSnippetSize) ); pBuffer->m_pVTable = (void*)pSpace; - + char * pCode = pSpace + (2*(nSize+2)*sizeof(void *)); void ** pvft = (void **)pSpace; @@ -594,7 +535,7 @@ /* * generate this code - * + * * st %o0, [%sp+68] save registers * st %o1, [%sp+72] * st %o2, [%sp+76] @@ -629,7 +570,7 @@ *codeSnip++ = 0x15000000 | ( ((unsigned long)cpp_vtable_call) >> 10 ); *codeSnip++ = 0x9412a000 | ( ((unsigned long)cpp_vtable_call) & 1023 ); *codeSnip++ = 0x81c28000; - *codeSnip++ = 0x01000000; + *codeSnip++ = 0x01000000; } } Index: source/cpp_uno/gcc3_linux_sparc/except.cxx =================================================================== RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx,v retrieving revision 1.2 diff -u -u -r1.2 except.cxx --- source/cpp_uno/gcc3_linux_sparc/except.cxx 28 Apr 2003 16:28:48 -0000 1.2 +++ source/cpp_uno/gcc3_linux_sparc/except.cxx 18 Jan 2004 03:56:56 -0000 @@ -69,7 +69,7 @@ #include #include -#include +#include #include #include Index: source/cpp_uno/gcc3_linux_sparc/makefile.mk =================================================================== RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_sparc/makefile.mk,v retrieving revision 1.2 diff -u -u -r1.2 makefile.mk --- source/cpp_uno/gcc3_linux_sparc/makefile.mk 28 Apr 2003 16:28:55 -0000 1.2 +++ source/cpp_uno/gcc3_linux_sparc/makefile.mk 18 Jan 2004 03:56:56 -0000 @@ -98,11 +98,8 @@ SHL1IMPLIB= i$(TARGET) SHL1VERSIONMAP=..$/..$/bridge_exports.map -SHL1OBJS= \ - $(SLO)$/except.obj \ - $(SLO)$/cpp2uno.obj \ - $(SLO)$/uno2cpp.obj - +SHL1OBJS=$(SLOFILES) +SHL1LIBS =$(SLB)$/cpp_uno_shared.lib SHL1STDLIBS= \ $(CPPULIB) \ $(SALLIB) Index: source/cpp_uno/gcc3_linux_sparc/share.hxx =================================================================== RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_sparc/share.hxx,v retrieving revision 1.2 diff -u -u -r1.2 share.hxx --- source/cpp_uno/gcc3_linux_sparc/share.hxx 28 Apr 2003 16:29:01 -0000 1.2 +++ source/cpp_uno/gcc3_linux_sparc/share.hxx 18 Jan 2004 03:56:56 -0000 @@ -58,14 +58,14 @@ * * ************************************************************************/ - +#include "uno/mapping.h" #include #include #include namespace CPPU_CURRENT_NAMESPACE { - +void dummy_can_throw_anything( char const * ); // ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h struct _Unwind_Exception Index: source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx =================================================================== RCS file: /cvs/udk/bridges/source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx,v retrieving revision 1.3 diff -u -u -r1.3 uno2cpp.cxx --- source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx 18 Aug 2003 14:56:11 -0000 1.3 +++ source/cpp_uno/gcc3_linux_sparc/uno2cpp.cxx 18 Jan 2004 03:56:56 -0000 @@ -60,32 +60,25 @@ ************************************************************************/ #include -#ifndef _RTL_ALLOC_H_ -#include -#endif - +#include #ifndef _UNO_DATA_H_ #include #endif -#ifndef _BRIDGES_CPP_UNO_BRIDGE_HXX_ -#include -#endif -#ifndef _BRIDGES_CPP_UNO_TYPE_MISC_HXX_ -#include -#endif + +#include "bridges/cpp_uno/shared/bridge.hxx" +#include "bridges/cpp_uno/shared/types.hxx" +#include "bridges/cpp_uno/shared/unointerfaceproxy.hxx" +#include "bridges/cpp_uno/shared/vtables.hxx" #include "share.hxx" using namespace rtl; using namespace com::sun::star::uno; -namespace CPPU_CURRENT_NAMESPACE +namespace { - -void dummy_can_throw_anything( char const * ); - //================================================================================================== -static void callVirtualMethod( void * pThis, +static void callVirtualMethod( void * pAdjustedThisPtr, sal_Int32 nVtableIndex, void * pRegisterReturn, typelib_TypeClass eReturnType, @@ -95,13 +88,13 @@ // parameter list is mixed list of * and values // reference parameters are pointers - OSL_ENSURE( pStackLongs && pThis, "### null ptr!" ); + 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 (! pThis) dummy_can_throw_anything("xxx"); // address something + if (! pAdjustedThisPtr) CPPU_CURRENT_NAMESPACE::dummy_can_throw_anything("xxx"); // address something volatile long o0 = 0, o1 = 0; // for register returns volatile double f0d = 0; @@ -301,8 +294,8 @@ //================================================================================================== static void cpp_call( - cppu_unoInterfaceProxy * pThis, - sal_Int32 nVtableCall, + bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, + bridges::cpp_uno::shared::VtableSlot aVtableSlot, typelib_TypeDescriptionReference * pReturnTypeRef, sal_Int32 nParams, typelib_MethodParameter * pParams, void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) @@ -321,7 +314,7 @@ if (pReturnTypeDescr) { - if (cppu_isSimpleType( pReturnTypeDescr )) + if (bridges::cpp_uno::shared::isSimpleType( pReturnTypeDescr )) { pCppReturn = pUnoReturn; // direct way for simple types *(void**)pCppStack = NULL; @@ -329,14 +322,18 @@ else { // complex return via ptr - pCppReturn = *(void **)pCppStack = (cppu_relatesToInterface( pReturnTypeDescr ) + pCppReturn = *(void **)pCppStack + = (bridges::cpp_uno::shared::relatesToInterfaceType( + pReturnTypeDescr ) ? alloca( pReturnTypeDescr->nSize ) : pUnoReturn); // direct way } pCppStack += sizeof(void*); } // push this - *(void**)pCppStack = pThis->pCppI; + void * pAdjustedThisPtr = reinterpret_cast< void ** >(pThis->getCppI()) + + aVtableSlot.offset; + *(void**)pCppStack = pAdjustedThisPtr; pCppStack += sizeof( void* ); // stack space @@ -355,13 +352,13 @@ const typelib_MethodParameter & rParam = pParams[nPos]; typelib_TypeDescription * pParamTypeDescr = 0; TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); - - if (!rParam.bOut && cppu_isSimpleType( pParamTypeDescr )) + if (!rParam.bOut + && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) { pCppArgs[ nPos ] = adjustPointer( pCppStack, pParamTypeDescr ); uno_copyAndConvertData( pCppArgs[nPos], pUnoArgs[nPos], pParamTypeDescr, - &pThis->pBridge->aUno2Cpp ); - + pThis->getBridge()->getUno2Cpp() ); + switch (pParamTypeDescr->eTypeClass) { case typelib_TypeClass_HYPER: @@ -385,12 +382,14 @@ ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; } // is in/inout - else if (cppu_relatesToInterface( pParamTypeDescr )) + else if (bridges::cpp_uno::shared::relatesToInterfaceType( + pParamTypeDescr )) { uno_copyAndConvertData( *(void **)pCppStack = pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), - pUnoArgs[nPos], pParamTypeDescr, &pThis->pBridge->aUno2Cpp ); - + pUnoArgs[nPos], pParamTypeDescr, + pThis->getBridge()->getUno2Cpp() ); + pTempIndizes[nTempIndizes] = nPos; // has to be reconverted // will be released at reconversion ppTempParamTypeDescr[nTempIndizes++] = pParamTypeDescr; @@ -409,7 +408,7 @@ { OSL_ENSURE( !( (pCppStack - pCppStackStart ) & 3), "UNALIGNED STACK !!! (Please DO panic" ); callVirtualMethod( - pThis->pCppI, nVtableCall, + pAdjustedThisPtr, aVtableSlot.index, pCppReturn, pReturnTypeDescr->eTypeClass, (sal_Int32 *)pCppStackStart, (pCppStack - pCppStackStart) / sizeof(sal_Int32) ); // NO exception occured... @@ -427,13 +426,13 @@ { uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, - &pThis->pBridge->aCpp2Uno ); + pThis->getBridge()->getCpp2Uno() ); } } else // pure out { uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, - &pThis->pBridge->aCpp2Uno ); + pThis->getBridge()->getCpp2Uno() ); } // destroy temp cpp param => cpp: every param was constructed uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); @@ -444,16 +443,15 @@ if (pCppReturn && pUnoReturn != pCppReturn) { uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr, - &pThis->pBridge->aCpp2Uno ); + pThis->getBridge()->getCpp2Uno() ); uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release ); } } catch( ... ) { // get exception - fillUnoException( - __cxa_get_globals()->caughtExceptions, *ppUnoExc, &pThis->pBridge->aCpp2Uno ); - + fillUnoException( CPPU_CURRENT_NAMESPACE::__cxa_get_globals()->caughtExceptions, *ppUnoExc, pThis->getBridge()->getCpp2Uno() ); + // temporary params for ( ; nTempIndizes--; ) { @@ -470,9 +468,9 @@ //================================================================================================== -void SAL_CALL cppu_unoInterfaceProxy_dispatch( +void bridges::cpp_uno::shared::UnoInterfaceProxy::dispatch( uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr, - void * pReturn, void * pArgs[], uno_Any ** ppException ) throw () +void * pReturn, void * pArgs[], uno_Any ** ppException ) SAL_THROW(()) { #if defined BRIDGES_DEBUG OString cstr( OUStringToOString( pMemberDescr->pTypeName, RTL_TEXTENCODING_ASCII_US ) ); @@ -480,25 +478,24 @@ #endif // is my surrogate - cppu_unoInterfaceProxy * pThis = (cppu_unoInterfaceProxy *)pUnoI; + 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: { - // determine vtable call index - sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; - OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); - - sal_Int32 nVtableCall = pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos]; - OSL_ENSURE( nVtableCall < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); - + VtableSlot aVtableSlot( + getVtableSlot( + reinterpret_cast< + typelib_InterfaceAttributeTypeDescription const * >( + pMemberDescr))); if (pReturn) { // dependent dispatch cpp_call( - pThis, nVtableCall, + pThis, aVtableSlot, ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef, 0, 0, // no params pReturn, pArgs, ppException ); @@ -518,12 +515,13 @@ &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); // dependent dispatch + aVtableSlot.index += 1; // get, then set method cpp_call( - pThis, nVtableCall +1, // get, then set method + pThis, aVtableSlot, pReturnTypeRef, 1, &aParam, pReturn, pArgs, ppException ); - + typelib_typedescriptionreference_release( pReturnTypeRef ); } @@ -531,14 +529,12 @@ } case typelib_TypeClass_INTERFACE_METHOD: { - // determine vtable call index - sal_Int32 nMemberPos = ((typelib_InterfaceMemberTypeDescription *)pMemberDescr)->nPosition; - OSL_ENSURE( nMemberPos < pTypeDescr->nAllMembers, "### member pos out of range!" ); - - sal_Int32 nVtableCall = pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos]; - OSL_ENSURE( nVtableCall < pTypeDescr->nMapFunctionIndexToMemberIndex, "### illegal vtable index!" ); - - switch (nVtableCall) + VtableSlot aVtableSlot( + getVtableSlot( + reinterpret_cast< + typelib_InterfaceMethodTypeDescription const * >( + pMemberDescr))); + switch (aVtableSlot.index) { // standard calls case 1: // acquire uno interface @@ -556,9 +552,9 @@ if (pTD) { uno_Interface * pInterface = 0; - (*pThis->pBridge->pUnoEnv->getRegisteredInterface)( - pThis->pBridge->pUnoEnv, - (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); + (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)( + pThis->pBridge->getUnoEnv(), + (void **)&pInterface, pThis->oid.pData, (typelib_InterfaceTypeDescription *)pTD ); if (pInterface) { @@ -576,7 +572,7 @@ default: // dependent dispatch cpp_call( - pThis, nVtableCall, + pThis, aVtableSlot, ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef, ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams, ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams, @@ -596,6 +592,3 @@ } } } - -} - Index: source/jni_uno/makefile.mk =================================================================== RCS file: /cvs/udk/bridges/source/jni_uno/makefile.mk,v retrieving revision 1.4 diff -u -u -r1.4 makefile.mk --- source/jni_uno/makefile.mk 9 Oct 2003 10:19:54 -0000 1.4 +++ source/jni_uno/makefile.mk 18 Jan 2004 03:56:56 -0000 @@ -101,6 +101,11 @@ .ENDIF .ENDIF +.IF "$(OS)$(COM)$(CPUNAME)"=="LINUXGCCSPARC" +NOOPTFILES= \ + $(SLO)$/jni_data.obj +.ENDIF + # --- Targets ------------------------------------------------------ .INCLUDE : target.mk