1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
26 #include <type_traits>
32 //#### copy construction ###########################################################################
36 // The non-dynamic prefix of sal_Sequence (aka uno_Sequence):
37 struct SequencePrefix
{
41 static_assert(sizeof (SequencePrefix
) < sizeof (uno_Sequence
));
42 static_assert(offsetof(SequencePrefix
, nRefCount
) == offsetof(uno_Sequence
, nRefCount
));
44 std::is_same_v
<decltype(SequencePrefix::nRefCount
), decltype(uno_Sequence::nRefCount
)>);
45 static_assert(offsetof(SequencePrefix
, nElements
) == offsetof(uno_Sequence
, nElements
));
47 std::is_same_v
<decltype(SequencePrefix::nElements
), decltype(uno_Sequence::nElements
)>);
51 inline uno_Sequence
* allocSeq(
52 sal_Int32 nElementSize
, sal_Int32 nElements
)
54 OSL_ASSERT( nElements
>= 0 && nElementSize
>= 0 );
55 uno_Sequence
* pSeq
= nullptr;
56 sal_uInt32 nSize
= calcSeqMemSize( nElementSize
, nElements
);
59 pSeq
= static_cast<uno_Sequence
*>(std::malloc( nSize
));
62 // header init, going via SequencePrefix to avoid UBSan insufficient-object-size
63 // warnings when `nElements == 0` and thus `nSize < sizeof (uno_Sequence)`:
64 auto const header
= reinterpret_cast<SequencePrefix
*>(pSeq
);
65 header
->nRefCount
= 1;
66 header
->nElements
= nElements
;
73 void copyConstructStruct(
74 void * pDest
, void * pSource
,
75 typelib_CompoundTypeDescription
* pTypeDescr
,
76 uno_AcquireFunc acquire
, uno_Mapping
* mapping
);
78 inline void _copyConstructStruct(
79 void * pDest
, void * pSource
,
80 typelib_CompoundTypeDescription
* pTypeDescr
,
81 uno_AcquireFunc acquire
, uno_Mapping
* mapping
)
83 if (pTypeDescr
->pBaseTypeDescription
)
86 copyConstructStruct( pDest
, pSource
, pTypeDescr
->pBaseTypeDescription
, acquire
, mapping
);
90 typelib_TypeDescriptionReference
** ppTypeRefs
= pTypeDescr
->ppTypeRefs
;
91 sal_Int32
* pMemberOffsets
= pTypeDescr
->pMemberOffsets
;
92 sal_Int32 nDescr
= pTypeDescr
->nMembers
;
98 ::uno_type_copyAndConvertData(
99 static_cast<char *>(pDest
) + pMemberOffsets
[nDescr
],
100 static_cast<char *>(pSource
) + pMemberOffsets
[nDescr
],
101 ppTypeRefs
[nDescr
], mapping
);
109 static_cast<char *>(pDest
) + pMemberOffsets
[nDescr
],
110 static_cast<char *>(pSource
) + pMemberOffsets
[nDescr
],
111 ppTypeRefs
[nDescr
], acquire
);
117 uno_Sequence
* copyConstructSequence(
118 uno_Sequence
* pSource
,
119 typelib_TypeDescriptionReference
* pElementType
,
120 uno_AcquireFunc acquire
, uno_Mapping
* mapping
);
123 inline void _copyConstructAnyFromData(
124 uno_Any
* pDestAny
, void * pSource
,
125 typelib_TypeDescriptionReference
* pType
, typelib_TypeDescription
* pTypeDescr
,
126 uno_AcquireFunc acquire
, uno_Mapping
* mapping
)
128 TYPE_ACQUIRE( pType
);
129 pDestAny
->pType
= pType
;
131 switch (pType
->eTypeClass
)
133 case typelib_TypeClass_CHAR
:
134 pDestAny
->pData
= &pDestAny
->pReserved
;
135 *static_cast<sal_Unicode
*>(pDestAny
->pData
) = *static_cast<sal_Unicode
*>(pSource
);
137 case typelib_TypeClass_BOOLEAN
:
138 pDestAny
->pData
= &pDestAny
->pReserved
;
139 *static_cast<sal_Bool
*>(pDestAny
->pData
) = bool(*static_cast<sal_Bool
*>(pSource
));
141 case typelib_TypeClass_BYTE
:
142 pDestAny
->pData
= &pDestAny
->pReserved
;
143 *static_cast<sal_Int8
*>(pDestAny
->pData
) = *static_cast<sal_Int8
*>(pSource
);
145 case typelib_TypeClass_SHORT
:
146 case typelib_TypeClass_UNSIGNED_SHORT
:
147 pDestAny
->pData
= &pDestAny
->pReserved
;
148 *static_cast<sal_Int16
*>(pDestAny
->pData
) = *static_cast<sal_Int16
*>(pSource
);
150 case typelib_TypeClass_LONG
:
151 case typelib_TypeClass_UNSIGNED_LONG
:
152 case typelib_TypeClass_ENUM
: // enum is forced to 32bit long
153 pDestAny
->pData
= &pDestAny
->pReserved
;
154 *static_cast<sal_Int32
*>(pDestAny
->pData
) = *static_cast<sal_Int32
*>(pSource
);
156 case typelib_TypeClass_HYPER
:
157 case typelib_TypeClass_UNSIGNED_HYPER
:
158 if (sizeof(void *) >= sizeof(sal_Int64
))
159 pDestAny
->pData
= &pDestAny
->pReserved
;
161 pDestAny
->pData
= std::malloc( sizeof(sal_Int64
) );
162 assert(pDestAny
->pData
);
163 *static_cast<sal_Int64
*>(pDestAny
->pData
) = *static_cast<sal_Int64
*>(pSource
);
165 case typelib_TypeClass_FLOAT
:
166 if (sizeof(void *) >= sizeof(float))
167 pDestAny
->pData
= &pDestAny
->pReserved
;
169 pDestAny
->pData
= std::malloc( sizeof(float) );
170 assert(pDestAny
->pData
);
171 *static_cast<float *>(pDestAny
->pData
) = *static_cast<float *>(pSource
);
173 case typelib_TypeClass_DOUBLE
:
174 if (sizeof(void *) >= sizeof(double))
175 pDestAny
->pData
= &pDestAny
->pReserved
;
177 pDestAny
->pData
= std::malloc( sizeof(double) );
178 assert(pDestAny
->pData
);
179 *static_cast<double *>(pDestAny
->pData
) = *static_cast<double *>(pSource
);
181 case typelib_TypeClass_STRING
:
182 ::rtl_uString_acquire( *static_cast<rtl_uString
**>(pSource
) );
183 pDestAny
->pData
= &pDestAny
->pReserved
;
184 *static_cast<rtl_uString
**>(pDestAny
->pData
) = *static_cast<rtl_uString
**>(pSource
);
186 case typelib_TypeClass_TYPE
:
187 TYPE_ACQUIRE( *static_cast<typelib_TypeDescriptionReference
**>(pSource
) );
188 pDestAny
->pData
= &pDestAny
->pReserved
;
189 *static_cast<typelib_TypeDescriptionReference
**>(pDestAny
->pData
) = *static_cast<typelib_TypeDescriptionReference
**>(pSource
);
191 case typelib_TypeClass_ANY
:
192 OSL_FAIL( "### unexpected nested any!" );
194 case typelib_TypeClass_STRUCT
:
195 case typelib_TypeClass_EXCEPTION
:
198 pDestAny
->pData
= std::malloc( pTypeDescr
->nSize
);
199 _copyConstructStruct(
200 pDestAny
->pData
, pSource
,
201 reinterpret_cast<typelib_CompoundTypeDescription
*>(pTypeDescr
),
206 TYPELIB_DANGER_GET( &pTypeDescr
, pType
);
207 pDestAny
->pData
= std::malloc( pTypeDescr
->nSize
);
208 _copyConstructStruct(
209 pDestAny
->pData
, pSource
,
210 reinterpret_cast<typelib_CompoundTypeDescription
*>(pTypeDescr
),
212 TYPELIB_DANGER_RELEASE( pTypeDescr
);
215 case typelib_TypeClass_SEQUENCE
:
216 pDestAny
->pData
= &pDestAny
->pReserved
;
219 *static_cast<uno_Sequence
**>(pDestAny
->pData
) = copyConstructSequence(
220 *static_cast<uno_Sequence
**>(pSource
),
221 reinterpret_cast<typelib_IndirectTypeDescription
*>(pTypeDescr
)->pType
,
226 TYPELIB_DANGER_GET( &pTypeDescr
, pType
);
227 *static_cast<uno_Sequence
**>(pDestAny
->pData
) = copyConstructSequence(
228 *static_cast<uno_Sequence
**>(pSource
),
229 reinterpret_cast<typelib_IndirectTypeDescription
*>(pTypeDescr
)->pType
,
231 TYPELIB_DANGER_RELEASE( pTypeDescr
);
234 case typelib_TypeClass_INTERFACE
:
235 pDestAny
->pData
= &pDestAny
->pReserved
;
238 pDestAny
->pReserved
= _map( *static_cast<void **>(pSource
), pType
, pTypeDescr
, mapping
);
242 pDestAny
->pReserved
= *static_cast<void **>(pSource
);
243 _acquire( pDestAny
->pReserved
, acquire
);
252 inline void _copyConstructAny(
253 uno_Any
* pDestAny
, void * pSource
,
254 typelib_TypeDescriptionReference
* pType
, typelib_TypeDescription
* pTypeDescr
,
255 uno_AcquireFunc acquire
, uno_Mapping
* mapping
)
257 if (typelib_TypeClass_VOID
== pType
->eTypeClass
)
259 CONSTRUCT_EMPTY_ANY( pDestAny
);
263 if (typelib_TypeClass_ANY
== pType
->eTypeClass
)
267 pType
= static_cast<uno_Any
*>(pSource
)->pType
;
268 if (typelib_TypeClass_VOID
== pType
->eTypeClass
)
270 CONSTRUCT_EMPTY_ANY( pDestAny
);
273 pTypeDescr
= nullptr;
274 pSource
= static_cast<uno_Any
*>(pSource
)->pData
;
278 CONSTRUCT_EMPTY_ANY( pDestAny
);
284 _copyConstructAnyFromData( pDestAny
, pSource
, pType
, pTypeDescr
, acquire
, mapping
);
286 else // default construct
288 TYPE_ACQUIRE( pType
);
289 pDestAny
->pType
= pType
;
290 switch (pType
->eTypeClass
)
292 case typelib_TypeClass_CHAR
:
293 pDestAny
->pData
= &pDestAny
->pReserved
;
294 *static_cast<sal_Unicode
*>(pDestAny
->pData
) = '\0';
296 case typelib_TypeClass_BOOLEAN
:
297 pDestAny
->pData
= &pDestAny
->pReserved
;
298 *static_cast<sal_Bool
*>(pDestAny
->pData
) = false;
300 case typelib_TypeClass_BYTE
:
301 pDestAny
->pData
= &pDestAny
->pReserved
;
302 *static_cast<sal_Int8
*>(pDestAny
->pData
) = 0;
304 case typelib_TypeClass_SHORT
:
305 case typelib_TypeClass_UNSIGNED_SHORT
:
306 pDestAny
->pData
= &pDestAny
->pReserved
;
307 *static_cast<sal_Int16
*>(pDestAny
->pData
) = 0;
309 case typelib_TypeClass_LONG
:
310 case typelib_TypeClass_UNSIGNED_LONG
:
311 pDestAny
->pData
= &pDestAny
->pReserved
;
312 *static_cast<sal_Int32
*>(pDestAny
->pData
) = 0;
314 case typelib_TypeClass_HYPER
:
315 case typelib_TypeClass_UNSIGNED_HYPER
:
316 if (sizeof(void *) >= sizeof(sal_Int64
))
317 pDestAny
->pData
= &pDestAny
->pReserved
;
319 pDestAny
->pData
= std::malloc( sizeof(sal_Int64
) );
320 assert(pDestAny
->pData
);
321 *static_cast<sal_Int64
*>(pDestAny
->pData
) = 0;
323 case typelib_TypeClass_FLOAT
:
324 if (sizeof(void *) >= sizeof(float))
325 pDestAny
->pData
= &pDestAny
->pReserved
;
327 pDestAny
->pData
= std::malloc( sizeof(float) );
328 assert(pDestAny
->pData
);
329 *static_cast<float *>(pDestAny
->pData
) = 0.0;
331 case typelib_TypeClass_DOUBLE
:
332 if (sizeof(void *) >= sizeof(double))
333 pDestAny
->pData
= &pDestAny
->pReserved
;
335 pDestAny
->pData
= std::malloc( sizeof(double) );
336 assert(pDestAny
->pData
);
337 *static_cast<double *>(pDestAny
->pData
) = 0.0;
339 case typelib_TypeClass_STRING
:
340 pDestAny
->pData
= &pDestAny
->pReserved
;
341 *static_cast<rtl_uString
**>(pDestAny
->pData
) = nullptr;
342 ::rtl_uString_new( static_cast<rtl_uString
**>(pDestAny
->pData
) );
344 case typelib_TypeClass_TYPE
:
345 pDestAny
->pData
= &pDestAny
->pReserved
;
346 *static_cast<typelib_TypeDescriptionReference
**>(pDestAny
->pData
) = _getVoidType();
348 case typelib_TypeClass_ENUM
:
349 pDestAny
->pData
= &pDestAny
->pReserved
;
352 *static_cast<sal_Int32
*>(pDestAny
->pData
) = reinterpret_cast<typelib_EnumTypeDescription
*>(pTypeDescr
)->nDefaultEnumValue
;
356 TYPELIB_DANGER_GET( &pTypeDescr
, pType
);
357 *static_cast<sal_Int32
*>(pDestAny
->pData
) = reinterpret_cast<typelib_EnumTypeDescription
*>(pTypeDescr
)->nDefaultEnumValue
;
358 TYPELIB_DANGER_RELEASE( pTypeDescr
);
361 case typelib_TypeClass_STRUCT
:
362 case typelib_TypeClass_EXCEPTION
:
365 pDestAny
->pData
= std::malloc( pTypeDescr
->nSize
);
366 _defaultConstructStruct(
367 pDestAny
->pData
, reinterpret_cast<typelib_CompoundTypeDescription
*>(pTypeDescr
) );
371 TYPELIB_DANGER_GET( &pTypeDescr
, pType
);
372 pDestAny
->pData
= std::malloc( pTypeDescr
->nSize
);
373 _defaultConstructStruct(
374 pDestAny
->pData
, reinterpret_cast<typelib_CompoundTypeDescription
*>(pTypeDescr
) );
375 TYPELIB_DANGER_RELEASE( pTypeDescr
);
378 case typelib_TypeClass_SEQUENCE
:
379 pDestAny
->pData
= &pDestAny
->pReserved
;
380 *static_cast<uno_Sequence
**>(pDestAny
->pData
) = createEmptySequence();
382 case typelib_TypeClass_INTERFACE
:
383 pDestAny
->pData
= &pDestAny
->pReserved
;
384 pDestAny
->pReserved
= nullptr; // either cpp or c-uno interface
394 inline uno_Sequence
* icopyConstructSequence(
395 uno_Sequence
* pSource
,
396 typelib_TypeDescriptionReference
* pElementType
,
397 uno_AcquireFunc acquire
, uno_Mapping
* mapping
)
399 typelib_TypeClass eTypeClass
= pElementType
->eTypeClass
;
401 (eTypeClass
<= typelib_TypeClass_ENUM
&&
402 eTypeClass
!= typelib_TypeClass_ANY
))
404 osl_atomic_increment( &pSource
->nRefCount
);
407 else // create new sequence
409 uno_Sequence
* pDest
;
410 sal_Int32 nElements
= pSource
->nElements
;
415 case typelib_TypeClass_ANY
:
417 pDest
= allocSeq( sizeof (uno_Any
), nElements
);
418 if (pDest
!= nullptr)
420 uno_Any
* pDestElements
= reinterpret_cast<uno_Any
*>(pDest
->elements
);
421 uno_Any
* pSourceElements
= reinterpret_cast<uno_Any
*>(pSource
->elements
);
422 for ( sal_Int32 nPos
= nElements
; nPos
--; )
424 typelib_TypeDescriptionReference
* pType
=
425 pSourceElements
[nPos
].pType
;
426 if (typelib_TypeClass_VOID
== pType
->eTypeClass
)
428 CONSTRUCT_EMPTY_ANY( &pDestElements
[nPos
] );
432 _copyConstructAnyFromData(
433 &pDestElements
[nPos
],
434 pSourceElements
[nPos
].pData
,
442 case typelib_TypeClass_STRUCT
:
443 case typelib_TypeClass_EXCEPTION
:
445 typelib_TypeDescription
* pElementTypeDescr
= nullptr;
446 TYPELIB_DANGER_GET( &pElementTypeDescr
, pElementType
);
447 sal_Int32 nElementSize
= pElementTypeDescr
->nSize
;
448 char * pSourceElements
= pSource
->elements
;
449 pDest
= allocSeq( nElementSize
, nElements
);
450 if (pDest
!= nullptr)
452 char * pElements
= pDest
->elements
;
453 for ( sal_Int32 nPos
= nElements
; nPos
--; )
455 _copyConstructStruct(
456 pElements
+ (nPos
* nElementSize
),
457 pSourceElements
+ (nPos
* nElementSize
),
458 reinterpret_cast<typelib_CompoundTypeDescription
*>(
463 TYPELIB_DANGER_RELEASE( pElementTypeDescr
);
466 case typelib_TypeClass_SEQUENCE
: // sequence of sequence
468 // coverity[suspicious_sizeof] - sizeof(uno_Sequence*) is correct here
469 pDest
= allocSeq( sizeof (uno_Sequence
*), nElements
);
470 if (pDest
!= nullptr)
472 typelib_TypeDescription
* pElementTypeDescr
= nullptr;
473 TYPELIB_DANGER_GET( &pElementTypeDescr
, pElementType
);
474 typelib_TypeDescriptionReference
* pSeqElementType
=
475 reinterpret_cast<typelib_IndirectTypeDescription
*>(
476 pElementTypeDescr
)->pType
;
478 uno_Sequence
** pDestElements
=
479 reinterpret_cast<uno_Sequence
**>(pDest
->elements
);
480 uno_Sequence
** pSourceElements
=
481 reinterpret_cast<uno_Sequence
**>(pSource
->elements
);
482 for ( sal_Int32 nPos
= nElements
; nPos
--; )
484 uno_Sequence
* pNew
= copyConstructSequence(
485 pSourceElements
[nPos
],
488 OSL_ASSERT( pNew
!= nullptr );
489 // ought never be a memory allocation problem,
490 // because of reference counted sequence handles
491 pDestElements
[ nPos
] = pNew
;
494 TYPELIB_DANGER_RELEASE( pElementTypeDescr
);
498 case typelib_TypeClass_INTERFACE
:
500 pDest
= allocSeq( sizeof (void *), nElements
);
501 if (pDest
!= nullptr)
503 char * pElements
= pDest
->elements
;
504 void ** pSourceElements
= reinterpret_cast<void **>(pSource
->elements
);
505 typelib_TypeDescription
* pElementTypeDescr
= nullptr;
506 TYPELIB_DANGER_GET( &pElementTypeDescr
, pElementType
);
507 for ( sal_Int32 nPos
= nElements
; nPos
--; )
509 reinterpret_cast<void **>(pElements
)[nPos
] = nullptr;
510 if (pSourceElements
[nPos
])
512 (*mapping
->mapInterface
)(
513 mapping
, reinterpret_cast<void **>(pElements
) + nPos
,
514 pSourceElements
[nPos
],
515 reinterpret_cast<typelib_InterfaceTypeDescription
*>(
516 pElementTypeDescr
) );
519 TYPELIB_DANGER_RELEASE( pElementTypeDescr
);
524 OSL_FAIL( "### unexpected sequence element type!" );
529 else // empty sequence
531 pDest
= allocSeq( 0, 0 );
539 inline void _copyConstructData(
540 void * pDest
, void * pSource
,
541 typelib_TypeDescriptionReference
* pType
, typelib_TypeDescription
* pTypeDescr
,
542 uno_AcquireFunc acquire
, uno_Mapping
* mapping
)
544 switch (pType
->eTypeClass
)
546 case typelib_TypeClass_CHAR
:
547 *static_cast<sal_Unicode
*>(pDest
) = *static_cast<sal_Unicode
*>(pSource
);
549 case typelib_TypeClass_BOOLEAN
:
550 *static_cast<sal_Bool
*>(pDest
) = bool(*static_cast<sal_Bool
*>(pSource
));
552 case typelib_TypeClass_BYTE
:
553 *static_cast<sal_Int8
*>(pDest
) = *static_cast<sal_Int8
*>(pSource
);
555 case typelib_TypeClass_SHORT
:
556 case typelib_TypeClass_UNSIGNED_SHORT
:
557 *static_cast<sal_Int16
*>(pDest
) = *static_cast<sal_Int16
*>(pSource
);
559 case typelib_TypeClass_LONG
:
560 case typelib_TypeClass_UNSIGNED_LONG
:
561 case typelib_TypeClass_ENUM
:
562 *static_cast<sal_Int32
*>(pDest
) = *static_cast<sal_Int32
*>(pSource
);
564 case typelib_TypeClass_HYPER
:
565 case typelib_TypeClass_UNSIGNED_HYPER
:
566 *static_cast<sal_Int64
*>(pDest
) = *static_cast<sal_Int64
*>(pSource
);
568 case typelib_TypeClass_FLOAT
:
569 *static_cast<float *>(pDest
) = *static_cast<float *>(pSource
);
571 case typelib_TypeClass_DOUBLE
:
572 *static_cast<double *>(pDest
) = *static_cast<double *>(pSource
);
574 case typelib_TypeClass_STRING
:
575 ::rtl_uString_acquire( *static_cast<rtl_uString
**>(pSource
) );
576 *static_cast<rtl_uString
**>(pDest
) = *static_cast<rtl_uString
**>(pSource
);
578 case typelib_TypeClass_TYPE
:
579 TYPE_ACQUIRE( *static_cast<typelib_TypeDescriptionReference
**>(pSource
) );
580 *static_cast<typelib_TypeDescriptionReference
**>(pDest
) = *static_cast<typelib_TypeDescriptionReference
**>(pSource
);
582 case typelib_TypeClass_ANY
:
584 static_cast<uno_Any
*>(pDest
), static_cast<uno_Any
*>(pSource
)->pData
,
585 static_cast<uno_Any
*>(pSource
)->pType
, nullptr,
588 case typelib_TypeClass_STRUCT
:
589 case typelib_TypeClass_EXCEPTION
:
592 _copyConstructStruct(
594 reinterpret_cast<typelib_CompoundTypeDescription
*>(pTypeDescr
),
599 TYPELIB_DANGER_GET( &pTypeDescr
, pType
);
600 _copyConstructStruct(
602 reinterpret_cast<typelib_CompoundTypeDescription
*>(pTypeDescr
),
604 TYPELIB_DANGER_RELEASE( pTypeDescr
);
607 case typelib_TypeClass_SEQUENCE
:
612 *static_cast<uno_Sequence
**>(pDest
) = icopyConstructSequence(
613 *static_cast<uno_Sequence
**>(pSource
),
614 reinterpret_cast<typelib_IndirectTypeDescription
*>(pTypeDescr
)->pType
,
619 TYPELIB_DANGER_GET( &pTypeDescr
, pType
);
620 *static_cast<uno_Sequence
**>(pDest
) = icopyConstructSequence(
621 *static_cast<uno_Sequence
**>(pSource
),
622 reinterpret_cast<typelib_IndirectTypeDescription
*>(pTypeDescr
)->pType
,
624 TYPELIB_DANGER_RELEASE( pTypeDescr
);
629 osl_atomic_increment( &(*static_cast<uno_Sequence
**>(pSource
))->nRefCount
);
630 *static_cast<uno_Sequence
**>(pDest
) = *static_cast<uno_Sequence
**>(pSource
);
633 case typelib_TypeClass_INTERFACE
:
635 *static_cast<void **>(pDest
) = _map( *static_cast<void **>(pSource
), pType
, pTypeDescr
, mapping
);
638 *static_cast<void **>(pDest
) = *static_cast<void **>(pSource
);
639 _acquire( *static_cast<void **>(pDest
), acquire
);
649 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */