From 26f05d59bc1c25b8a0d19be7f4738fd12e557001 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Tue, 10 Nov 2015 10:21:55 +0100 Subject: loplugin:nullptr (automatic rewrite) Change-Id: I1bc6c87fcd6e5e96362623be94c59be216a3b2b8 --- include/osl/conditn.hxx | 2 +- include/osl/diagnose.hxx | 2 +- include/osl/file.hxx | 10 +++++----- include/osl/module.hxx | 8 ++++---- include/osl/pipe.hxx | 10 +++++----- include/osl/security.hxx | 2 +- include/osl/socket.hxx | 16 ++++++++-------- include/osl/socket_decl.hxx | 16 ++++++++-------- include/osl/thread.hxx | 14 +++++++------- 9 files changed, 40 insertions(+), 40 deletions(-) (limited to 'include/osl') diff --git a/include/osl/conditn.hxx b/include/osl/conditn.hxx index 8bb37e307f2d..d728d1e78c73 100644 --- a/include/osl/conditn.hxx +++ b/include/osl/conditn.hxx @@ -75,7 +75,7 @@ namespace osl /** Blocks the calling thread until condition is set. */ - Result wait(const TimeValue *pTimeout = 0) + Result wait(const TimeValue *pTimeout = NULL) { return (Result) osl_waitCondition(condition, pTimeout); } diff --git a/include/osl/diagnose.hxx b/include/osl/diagnose.hxx index 577b07c91d83..deccf8bcb7be 100644 --- a/include/osl/diagnose.hxx +++ b/include/osl/diagnose.hxx @@ -121,7 +121,7 @@ public: VoidPointerSet::const_iterator iPos(m_data.m_addresses.begin()); VoidPointerSet::const_iterator const iEnd(m_data.m_addresses.end()); for ( ; iPos != iEnd; ++iPos ) { - SAL_WARN_IF( *iPos == 0, "sal.debug", "null pointer" ); + SAL_WARN_IF( *iPos == NULL, "sal.debug", "null pointer" ); } } return bRet; diff --git a/include/osl/file.hxx b/include/osl/file.hxx index 19489484cb3b..1e75a57b8c1f 100644 --- a/include/osl/file.hxx +++ b/include/osl/file.hxx @@ -313,8 +313,8 @@ public: oslFileHandle* pHandle, ::rtl::OUString* pustrTempFileURL) { - rtl_uString* pustr_dir_url = pustrDirectoryURL ? pustrDirectoryURL->pData : 0; - rtl_uString** ppustr_tmp_file_url = pustrTempFileURL ? &pustrTempFileURL->pData : 0; + rtl_uString* pustr_dir_url = pustrDirectoryURL ? pustrDirectoryURL->pData : NULL; + rtl_uString** ppustr_tmp_file_url = pustrTempFileURL ? &pustrTempFileURL->pData : NULL; return static_cast< RC >( osl_createTempFile(pustr_dir_url, pHandle, ppustr_tmp_file_url) ); } @@ -926,7 +926,7 @@ public: The full qualified URL of the file. Relative paths are not allowed. */ - File( const ::rtl::OUString& ustrFileURL ): _pData( 0 ), _aPath( ustrFileURL ) {} + File( const ::rtl::OUString& ustrFileURL ): _pData( NULL ), _aPath( ustrFileURL ) {} /** Destructor */ @@ -1670,7 +1670,7 @@ public: Relative URLs are not allowed. */ - Directory( const ::rtl::OUString& strPath ): _pData( 0 ), _aPath( strPath ) + Directory( const ::rtl::OUString& strPath ): _pData( NULL ), _aPath( strPath ) { } @@ -1804,7 +1804,7 @@ public: if( rItem._pData ) { osl_releaseDirectoryItem( rItem._pData ); - rItem._pData = 0; + rItem._pData = NULL; } return ( RC) osl_getNextDirectoryItem( _pData, &rItem._pData, nHint ); } diff --git a/include/osl/module.hxx b/include/osl/module.hxx index 7858ad0695e5..db8e24ec485f 100644 --- a/include/osl/module.hxx +++ b/include/osl/module.hxx @@ -61,11 +61,11 @@ public: return osl_getModuleURLFromFunctionAddress( addr, &libraryUrl.pData ); } - Module(): m_Module(0){} + Module(): m_Module(NULL){} #ifndef DISABLE_DYNLOADING - Module( const ::rtl::OUString& strModuleName, sal_Int32 nRtldMode = SAL_LOADMODULE_DEFAULT) : m_Module(0) + Module( const ::rtl::OUString& strModuleName, sal_Int32 nRtldMode = SAL_LOADMODULE_DEFAULT) : m_Module(NULL) { load( strModuleName, nRtldMode); } @@ -114,7 +114,7 @@ public: if (m_Module) { osl_unloadModule(m_Module); - m_Module = 0; + m_Module = NULL; } } @@ -170,7 +170,7 @@ public: @since LibreOffice 4.3 */ - void release() { m_Module = 0; } + void release() { m_Module = NULL; } private: oslModule m_Module; diff --git a/include/osl/pipe.hxx b/include/osl/pipe.hxx index b4a8bc955eb3..b1cc1e6b5f40 100644 --- a/include/osl/pipe.hxx +++ b/include/osl/pipe.hxx @@ -25,12 +25,12 @@ namespace osl { inline Pipe::Pipe() - : m_handle( 0 ) + : m_handle( NULL ) {} inline Pipe::Pipe(const ::rtl::OUString& strName, oslPipeOptions Options ) - : m_handle( osl_createPipe( strName.pData, Options , 0 ) ) + : m_handle( osl_createPipe( strName.pData, Options , NULL ) ) {} @@ -101,7 +101,7 @@ namespace osl inline bool SAL_CALL Pipe::is() const { - return m_handle != 0; + return m_handle != NULL; } @@ -122,7 +122,7 @@ namespace osl if( m_handle ) { osl_releasePipe( m_handle ); - m_handle = 0; + m_handle = NULL; } } @@ -139,7 +139,7 @@ namespace osl inline oslPipeError SAL_CALL Pipe::getError() const { - return osl_getLastPipeError( 0 ); + return osl_getLastPipeError( NULL ); } diff --git a/include/osl/security.hxx b/include/osl/security.hxx index 6f7b24819c5d..4d94ee10e308 100644 --- a/include/osl/security.hxx +++ b/include/osl/security.hxx @@ -41,7 +41,7 @@ inline bool Security::logonUser(const rtl::OUString& strName, { osl_freeSecurityHandle(m_handle); - m_handle = 0; + m_handle = NULL; return (osl_loginUser( strName.pData, strPasswd.pData, &m_handle) == osl_Security_E_None); diff --git a/include/osl/socket.hxx b/include/osl/socket.hxx index 4d41bed3c20c..380ef3f840c3 100644 --- a/include/osl/socket.hxx +++ b/include/osl/socket.hxx @@ -62,7 +62,7 @@ namespace osl else { osl_destroySocketAddr( m_handle ); - m_handle = 0; + m_handle = NULL; } } } @@ -157,7 +157,7 @@ namespace osl inline bool SocketAddr::is() const { - return m_handle != 0; + return m_handle != NULL; } // (static method)______________________________________________________________ @@ -265,7 +265,7 @@ namespace osl inline sal_Int32 Socket::getLocalPort() const { - SocketAddr addr( 0 ); + SocketAddr addr( NULL ); getLocalAddr( addr ); return addr.getPort(); } @@ -273,7 +273,7 @@ namespace osl inline ::rtl::OUString Socket::getLocalHost() const { - SocketAddr addr( 0 ); + SocketAddr addr( NULL ); getLocalAddr( addr ); return addr.getHostname(); } @@ -287,7 +287,7 @@ namespace osl inline sal_Int32 Socket::getPeerPort() const { - SocketAddr addr( 0 ); + SocketAddr addr( NULL ); getPeerAddr( addr ); return addr.getPort(); } @@ -295,7 +295,7 @@ namespace osl inline ::rtl::OUString Socket::getPeerHost() const { - SocketAddr addr( 0 ); + SocketAddr addr( NULL ); getPeerAddr( addr ); return addr.getHostname(); } @@ -483,7 +483,7 @@ namespace osl inline oslSocketResult AcceptorSocket::acceptConnection( StreamSocket& Connection) { - oslSocket o = osl_acceptConnectionOnSocket( m_handle, 0 ); + oslSocket o = osl_acceptConnectionOnSocket( m_handle, NULL ); oslSocketResult status = osl_Socket_Ok; if( o ) { @@ -541,7 +541,7 @@ namespace osl } else { - nByteRead = osl_receiveFromSocket( m_handle, 0 , pBuffer , BufferSize , Flag ); + nByteRead = osl_receiveFromSocket( m_handle, NULL , pBuffer , BufferSize , Flag ); } return nByteRead; } diff --git a/include/osl/socket_decl.hxx b/include/osl/socket_decl.hxx index 2d06f3fea37f..7f2a18f6390d 100644 --- a/include/osl/socket_decl.hxx +++ b/include/osl/socket_decl.hxx @@ -82,7 +82,7 @@ namespace osl @return the hostname of this SocketAddr or an empty string on failure. @see osl_getHostnameOfSocketAddr() */ - inline ::rtl::OUString SAL_CALL getHostname( oslSocketResult *pResult = 0 ) const; + inline ::rtl::OUString SAL_CALL getHostname( oslSocketResult *pResult = NULL ) const; /** Sets the ipaddress or hostname of the SocketAddress */ @@ -105,7 +105,7 @@ namespace osl /** Returns the address of the underlying socket in network byte order */ - inline ::rtl::ByteSequence SAL_CALL getAddr( oslSocketResult *pResult = 0 ) const; + inline ::rtl::ByteSequence SAL_CALL getAddr( oslSocketResult *pResult = NULL ) const; /** assign the handle to this reference. The previous handle is released. */ @@ -138,7 +138,7 @@ namespace osl an error on failure. @return the hostname */ - static inline ::rtl::OUString SAL_CALL getLocalHostname( oslSocketResult *pResult = 0); + static inline ::rtl::OUString SAL_CALL getLocalHostname( oslSocketResult *pResult = NULL); /** Tries to find an address for a host. @see osl_resolveHostname() @@ -273,7 +273,7 @@ namespace osl @param pTimeout if 0, the operation will block without a timeout. Otherwise the specified amout of time. */ - inline bool SAL_CALL isRecvReady(const TimeValue *pTimeout = 0) const; + inline bool SAL_CALL isRecvReady(const TimeValue *pTimeout = NULL) const; /** Checks if send operations will block. @@ -285,7 +285,7 @@ namespace osl @param pTimeout if 0, the operation will block without a timeout. Otherwise the specified amout of time. */ - inline bool SAL_CALL isSendReady(const TimeValue *pTimeout = 0) const; + inline bool SAL_CALL isSendReady(const TimeValue *pTimeout = NULL) const; /** Checks if a request for out-of-band data will block. @@ -300,7 +300,7 @@ namespace osl @param pTimeout if 0, the operation will block without a timeout. Otherwise the specified amout of time. */ - inline bool SAL_CALL isExceptionPending(const TimeValue *pTimeout = 0) const; + inline bool SAL_CALL isExceptionPending(const TimeValue *pTimeout = NULL) const; /** Queries the socket for its type. @@ -604,7 +604,7 @@ namespace osl osl_Socket_Interrupted if unblocked forcefully (by osl::Socket::close()), osl_Socket_Error if connect failed. */ - oslSocketResult SAL_CALL connect(const SocketAddr& TargetHost, const TimeValue* pTimeout = 0); + oslSocketResult SAL_CALL connect(const SocketAddr& TargetHost, const TimeValue* pTimeout = NULL); }; /** Allows to accept socket connections. @@ -684,7 +684,7 @@ namespace osl */ inline sal_Int32 SAL_CALL recvFrom(void* pBuffer, sal_uInt32 BufferSize, - SocketAddr* pSenderAddr= 0, + SocketAddr* pSenderAddr= NULL, oslSocketMsgFlag Flag= osl_Socket_MsgNormal); /** Tries to send one datagram with BytesToSend size to the given ReceiverAddr. diff --git a/include/osl/thread.hxx b/include/osl/thread.hxx index 4e5c335f28b3..0da8c847abd5 100644 --- a/include/osl/thread.hxx +++ b/include/osl/thread.hxx @@ -59,7 +59,7 @@ public: inline static void SAL_CALL operator delete( void *, void * ) {} - Thread(): m_hThread(0){} + Thread(): m_hThread(NULL){} virtual ~Thread() { @@ -68,9 +68,9 @@ public: bool SAL_CALL create() { - assert(m_hThread == 0); // only one running thread per instance + assert(m_hThread == NULL); // only one running thread per instance m_hThread = osl_createSuspendedThread( threadFunc, static_cast(this)); - if (m_hThread == 0) + if (m_hThread == NULL) { return false; } @@ -80,12 +80,12 @@ public: bool SAL_CALL createSuspended() { - assert(m_hThread == 0); // only one running thread per instance + assert(m_hThread == NULL); // only one running thread per instance if( m_hThread) return false; m_hThread= osl_createSuspendedThread( threadFunc, static_cast(this)); - return m_hThread != 0; + return m_hThread != NULL; } virtual void SAL_CALL suspend() @@ -134,7 +134,7 @@ public: static oslThreadIdentifier SAL_CALL getCurrentIdentifier() { - return osl_getThreadIdentifier(0); + return osl_getThreadIdentifier(NULL); } static void SAL_CALL wait(const TimeValue& Delay) @@ -191,7 +191,7 @@ class ThreadData ThreadData& operator= (const ThreadData& ) SAL_DELETED_FUNCTION; public: /// Create a thread specific local data key - ThreadData( oslThreadKeyCallbackFunction pCallback= 0 ) + ThreadData( oslThreadKeyCallbackFunction pCallback= NULL ) { m_hKey = osl_createThreadKey( pCallback ); } -- cgit