diff options
Diffstat (limited to 'bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx')
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_alpha/cpp2uno.cxx | 50 |
1 files changed, 25 insertions, 25 deletions
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]); |