10#include <com/sun/star/uno/genfunc.hxx>
12#include <typelib/typedescription.hxx>
23 const typelib_CompoundTypeDescription* pTypeDescr)
25 for (
int i = 0;
i < pTypeDescr->nMembers;
i++)
27 typelib_TypeDescriptionReference* pTypeInStruct = pTypeDescr->ppTypeRefs[
i];
28 switch (pTypeInStruct->eTypeClass)
30 case typelib_TypeClass_STRUCT:
31 case typelib_TypeClass_EXCEPTION:
34 TYPELIB_DANGER_GET(&childTypeDescr, pTypeInStruct);
37 reinterpret_cast<typelib_CompoundTypeDescription const*
>(childTypeDescr));
38 TYPELIB_DANGER_RELEASE(childTypeDescr);
41 case typelib_TypeClass_FLOAT:
42 case typelib_TypeClass_DOUBLE:
53 void* pRegisterReturn)
56 printf(
"In fillStruct, pTypeDescr = %p, gret = %p, fret = %p, pRegisterReturn = %p\n",
57 pTypeDescr, gret, fret, pRegisterReturn);
61 countnGreg(nGreg, nFreg,
reinterpret_cast<typelib_CompoundTypeDescription const*
>(pTypeDescr));
62 char* pAdjust =
reinterpret_cast<char*
>(pRegisterReturn);
63 if (nGreg == 0 && nFreg <= 2)
65 if (pTypeDescr->nSize <= 8 && nFreg == 2)
67 std::memcpy(pAdjust, fret, 4);
68 std::memcpy(pAdjust + 4, fret + 1, 4);
72 std::memcpy(pAdjust, fret, 16);
75 else if (nFreg == 1 && nGreg == 1)
77 if (pTypeDescr->nSize > 8)
79 std::memcpy(pAdjust, gret, 8);
80 std::memcpy(pAdjust + 8, fret, 8);
84 std::memcpy(pAdjust, gret, 4);
85 std::memcpy(pAdjust + 4, fret, 4);
90 std::memcpy(pAdjust, gret, 16);
struct _typelib_TypeDescription typelib_TypeDescription
void countnGreg(sal_Int32 &nGreg, sal_Int32 &nFreg, const typelib_CompoundTypeDescription *pTypeDescr)
void fillStruct(const typelib_TypeDescription *pTypeDescr, sal_Int64 *gret, double *fret, void *pRegisterReturn)