cli_ure (Windows): std::auto_ptr -> std::unique_ptr
Change-Id: Ibe794daffa347d194ff8c66a44c7eec4bcc9b83d
This commit is contained in:
@@ -124,15 +124,15 @@ struct rtl_mem
|
|||||||
inline static void operator delete ( void *, void * )
|
inline static void operator delete ( void *, void * )
|
||||||
{}
|
{}
|
||||||
|
|
||||||
static inline ::std::auto_ptr< rtl_mem > allocate( ::std::size_t bytes );
|
static inline ::std::unique_ptr< rtl_mem > allocate( ::std::size_t bytes );
|
||||||
};
|
};
|
||||||
|
|
||||||
inline ::std::auto_ptr< rtl_mem > rtl_mem::allocate( ::std::size_t bytes )
|
inline ::std::unique_ptr< rtl_mem > rtl_mem::allocate( ::std::size_t bytes )
|
||||||
{
|
{
|
||||||
void * p = rtl_allocateMemory( bytes );
|
void * p = rtl_allocateMemory( bytes );
|
||||||
if (0 == p)
|
if (0 == p)
|
||||||
throw BridgeRuntimeError("out of memory!" );
|
throw BridgeRuntimeError("out of memory!" );
|
||||||
return ::std::auto_ptr< rtl_mem >( (rtl_mem *)p );
|
return ::std::unique_ptr< rtl_mem >( (rtl_mem *)p );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -49,9 +49,9 @@ OUString mapCliTypeName(System::String^ typeName);
|
|||||||
System::String^ mapCliPolymorphicName(System::String^ unoName);
|
System::String^ mapCliPolymorphicName(System::String^ unoName);
|
||||||
System::String^ mapPolymorphicName(System::String^ unoName, bool bCliToUno);
|
System::String^ mapPolymorphicName(System::String^ unoName, bool bCliToUno);
|
||||||
|
|
||||||
inline auto_ptr< rtl_mem > seq_allocate( sal_Int32 nElements, sal_Int32 nSize )
|
inline unique_ptr< rtl_mem > seq_allocate( sal_Int32 nElements, sal_Int32 nSize )
|
||||||
{
|
{
|
||||||
auto_ptr< rtl_mem > seq(
|
unique_ptr< rtl_mem > seq(
|
||||||
rtl_mem::allocate( SAL_SEQUENCE_HEADER_SIZE + (nElements * nSize) ) );
|
rtl_mem::allocate( SAL_SEQUENCE_HEADER_SIZE + (nElements * nSize) ) );
|
||||||
uno_Sequence * p = (uno_Sequence *)seq.get();
|
uno_Sequence * p = (uno_Sequence *)seq.get();
|
||||||
p->nRefCount = 1;
|
p->nRefCount = 1;
|
||||||
@@ -897,7 +897,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (sal_Int64) ) );
|
unique_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (sal_Int64) ) );
|
||||||
*(sal_Int64 *) mem.get()= *safe_cast<System::Int64^>(aAny.Value);
|
*(sal_Int64 *) mem.get()= *safe_cast<System::Int64^>(aAny.Value);
|
||||||
pAny->pData = mem.release();
|
pAny->pData = mem.release();
|
||||||
}
|
}
|
||||||
@@ -910,7 +910,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (sal_uInt64) ) );
|
unique_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (sal_uInt64) ) );
|
||||||
*(sal_uInt64 *) mem.get()= *safe_cast<System::UInt64^>(aAny.Value);
|
*(sal_uInt64 *) mem.get()= *safe_cast<System::UInt64^>(aAny.Value);
|
||||||
pAny->pData = mem.release();
|
pAny->pData = mem.release();
|
||||||
}
|
}
|
||||||
@@ -923,7 +923,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (float) ) );
|
unique_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (float) ) );
|
||||||
*(float*) mem.get() = *safe_cast<System::Single^>(aAny.Value);
|
*(float*) mem.get() = *safe_cast<System::Single^>(aAny.Value);
|
||||||
pAny->pData = mem.release();
|
pAny->pData = mem.release();
|
||||||
}
|
}
|
||||||
@@ -936,7 +936,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
auto_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (double) ) );
|
unique_ptr< rtl_mem > mem( rtl_mem::allocate( sizeof (double) ) );
|
||||||
*(double*) mem.get()= *safe_cast<System::Double^>(aAny.Value);
|
*(double*) mem.get()= *safe_cast<System::Double^>(aAny.Value);
|
||||||
pAny->pData= mem.release();
|
pAny->pData= mem.release();
|
||||||
}
|
}
|
||||||
@@ -965,7 +965,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
|
|||||||
css::uno::Type anyType(value_td);
|
css::uno::Type anyType(value_td);
|
||||||
typelib_TypeDescription* td= NULL;
|
typelib_TypeDescription* td= NULL;
|
||||||
anyType.getDescription(&td);
|
anyType.getDescription(&td);
|
||||||
auto_ptr< rtl_mem > mem(rtl_mem::allocate(td->nSize));
|
unique_ptr< rtl_mem > mem(rtl_mem::allocate(td->nSize));
|
||||||
typelib_typedescription_release(td);
|
typelib_typedescription_release(td);
|
||||||
map_to_uno(
|
map_to_uno(
|
||||||
mem.get(), aAny.Value, value_td.getTypeLibType(),
|
mem.get(), aAny.Value, value_td.getTypeLibType(),
|
||||||
@@ -1238,7 +1238,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data,
|
|||||||
typelib_TypeDescriptionReference * element_type =
|
typelib_TypeDescriptionReference * element_type =
|
||||||
((typelib_IndirectTypeDescription *)td.get())->pType;
|
((typelib_IndirectTypeDescription *)td.get())->pType;
|
||||||
|
|
||||||
auto_ptr< rtl_mem > seq;
|
unique_ptr< rtl_mem > seq;
|
||||||
|
|
||||||
System::Array^ ar = nullptr;
|
System::Array^ ar = nullptr;
|
||||||
if (cli_data != nullptr)
|
if (cli_data != nullptr)
|
||||||
|
@@ -221,7 +221,7 @@ void Bridge::call_cli(
|
|||||||
System::Exception^ exc= e->InnerException;
|
System::Exception^ exc= e->InnerException;
|
||||||
css::uno::TypeDescription td(mapCliType(exc->GetType()));
|
css::uno::TypeDescription td(mapCliType(exc->GetType()));
|
||||||
// memory for exception
|
// memory for exception
|
||||||
std::auto_ptr< rtl_mem > memExc(rtl_mem::allocate(td.get()->nSize));
|
std::unique_ptr< rtl_mem > memExc(rtl_mem::allocate(td.get()->nSize));
|
||||||
map_to_uno(memExc.get(), exc, td.get()->pWeakRef, false);
|
map_to_uno(memExc.get(), exc, td.get()->pWeakRef, false);
|
||||||
(*uno_exc)->pType= td.get()->pWeakRef;
|
(*uno_exc)->pType= td.get()->pWeakRef;
|
||||||
(*uno_exc)->pData= memExc.release();
|
(*uno_exc)->pData= memExc.release();
|
||||||
|
Reference in New Issue
Block a user