diff options
-rw-r--r-- | bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx | 37 |
1 files changed, 21 insertions, 16 deletions
diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx index ab552fdf2465..0f73304c539b 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/cpp2uno.cxx @@ -4,9 +4,9 @@ * * $RCSfile: cpp2uno.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: ihi $ $Date: 2008-02-04 13:43:38 $ + * last change: $Author: obo $ $Date: 2008-02-27 09:55:28 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -660,32 +660,37 @@ void bridges::cpp_uno::shared::VtableFactory::flushCode(unsigned char const * bp __asm__ volatile ( "sync;" "isync;" : : : "memory"); } +struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; }; - -void ** bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) +bridges::cpp_uno::shared::VtableFactory::Slot * +bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) { - return static_cast< void ** >(block) + 2; + return static_cast< Slot * >(block) + 2; } sal_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize( sal_Int32 slotCount) { - return (slotCount + 2) * sizeof (void *) + slotCount * codeSnippetSize; + return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; } -void ** bridges::cpp_uno::shared::VtableFactory::initializeBlock(void * block) { - void ** slots = mapBlockToVtable(block); - slots[-2] = 0; - slots[-1] = 0; - return slots; +bridges::cpp_uno::shared::VtableFactory::Slot * +bridges::cpp_uno::shared::VtableFactory::initializeBlock( + void * block, sal_Int32 slotCount) +{ + Slot * slots = mapBlockToVtable(block); + slots[-2].fn = 0; + slots[-1].fn = 0; + return slots + slotCount; } unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( - void ** slots, unsigned char * code, + Slot ** slots, unsigned char * code, typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset, sal_Int32 functionCount, sal_Int32 vtableOffset) { - + (*slots) -= functionCount; + Slot * s = *slots; // fprintf(stderr, "in addLocalFunctions functionOffset is %x\n",functionOffset); // fprintf(stderr, "in addLocalFunctions vtableOffset is %x\n",vtableOffset); // fflush(stderr); @@ -697,7 +702,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( switch (member->eTypeClass) { case typelib_TypeClass_INTERFACE_ATTRIBUTE: // Getter: - *slots++ = code; + (s++)->fn = code; code = codeSnippet( code, functionOffset++, vtableOffset, bridges::cpp_uno::shared::isSimpleType( @@ -710,13 +715,13 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( typelib_InterfaceAttributeTypeDescription * >( member)->bReadOnly) { - *slots++ = code; + (s++)->fn = code; code = codeSnippet(code, functionOffset++, vtableOffset, true); } break; case typelib_TypeClass_INTERFACE_METHOD: - *slots++ = code; + (s++)->fn = code; code = codeSnippet( code, functionOffset++, vtableOffset, bridges::cpp_uno::shared::isSimpleType( |