From 4a2f64620370587161b5437069c2f1d9f3d702d1 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Sat, 7 Feb 2015 12:26:18 +0100 Subject: loplugin:deletedspecial Change-Id: I646d55ee80ceeefbb3647ec64278460cc5af579f --- include/osl/conditn.hxx | 19 +++---------------- include/osl/diagnose.hxx | 5 ++--- include/osl/file.hxx | 16 ++++++++-------- include/osl/module.hxx | 4 ++-- include/osl/mutex.hxx | 32 ++++++++++---------------------- include/osl/thread.hxx | 8 ++++---- include/rtl/bootstrap.hxx | 4 ++-- include/rtl/uri.hxx | 12 ++++-------- 8 files changed, 35 insertions(+), 65 deletions(-) (limited to 'include') diff --git a/include/osl/conditn.hxx b/include/osl/conditn.hxx index 9485e7f41aed..0859a1419bd6 100644 --- a/include/osl/conditn.hxx +++ b/include/osl/conditn.hxx @@ -97,25 +97,12 @@ namespace osl constructed Condition may work on an already destructed oslCondition object. */ - Condition(const Condition&); + Condition(const Condition&) SAL_DELETED_FUNCTION; - /** The underlying oslCondition has no reference count. - - When destructed, the Condition object destroys the undelying oslCondition, - which might cause severe problems in case it's a temporary object. - - */ - Condition(oslCondition condition); - - /** This assignment operator is private for the same reason as + /** This assignment operator is deleted for the same reason as the copy constructor. */ - Condition& operator= (const Condition&); - - /** This assignment operator is private for the same reason as - the constructor taking a oslCondition argument. - */ - Condition& operator= (oslCondition); + Condition& operator= (const Condition&) SAL_DELETED_FUNCTION; }; } diff --git a/include/osl/diagnose.hxx b/include/osl/diagnose.hxx index e93573a49425..577b07c91d83 100644 --- a/include/osl/diagnose.hxx +++ b/include/osl/diagnose.hxx @@ -136,9 +136,8 @@ public: } private: - // not impl: - ObjectRegistry( ObjectRegistry const& ); - ObjectRegistry const& operator=( ObjectRegistry const& ); + ObjectRegistry( ObjectRegistry const& ) SAL_DELETED_FUNCTION; + ObjectRegistry const& operator=( ObjectRegistry const& ) SAL_DELETED_FUNCTION; ObjectRegistryData m_data; }; diff --git a/include/osl/file.hxx b/include/osl/file.hxx index 2c65fcd66e9b..19489484cb3b 100644 --- a/include/osl/file.hxx +++ b/include/osl/file.hxx @@ -419,12 +419,12 @@ class VolumeInfo /** Copy constructor. */ - VolumeInfo( VolumeInfo& ); + VolumeInfo( VolumeInfo& ) SAL_DELETED_FUNCTION; /** Assginment operator. */ - VolumeInfo& operator = ( VolumeInfo& ); + VolumeInfo& operator = ( VolumeInfo& ) SAL_DELETED_FUNCTION; public: @@ -657,12 +657,12 @@ class FileStatus /** Copy constructor. */ - FileStatus( FileStatus& ); + FileStatus( FileStatus& ) SAL_DELETED_FUNCTION; /** Assignment operator. */ - FileStatus& operator = ( FileStatus& ); + FileStatus& operator = ( FileStatus& ) SAL_DELETED_FUNCTION; public: @@ -911,12 +911,12 @@ class File: public FileBase /** Copy constructor. */ - File( File& ); + File( File& ) SAL_DELETED_FUNCTION; /** Assginment operator. */ - File& operator = ( File& ); + File& operator = ( File& ) SAL_DELETED_FUNCTION; public: @@ -1654,12 +1654,12 @@ class Directory: public FileBase /** Copy constructor. */ - Directory( Directory& ); + Directory( Directory& ) SAL_DELETED_FUNCTION; /** Assignment operator. */ - Directory& operator = ( Directory& ); + Directory& operator = ( Directory& ) SAL_DELETED_FUNCTION; public: diff --git a/include/osl/module.hxx b/include/osl/module.hxx index 058a1d155abe..7858ad0695e5 100644 --- a/include/osl/module.hxx +++ b/include/osl/module.hxx @@ -28,8 +28,8 @@ namespace osl class Module { - Module( const Module&); - Module& operator = ( const Module&); + Module( const Module&) SAL_DELETED_FUNCTION; + Module& operator = ( const Module&) SAL_DELETED_FUNCTION; public: static bool getUrlFromAddress(void * addr, ::rtl::OUString & libraryUrl) { diff --git a/include/osl/mutex.hxx b/include/osl/mutex.hxx index 4722cd6a3758..f42323b9fd0a 100644 --- a/include/osl/mutex.hxx +++ b/include/osl/mutex.hxx @@ -94,25 +94,12 @@ namespace osl constructed Mutex may work on an already destructed oslMutex object. */ - Mutex(const Mutex&); + Mutex(const Mutex&) SAL_DELETED_FUNCTION; - /** The underlying oslMutex has no reference count. - - When destructed, the Mutex object destroys the undelying oslMutex, - which might cause severe problems in case it's a temporary object. - - */ - Mutex(oslMutex Mutex); - - /** This assignment operator is private for the same reason as + /** This assignment operator is deleted for the same reason as the copy constructor. */ - Mutex& operator= (const Mutex&); - - /** This assignment operator is private for the same reason as - the constructor taking a oslMutex argument. - */ - Mutex& operator= (oslMutex); + Mutex& operator= (const Mutex&) SAL_DELETED_FUNCTION; }; /** A helper class for mutex objects and interfaces. @@ -121,8 +108,8 @@ namespace osl class Guard { private: - Guard( const Guard& ); - const Guard& operator = ( const Guard& ); + Guard( const Guard& ) SAL_DELETED_FUNCTION; + const Guard& operator = ( const Guard& ) SAL_DELETED_FUNCTION; protected: T * pT; @@ -155,8 +142,9 @@ namespace osl class ClearableGuard { private: - ClearableGuard( const ClearableGuard& ); - const ClearableGuard& operator = ( const ClearableGuard& ); + ClearableGuard( const ClearableGuard& ) SAL_DELETED_FUNCTION; + const ClearableGuard& operator = ( const ClearableGuard& ) + SAL_DELETED_FUNCTION; protected: T * pT; public: @@ -201,8 +189,8 @@ namespace osl class ResettableGuard : public ClearableGuard< T > { private: - ResettableGuard(ResettableGuard &); // not defined - void operator =(ResettableGuard &); // not defined + ResettableGuard(ResettableGuard &) SAL_DELETED_FUNCTION; + void operator =(ResettableGuard &) SAL_DELETED_FUNCTION; protected: T* pResetT; diff --git a/include/osl/thread.hxx b/include/osl/thread.hxx index 0c095a2055d9..8d9a82c2d9b5 100644 --- a/include/osl/thread.hxx +++ b/include/osl/thread.hxx @@ -46,8 +46,8 @@ extern "C" inline void SAL_CALL threadFunc( void* param); */ class Thread { - Thread( const Thread& ); - Thread& operator= ( const Thread& ); + Thread( const Thread& ) SAL_DELETED_FUNCTION; + Thread& operator= ( const Thread& ) SAL_DELETED_FUNCTION; public: // these are here to force memory de/allocation to sal lib. inline static void * SAL_CALL operator new( size_t nSize ) @@ -187,8 +187,8 @@ extern "C" inline void SAL_CALL threadFunc( void* param) class ThreadData { - ThreadData( const ThreadData& ); - ThreadData& operator= (const ThreadData& ); + ThreadData( const ThreadData& ) SAL_DELETED_FUNCTION; + ThreadData& operator= (const ThreadData& ) SAL_DELETED_FUNCTION; public: /// Create a thread specific local data key ThreadData( oslThreadKeyCallbackFunction pCallback= 0 ) diff --git a/include/rtl/bootstrap.hxx b/include/rtl/bootstrap.hxx index df9233b6000a..a190a87bd070 100644 --- a/include/rtl/bootstrap.hxx +++ b/include/rtl/bootstrap.hxx @@ -27,8 +27,8 @@ namespace rtl { void * _handle; - inline Bootstrap( Bootstrap const & ); // not impl - inline Bootstrap & operator = ( Bootstrap const & ); // not impl + Bootstrap( Bootstrap const & ) SAL_DELETED_FUNCTION; + Bootstrap & operator = ( Bootstrap const & ) SAL_DELETED_FUNCTION; public: /** diff --git a/include/rtl/uri.hxx b/include/rtl/uri.hxx index 1f52b3ad7248..84f9b012d152 100644 --- a/include/rtl/uri.hxx +++ b/include/rtl/uri.hxx @@ -65,17 +65,13 @@ public: rtl::OUString const & rBaseUriRef, rtl::OUString const & rRelUriRef); private: - /** not implemented */ - Uri(); + Uri() SAL_DELETED_FUNCTION; - /** not implemented */ - Uri(Uri &); + Uri(Uri &) SAL_DELETED_FUNCTION; - /** not implemented */ - ~Uri(); + ~Uri() SAL_DELETED_FUNCTION; - /** not implemented */ - void operator =(Uri); + void operator =(Uri) SAL_DELETED_FUNCTION; }; inline rtl::OUString Uri::encode(rtl::OUString const & rText, -- cgit