diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-10-02 15:20:26 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-10-02 15:20:26 +0200 |
commit | 04740cb7e23cc293e1143d6dc7a4444202331abb (patch) | |
tree | b853585a15596cf1ee58be2e5f41383d2da8c94b | |
parent | 7c3f7016f1bcbc6b7c46de3420c4410700dae5cd (diff) |
cli_ure (Windows): std::auto_ptr -> std::unique_ptr
Change-Id: Ibe794daffa347d194ff8c66a44c7eec4bcc9b83d
-rw-r--r-- | cli_ure/source/uno_bridge/cli_base.h | 6 | ||||
-rw-r--r-- | cli_ure/source/uno_bridge/cli_data.cxx | 16 | ||||
-rw-r--r-- | cli_ure/source/uno_bridge/cli_uno.cxx | 2 |
3 files changed, 12 insertions, 12 deletions
diff --git a/cli_ure/source/uno_bridge/cli_base.h b/cli_ure/source/uno_bridge/cli_base.h index ebe00c23c5c6..47aa720a519b 100644 --- a/cli_ure/source/uno_bridge/cli_base.h +++ b/cli_ure/source/uno_bridge/cli_base.h @@ -124,15 +124,15 @@ struct rtl_mem 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 ); if (0 == p) throw BridgeRuntimeError("out of memory!" ); - return ::std::auto_ptr< rtl_mem >( (rtl_mem *)p ); + return ::std::unique_ptr< rtl_mem >( (rtl_mem *)p ); } diff --git a/cli_ure/source/uno_bridge/cli_data.cxx b/cli_ure/source/uno_bridge/cli_data.cxx index f050ee0bc8d7..201244357f9e 100644 --- a/cli_ure/source/uno_bridge/cli_data.cxx +++ b/cli_ure/source/uno_bridge/cli_data.cxx @@ -49,9 +49,9 @@ OUString mapCliTypeName(System::String^ typeName); System::String^ mapCliPolymorphicName(System::String^ unoName); 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) ) ); uno_Sequence * p = (uno_Sequence *)seq.get(); p->nRefCount = 1; @@ -897,7 +897,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data, } 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); pAny->pData = mem.release(); } @@ -910,7 +910,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data, } 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); pAny->pData = mem.release(); } @@ -923,7 +923,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data, } 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); pAny->pData = mem.release(); } @@ -936,7 +936,7 @@ void Bridge::map_to_uno(void * uno_data, System::Object^ cli_data, } 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); 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); typelib_TypeDescription* td= NULL; 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); map_to_uno( 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_IndirectTypeDescription *)td.get())->pType; - auto_ptr< rtl_mem > seq; + unique_ptr< rtl_mem > seq; System::Array^ ar = nullptr; if (cli_data != nullptr) diff --git a/cli_ure/source/uno_bridge/cli_uno.cxx b/cli_ure/source/uno_bridge/cli_uno.cxx index e705de141d8d..97b0fa08645d 100644 --- a/cli_ure/source/uno_bridge/cli_uno.cxx +++ b/cli_ure/source/uno_bridge/cli_uno.cxx @@ -221,7 +221,7 @@ void Bridge::call_cli( System::Exception^ exc= e->InnerException; css::uno::TypeDescription td(mapCliType(exc->GetType())); // 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); (*uno_exc)->pType= td.get()->pWeakRef; (*uno_exc)->pData= memExc.release(); |