diff options
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_solaris_sparc')
4 files changed, 88 insertions, 88 deletions
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 ); |