INTEGRATION: CWS ia64port01_DEV300 (1.10.32); FILE MERGED
2008/02/18 10:47:02 cmc 1.10.32.1: #i84999# follow sb's suggested pattern, stage 1, gcc3_freebsd_*
This commit is contained in:
parent
b2abf01b67
commit
262f592965
1 changed files with 23 additions and 15 deletions
|
@ -4,9 +4,9 @@
|
||||||
*
|
*
|
||||||
* $RCSfile: cpp2uno.cxx,v $
|
* $RCSfile: cpp2uno.cxx,v $
|
||||||
*
|
*
|
||||||
* $Revision: 1.10 $
|
* $Revision: 1.11 $
|
||||||
*
|
*
|
||||||
* last change: $Author: rt $ $Date: 2007-07-05 08:59:35 $
|
* last change: $Author: obo $ $Date: 2008-02-27 09:49:11 $
|
||||||
*
|
*
|
||||||
* The Contents of this file are made available subject to
|
* The Contents of this file are made available subject to
|
||||||
* the terms of GNU Lesser General Public License Version 2.1.
|
* the terms of GNU Lesser General Public License Version 2.1.
|
||||||
|
@ -421,29 +421,37 @@ unsigned char * codeSnippet(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ** bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block)
|
struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; };
|
||||||
|
|
||||||
|
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_Size bridges::cpp_uno::shared::VtableFactory::getBlockSize(
|
||||||
sal_Int32 slotCount)
|
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) {
|
bridges::cpp_uno::shared::VtableFactory::Slot *
|
||||||
void ** slots = mapBlockToVtable(block);
|
bridges::cpp_uno::shared::VtableFactory::initializeBlock(
|
||||||
slots[-2] = 0;
|
void * block, sal_Int32 slotCount)
|
||||||
slots[-1] = 0;
|
{
|
||||||
return slots;
|
Slot * slots = mapBlockToVtable(block);
|
||||||
|
slots[-2].fn = 0;
|
||||||
|
slots[-1].fn = 0;
|
||||||
|
return slots + slotCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
|
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,
|
typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset,
|
||||||
sal_Int32 /*functionCount*/, sal_Int32 vtableOffset)
|
sal_Int32 functionCount, sal_Int32 vtableOffset)
|
||||||
{
|
{
|
||||||
|
(*slots) -= functionCount;
|
||||||
|
Slot * s = *slots;
|
||||||
for (sal_Int32 i = 0; i < type->nMembers; ++i) {
|
for (sal_Int32 i = 0; i < type->nMembers; ++i) {
|
||||||
typelib_TypeDescription * member = 0;
|
typelib_TypeDescription * member = 0;
|
||||||
TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
|
TYPELIB_DANGER_GET(&member, type->ppMembers[i]);
|
||||||
|
@ -451,7 +459,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
|
||||||
switch (member->eTypeClass) {
|
switch (member->eTypeClass) {
|
||||||
case typelib_TypeClass_INTERFACE_ATTRIBUTE:
|
case typelib_TypeClass_INTERFACE_ATTRIBUTE:
|
||||||
// Getter:
|
// Getter:
|
||||||
*slots++ = code;
|
(s++)->fn = code;
|
||||||
code = codeSnippet(
|
code = codeSnippet(
|
||||||
code, functionOffset++, vtableOffset,
|
code, functionOffset++, vtableOffset,
|
||||||
reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
|
reinterpret_cast< typelib_InterfaceAttributeTypeDescription * >(
|
||||||
|
@ -461,7 +469,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
|
||||||
typelib_InterfaceAttributeTypeDescription * >(
|
typelib_InterfaceAttributeTypeDescription * >(
|
||||||
member)->bReadOnly)
|
member)->bReadOnly)
|
||||||
{
|
{
|
||||||
*slots++ = code;
|
(s++)->fn = code;
|
||||||
code = codeSnippet(
|
code = codeSnippet(
|
||||||
code, functionOffset++, vtableOffset,
|
code, functionOffset++, vtableOffset,
|
||||||
typelib_TypeClass_VOID);
|
typelib_TypeClass_VOID);
|
||||||
|
@ -469,7 +477,7 @@ unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions(
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case typelib_TypeClass_INTERFACE_METHOD:
|
case typelib_TypeClass_INTERFACE_METHOD:
|
||||||
*slots++ = code;
|
(s++)->fn = code;
|
||||||
code = codeSnippet(
|
code = codeSnippet(
|
||||||
code, functionOffset++, vtableOffset,
|
code, functionOffset++, vtableOffset,
|
||||||
reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
|
reinterpret_cast< typelib_InterfaceMethodTypeDescription * >(
|
||||||
|
|
Loading…
Reference in a new issue