diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:14:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-11-10 10:31:25 +0100 |
commit | f19dda5a55156afda2c6dde6c51c455cc5657fc2 (patch) | |
tree | a0ec501f676cf5ec67aaf0eb3b8572dc1bad0db0 /extensions/source/plugin | |
parent | loplugin:nullptr (automatic rewrite) (diff) | |
download | core-f19dda5a55156afda2c6dde6c51c455cc5657fc2.tar.gz core-f19dda5a55156afda2c6dde6c51c455cc5657fc2.zip |
loplugin:nullptr (automatic rewrite)
Change-Id: I5bbef6c88255f3e8c740a5239a5010cf1251b7fa
Diffstat (limited to 'extensions/source/plugin')
-rw-r--r-- | extensions/source/plugin/base/context.cxx | 2 | ||||
-rw-r--r-- | extensions/source/plugin/base/manager.cxx | 8 | ||||
-rw-r--r-- | extensions/source/plugin/base/nfuncs.cxx | 12 | ||||
-rw-r--r-- | extensions/source/plugin/base/plctrl.cxx | 6 | ||||
-rw-r--r-- | extensions/source/plugin/base/service.cxx | 2 | ||||
-rw-r--r-- | extensions/source/plugin/base/xplugin.cxx | 38 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/impl.hxx | 2 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/unx/mediator.hxx | 4 | ||||
-rw-r--r-- | extensions/source/plugin/unx/mediator.cxx | 18 | ||||
-rw-r--r-- | extensions/source/plugin/unx/npnapi.cxx | 58 | ||||
-rw-r--r-- | extensions/source/plugin/unx/nppapi.cxx | 10 | ||||
-rw-r--r-- | extensions/source/plugin/unx/npwrap.cxx | 52 | ||||
-rw-r--r-- | extensions/source/plugin/unx/plugcon.cxx | 16 | ||||
-rw-r--r-- | extensions/source/plugin/unx/sysplug.cxx | 4 | ||||
-rw-r--r-- | extensions/source/plugin/unx/unxmgr.cxx | 4 |
15 files changed, 118 insertions, 118 deletions
diff --git a/extensions/source/plugin/base/context.cxx b/extensions/source/plugin/base/context.cxx index 02e6871261c0..478562aa7035 100644 --- a/extensions/source/plugin/base/context.cxx +++ b/extensions/source/plugin/base/context.cxx @@ -273,7 +273,7 @@ FileSink::FileSink( const Reference< css::uno::XComponentContext > & rxContext, m_xPlugin( plugin ), m_aTarget( target ) { - osl::FileBase::createTempFile( 0, 0, &m_aFileName ); + osl::FileBase::createTempFile( nullptr, nullptr, &m_aFileName ); OString aFile = OUStringToOString( m_aFileName, osl_getThreadTextEncoding() ); fp = fopen( aFile.getStr() , "wb" ); diff --git a/extensions/source/plugin/base/manager.cxx b/extensions/source/plugin/base/manager.cxx index 8b1d120733e7..0fa54e367c12 100644 --- a/extensions/source/plugin/base/manager.cxx +++ b/extensions/source/plugin/base/manager.cxx @@ -59,7 +59,7 @@ #include <cppuhelper/supportsservice.hxx> -PluginManager* PluginManager::pManager = NULL; +PluginManager* PluginManager::pManager = nullptr; PluginManager& PluginManager::get() { @@ -154,7 +154,7 @@ XPlugin_Impl* XPluginManager_Impl::getXPluginFromNPP( NPP instance ) return *iter; } - return NULL; + return nullptr; } XPlugin_Impl* XPluginManager_Impl::getPluginImplementation( const Reference< css::plugin::XPlugin >& plugin ) @@ -167,7 +167,7 @@ XPlugin_Impl* XPluginManager_Impl::getPluginImplementation( const Reference< css return *iter; } - return NULL; + return nullptr; } Sequence<css::plugin::PluginDescription> XPluginManager_Impl::getPluginDescriptions() @@ -226,7 +226,7 @@ Reference< css::plugin::XPlugin > XPluginManager_Impl::createPluginFromURL( con if( ! pImpl->getPluginComm() ) { pImpl->dispose(); - xRef = NULL; + xRef = nullptr; } return xRef; diff --git a/extensions/source/plugin/base/nfuncs.cxx b/extensions/source/plugin/base/nfuncs.cxx index 865fed5b88b8..21dbb45324dd 100644 --- a/extensions/source/plugin/base/nfuncs.cxx +++ b/extensions/source/plugin/base/nfuncs.cxx @@ -100,13 +100,13 @@ extern "C" { TRACE( "NPN_GetJavaEnv" ); // no java in this program - return NULL; + return nullptr; } jref SAL_CALL NP_LOADDS NPN_GetJavaPeer( NPP /*instance*/ ) { TRACE( "NPN_GetJavaPeer" ); - return NULL; + return nullptr; } } @@ -284,7 +284,7 @@ extern "C" { // stream will be fed back to plugin, // notify immediately after destruction of stream pImpl->addPluginEventListener( pListener ); - pListener = NULL; + pListener = nullptr; } pAsync->aUrl = OStringToOUString( aLoadURL, pImpl->getTextEncoding() ); pAsync->aTarget = OStringToOUString( target, pImpl->getTextEncoding() ); @@ -347,7 +347,7 @@ extern "C" { // stream will be fed back to plugin, // notify immediately after destruction of stream pImpl->addPluginEventListener( pListener ); - pListener = NULL; + pListener = nullptr; } try @@ -408,8 +408,8 @@ extern "C" { ::std::list<XPlugin_Impl*>& rList = PluginManager::get().getPlugins(); ::std::list<XPlugin_Impl*>::iterator iter; - XPlugin_Impl* pPlugin = NULL; - PluginStream* pStream = NULL; + XPlugin_Impl* pPlugin = nullptr; + PluginStream* pStream = nullptr; for( iter = rList.begin(); iter!= rList.end(); ++iter ) { pStream = (*iter)->getStreamFromNPStream( stream ); diff --git a/extensions/source/plugin/base/plctrl.cxx b/extensions/source/plugin/base/plctrl.cxx index 0ff4c8c77564..918715599d4f 100644 --- a/extensions/source/plugin/base/plctrl.cxx +++ b/extensions/source/plugin/base/plctrl.cxx @@ -39,7 +39,7 @@ #include <toolkit/helper/vclunohelper.hxx> PluginControl_Impl::PluginControl_Impl() - : _pMultiplexer( NULL ) + : _pMultiplexer( nullptr ) , _nX( 0 ) , _nY( 0 ) , _nWidth( 100 ) @@ -48,7 +48,7 @@ PluginControl_Impl::PluginControl_Impl() , _bVisible(false) , _bInDesignMode(false) , _bEnable(true) - , _pSysChild(NULL) + , _pSysChild(nullptr) { } @@ -146,7 +146,7 @@ void PluginControl_Impl::releasePeer() { _xParentWindow->removeFocusListener( this ); _xPeerWindow->dispose(); - _pSysChild = NULL; + _pSysChild = nullptr; _xPeerWindow.clear(); _xPeer.clear(); getMultiplexer()->setPeer( Reference< css::awt::XWindow > () ); diff --git a/extensions/source/plugin/base/service.cxx b/extensions/source/plugin/base/service.cxx index 40c4824b28f6..f40de1dc4aa5 100644 --- a/extensions/source/plugin/base/service.cxx +++ b/extensions/source/plugin/base/service.cxx @@ -60,7 +60,7 @@ extern "C" { void* /*pXUnoKey*/ ) { - void* pRet = 0; + void* pRet = nullptr; OUString aImplName( OUString::createFromAscii( pImplementationName ) ); diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index 133f072aa978..43d09edbf731 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -115,16 +115,16 @@ Any XPlugin_Impl::queryAggregation( const Type& type ) throw( RuntimeException, XPlugin_Impl::XPlugin_Impl( const uno::Reference< css::lang::XMultiServiceFactory > & rSMgr) : PluginControl_Impl(), m_xSMgr( rSMgr ), - m_pPluginComm( NULL ), + m_pPluginComm( nullptr ), m_pSysPlugData( CreateSysPlugData() ), m_aEncoding( osl_getThreadTextEncoding() ), - m_pArgv( NULL ), - m_pArgn( NULL ), + m_pArgv( nullptr ), + m_pArgn( nullptr ), m_nArgs( 0 ), m_aPluginMode( NP_FULL ), m_nProvidingState( PROVIDING_NONE ), m_nCalledFromPlugin( 0 ), - m_pDisposer( NULL ), + m_pDisposer( nullptr ), m_bIsDisposed( false ) { memset( &m_aInstance, 0, sizeof( m_aInstance ) ); @@ -142,14 +142,14 @@ void XPlugin_Impl::destroyInstance() { Guard< Mutex > aGuard( m_aMutex ); - NPSavedData* pSavedData = NULL; + NPSavedData* pSavedData = nullptr; destroyStreams(); if( getPluginComm() ) { getPluginComm()->NPP_Destroy( this, &pSavedData ); getPluginComm()->decRef(); - m_pPluginComm = NULL; + m_pPluginComm = nullptr; } freeArgs(); @@ -212,7 +212,7 @@ IMPL_LINK_NOARG_TYPED( XPlugin_Impl, secondLevelDispose, void*, void ) if (m_pDisposer) { m_pDisposer->release(); - m_pDisposer = NULL; + m_pDisposer = nullptr; } uno::Reference< XPlugin > xProtection( this ); @@ -222,7 +222,7 @@ IMPL_LINK_NOARG_TYPED( XPlugin_Impl, secondLevelDispose, void*, void ) Guard< Mutex > aPluginGuard( ::PluginManager::get().getPluginMutex() ); rList.remove( this ); } - m_aNPWindow.window = NULL; + m_aNPWindow.window = nullptr; #ifndef UNX // acrobat does an unconditional XtParent on the windows widget getPluginComm()->NPP_SetWindow( this ); @@ -533,7 +533,7 @@ void XPlugin_Impl::loadPlugin() pEnvData->mpNSView ); #elif defined UNX // need a new PluginComm - PluginComm* pComm = NULL; + PluginComm* pComm = nullptr; int sv[2]; if( !socketpair( AF_UNIX, SOCK_STREAM, 0, sv ) ) pComm = new UnxPluginComm( m_aDescription.Mimetype, @@ -565,9 +565,9 @@ void XPlugin_Impl::loadPlugin() &getNPPInstance(), m_aPluginMode == PluginMode::FULL ? NP_FULL : NP_EMBED, ::sal::static_int_cast< int16_t, int >( m_nArgs ), - const_cast<char**>(m_nArgs ? m_pArgn : NULL), - const_cast<char**>(m_nArgs ? m_pArgv : NULL), - NULL ); + const_cast<char**>(m_nArgs ? m_pArgn : nullptr), + const_cast<char**>(m_nArgs ? m_pArgv : nullptr), + nullptr ); #ifdef MACOSX // m_aNPWindow is set up in the MacPluginComm from the view SetSysPlugDataParentView(*pEnvData); @@ -579,9 +579,9 @@ void XPlugin_Impl::loadPlugin() } else { - m_aNPWindow.window = NULL; + m_aNPWindow.window = nullptr; } - m_aNPWindow.ws_info = NULL; + m_aNPWindow.ws_info = nullptr; #else m_aNPWindow.window = (void*)pEnvData->hWnd; #endif @@ -645,7 +645,7 @@ PluginStream* XPlugin_Impl::getStreamFromNPStream( NPStream* stream ) if( &(*iter2)->getStream() == stream ) return *iter2; - return NULL; + return nullptr; } sal_Bool XPlugin_Impl::provideNewStream(const OUString& mimetype, @@ -966,7 +966,7 @@ PluginInputStream::PluginInputStream( XPlugin_Impl* pPlugin, sal_uInt32 len, sal_uInt32 lastmod ) : PluginStream( pPlugin, url, len, lastmod ), - m_pContent( NULL ), + m_pContent( nullptr ), m_nMode( NP_NORMAL ), m_nWritePos( 0 ) { @@ -975,7 +975,7 @@ PluginInputStream::PluginInputStream( XPlugin_Impl* pPlugin, m_pPlugin->getInputStreams().push_back( this ); OUString aTmpFile; - osl::FileBase::createTempFile( 0, 0, &aTmpFile ); + osl::FileBase::createTempFile( nullptr, nullptr, &aTmpFile ); // set correct extension, some plugins need that OUString aName( m_aNPStream.url, strlen( m_aNPStream.url ), m_pPlugin->getTextEncoding() ); @@ -993,7 +993,7 @@ PluginInputStream::PluginInputStream( XPlugin_Impl* pPlugin, if( ! m_aFileStream.IsOpen() ) { // might be that the extension scrambled the whole filename - osl::FileBase::createTempFile( 0, 0, &aTmpFile ); + osl::FileBase::createTempFile( nullptr, nullptr, &aTmpFile ); m_aFileStream.Open( aTmpFile, StreamMode::READ | StreamMode::WRITE ); } } @@ -1083,7 +1083,7 @@ void PluginInputStream::setMode( sal_Int32 nMode ) if (m_nMode == -1) { m_pPlugin->getInputStreams().remove( this ); - m_pPlugin = NULL; + m_pPlugin = nullptr; m_wPlugin.clear(); } } diff --git a/extensions/source/plugin/inc/plugin/impl.hxx b/extensions/source/plugin/inc/plugin/impl.hxx index 6f919204a374..85d74184a05b 100644 --- a/extensions/source/plugin/inc/plugin/impl.hxx +++ b/extensions/source/plugin/inc/plugin/impl.hxx @@ -361,7 +361,7 @@ public: PluginInputStream( XPlugin_Impl* pPlugin, const char* url, sal_uInt32 len, sal_uInt32 lastmod ); - PluginInputStream() : PluginStream( NULL, NULL, 0, 0 ) {} + PluginInputStream() : PluginStream( nullptr, nullptr, 0, 0 ) {} virtual ~PluginInputStream(); diff --git a/extensions/source/plugin/inc/plugin/unx/mediator.hxx b/extensions/source/plugin/inc/plugin/unx/mediator.hxx index b44a918bc1ba..8c8dbcf94602 100644 --- a/extensions/source/plugin/inc/plugin/unx/mediator.hxx +++ b/extensions/source/plugin/inc/plugin/unx/mediator.hxx @@ -46,9 +46,9 @@ struct MediatorMessage char* m_pRun; MediatorMessage() : m_nID( 0 ), m_nBytes( 0 ), - m_pBytes( NULL ), m_pRun( NULL ) {} + m_pBytes( nullptr ), m_pRun( nullptr ) {} MediatorMessage( sal_uLong nID, sal_uLong nBytes, char* pBytes ) : - m_nID( nID ),m_nBytes( nBytes ), m_pRun( NULL ) + m_nID( nID ),m_nBytes( nBytes ), m_pRun( nullptr ) { m_pBytes = new char[ m_nBytes ]; memcpy( m_pBytes, pBytes, (size_t)m_nBytes ); diff --git a/extensions/source/plugin/unx/mediator.cxx b/extensions/source/plugin/unx/mediator.cxx index 4aecda071328..390c960a1d03 100644 --- a/extensions/source/plugin/unx/mediator.cxx +++ b/extensions/source/plugin/unx/mediator.cxx @@ -38,7 +38,7 @@ Mediator::Mediator( int nSocket ) : m_nSocket( nSocket ), - m_pListener( NULL ), + m_pListener( nullptr ), m_nCurrentID( 1 ), m_bValid( true ) { @@ -52,9 +52,9 @@ Mediator::~Mediator() { { ::osl::MutexGuard aGuard( m_pListener->m_aMutex ); - m_pListener->m_pMediator = NULL; + m_pListener->m_pMediator = nullptr; } - m_pListener = NULL; + m_pListener = nullptr; if( m_bValid ) { sal_uLong aHeader[3]; @@ -151,7 +151,7 @@ MediatorMessage* Mediator::WaitForAnswer( sal_uLong nMessageID ) } WaitForMessage( 10 ); } - return NULL; + return nullptr; } MediatorMessage* Mediator::GetNextMessage( bool bWait ) @@ -172,11 +172,11 @@ MediatorMessage* Mediator::GetNextMessage( bool bWait ) } } if( ! bWait ) - return NULL; + return nullptr; } WaitForMessage(); } - return NULL; + return nullptr; } MediatorMessage* Mediator::TransactMessage( sal_uLong nBytes, char* pBytes ) @@ -248,7 +248,7 @@ void MediatorListener::onTerminated() if( m_pMediator ) { m_pMediator->m_aConnectionLostHdl.Call( m_pMediator ); - m_pMediator->m_pListener = NULL; + m_pMediator->m_pListener = nullptr; } delete this; } @@ -278,7 +278,7 @@ void* MediatorMessage::GetBytes( sal_uLong& rBytes ) sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) - return NULL; + return nullptr; SAL_WARN_IF( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "extensions.plugin", @@ -301,7 +301,7 @@ char* MediatorMessage::GetString() sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) - return NULL; + return nullptr; SAL_WARN_IF( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "extensions.plugin", diff --git a/extensions/source/plugin/unx/npnapi.cxx b/extensions/source/plugin/unx/npnapi.cxx index 5330c823bb04..3a7eca7b04a5 100644 --- a/extensions/source/plugin/unx/npnapi.cxx +++ b/extensions/source/plugin/unx/npnapi.cxx @@ -200,7 +200,7 @@ static NPError l_NPN_NewStream( NPP instance, NPMIMEType type, const char* targe pStream->url = pMes->GetString(); pStream->end = pMes->GetUINT32(); pStream->lastmodified = pMes->GetUINT32(); - pStream->ndata = pStream->pdata = pStream->notifyData = NULL; + pStream->ndata = pStream->pdata = pStream->notifyData = nullptr; pConnector->getStreamList().push_back( pStream ); *stream = pStream; @@ -314,7 +314,7 @@ static void l_NPN_Status( NPP instance, const char* message ) static const char* l_NPN_UserAgent( NPP instance ) { - static char* pAgent = NULL; + static char* pAgent = nullptr; sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) @@ -470,8 +470,8 @@ static NPNetscapeFuncs aNetscapeFuncs = l_NPN_GetJavaEnv, l_NPN_GetJavaPeer, # else - NULL, - NULL, + nullptr, + nullptr, # endif l_NPN_GetURLNotify, l_NPN_PostURLNotify, @@ -486,27 +486,27 @@ static NPPluginFuncs aPluginFuncs = { sizeof(aPluginFuncs), (NP_VERSION_MAJOR << 8) | NP_VERSION_MINOR, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr }; -oslModule pPluginLib = NULL; -char*(*pNPP_GetMIMEDescription)() = NULL; -NPError (*pNP_Initialize)(NPNetscapeFuncs*,NPPluginFuncs*) = NULL; -NPError (*pNP_Shutdown)() = NULL; +oslModule pPluginLib = nullptr; +char*(*pNPP_GetMIMEDescription)() = nullptr; +NPError (*pNP_Initialize)(NPNetscapeFuncs*,NPPluginFuncs*) = nullptr; +NPError (*pNP_Shutdown)() = nullptr; std::vector< PluginConnector* > PluginConnector::allConnectors; @@ -560,7 +560,7 @@ IMPL_LINK_NOARG_TYPED( PluginConnector, WorkOnNewMessageHdl, void*, void ) if( pInst->pShell ) XtDestroyWidget( static_cast<Widget>(pInst->pShell) ); - pInst->pWidget = pInst->pShell = NULL; + pInst->pWidget = pInst->pShell = nullptr; // the other side will call eNPP_DestroyPhase2 after this NPError aReason = NPERR_NO_ERROR; @@ -573,7 +573,7 @@ IMPL_LINK_NOARG_TYPED( PluginConnector, WorkOnNewMessageHdl, void*, void ) sal_uInt32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; NPP instance = pInst->instance; - NPSavedData* pSave = NULL; + NPSavedData* pSave = nullptr; NPError aRet = aPluginFuncs.destroy( instance, &pSave ); if( pSave ) @@ -614,7 +614,7 @@ IMPL_LINK_NOARG_TYPED( PluginConnector, WorkOnNewMessageHdl, void*, void ) pStream->url = pMessage->GetString(); pStream->end = pMessage->GetUINT32(); pStream->lastmodified = pMessage->GetUINT32(); - pStream->pdata = pStream->ndata = pStream->notifyData = NULL; + pStream->pdata = pStream->ndata = pStream->notifyData = nullptr; NPBool* pSeekable = static_cast<NPBool*>(pMessage->GetBytes()); m_aNPWrapStreams.push_back( pStream ); uint16_t nStype = NP_ASFILE; @@ -645,7 +645,7 @@ IMPL_LINK_NOARG_TYPED( PluginConnector, WorkOnNewMessageHdl, void*, void ) uint16_t* pMode = static_cast<uint16_t*>(pMessage->GetBytes()); int16_t* pArgc = static_cast<int16_t*>(pMessage->GetBytes()); NPP instance = new NPP_t; - instance->pdata = instance->ndata = NULL; + instance->pdata = instance->ndata = nullptr; sal_uLong nArgnBytes, nArgvBytes; char* pArgn = static_cast<char*>(pMessage->GetBytes( nArgnBytes )); char* pArgv = static_cast<char*>(pMessage->GetBytes( nArgvBytes )); @@ -660,10 +660,10 @@ IMPL_LINK_NOARG_TYPED( PluginConnector, WorkOnNewMessageHdl, void*, void ) m_aInstances.push_back( pInst ); NPError aRet; aRet = aPluginFuncs.newp( pInst->pMimeType, instance, *pMode, *pArgc, - pInst->nArg ? pInst->argn : NULL, - pInst->nArg ? pInst->argv : NULL, + pInst->nArg ? pInst->argn : nullptr, + pInst->nArg ? pInst->argv : nullptr, ( nSaveBytes == 4 && *reinterpret_cast<sal_uInt32*>(pSavedData) == 0 ) ? - &(pInst->aData) : NULL ); + &(pInst->aData) : nullptr ); SAL_INFO( "extensions.plugin", "pluginapp: NPP_New( " << pInst->pMimeType << ", " diff --git a/extensions/source/plugin/unx/nppapi.cxx b/extensions/source/plugin/unx/nppapi.cxx index 3d166043a752..eb073e383f51 100644 --- a/extensions/source/plugin/unx/nppapi.cxx +++ b/extensions/source/plugin/unx/nppapi.cxx @@ -171,7 +171,7 @@ IMPL_LINK_NOARG_TYPED( PluginConnector, WorkOnNewMessageHdl, void*, void ) NPMIMEType pType = pMessage->GetString(); char* pTarget = pMessage->GetString(); - NPStream* pStream = NULL; + NPStream* pStream = nullptr; NPError aRet = NPN_NewStream( instance, pType, pTarget, &pStream ); @@ -253,7 +253,7 @@ IMPL_LINK_NOARG_TYPED( PluginConnector, WorkOnNewMessageHdl, void*, void ) { pRun->offset = pArray[ 2*n ]; pRun->length = pArray[ 2*n+1 ]; - pRun->next = n < nRanges-1 ? new NPByteRange : NULL; + pRun->next = n < nRanges-1 ? new NPByteRange : nullptr; pRun = pRun->next; } NPError aRet = NPN_RequestRead( pStream, pFirst ); @@ -358,7 +358,7 @@ NPError UnxPluginComm::NPP_Destroy( NPP instance, NPSavedData** save ) sal_uLong nSaveBytes; void* pSaveData = pMes->GetBytes( nSaveBytes ); if( nSaveBytes == 4 && *static_cast<sal_uInt32*>(pSaveData) == 0 ) - *save = NULL; + *save = nullptr; else { *save = new NPSavedData; @@ -411,8 +411,8 @@ NPError UnxPluginComm::NPP_New( NPMIMEType pluginType, NPP instance, uint16_t mo { m_aInstances.push_back( new ConnectorInstance( instance, pluginType, 0, - NULL, 0, NULL, 0, - saved ? static_cast<char*>(saved->buf) : NULL, + nullptr, 0, nullptr, 0, + saved ? static_cast<char*>(saved->buf) : nullptr, saved ? saved->len : 0 ) ); char *pArgnBuf, *pArgvBuf; diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx index 12da5ad6c313..c0a0649f5665 100644 --- a/extensions/source/plugin/unx/npwrap.cxx +++ b/extensions/source/plugin/unx/npwrap.cxx @@ -48,18 +48,18 @@ #include <npwrap.hxx> -PluginConnector* pConnector = NULL; +PluginConnector* pConnector = nullptr; int nAppArguments = 0; -char** pAppArguments = NULL; -Display* pAppDisplay = NULL; -Display* pXtAppDisplay = NULL; +char** pAppArguments = nullptr; +Display* pAppDisplay = nullptr; +Display* pXtAppDisplay = nullptr; extern oslModule pPluginLib; extern NPError (*pNP_Shutdown)(); XtAppContext app_context; -Widget topLevel = NULL, topBox = NULL; +Widget topLevel = nullptr, topBox = nullptr; int wakeup_fd[2] = { 0, 0 }; static bool bPluginAppQuit = false; @@ -187,7 +187,7 @@ static oslModule LoadModule( const char* pPath ) static void CheckPlugin( const char* pPath ) { oslModule pLib = LoadModule( pPath ); - if (pLib != 0) { + if (pLib != nullptr) { char*(*pNP_GetMIMEDescription)() = reinterpret_cast<char*(*)()>( osl_getAsciiFunctionSymbol( pLib, "NP_GetMIMEDescription" )); if( pNP_GetMIMEDescription ) @@ -219,7 +219,7 @@ extern "C" { if( pConnector ) { // ensure that a read on the other side will wakeup delete pConnector; - pConnector = NULL; + pConnector = nullptr; } _exit(nSig); @@ -255,9 +255,9 @@ extern "C" { prepareXtEvent, checkXtEvent, dispatchXtEvent, - NULL, + nullptr, noClosure, - NULL + nullptr }; static gboolean pollXtTimerCallback(gpointer) @@ -298,7 +298,7 @@ extern "C" { bPluginAppQuit = true; delete pConnector; - pConnector = NULL; + pConnector = nullptr; } return sal_True; @@ -308,9 +308,9 @@ extern "C" { prepareWakeupEvent, checkWakeupEvent, dispatchWakeupEvent, - NULL, + nullptr, noClosure, - NULL + nullptr }; #endif // GTK @@ -325,11 +325,11 @@ int main( int argc, char **argv) aSigAction.sa_handler = signal_handler; sigemptyset( &aSigAction.sa_mask ); aSigAction.sa_flags = SA_NOCLDSTOP; - sigaction( SIGSEGV, &aSigAction, NULL ); - sigaction( SIGBUS, &aSigAction, NULL ); - sigaction( SIGABRT, &aSigAction, NULL ); - sigaction( SIGTERM, &aSigAction, NULL ); - sigaction( SIGILL, &aSigAction, NULL ); + sigaction( SIGSEGV, &aSigAction, nullptr ); + sigaction( SIGBUS, &aSigAction, nullptr ); + sigaction( SIGABRT, &aSigAction, nullptr ); + sigaction( SIGTERM, &aSigAction, nullptr ); + sigaction( SIGILL, &aSigAction, nullptr ); int nArg = (argc < 3) ? 1 : 2; char* pBaseName = argv[nArg] + strlen(argv[nArg]); @@ -380,18 +380,18 @@ int main( int argc, char **argv) int nSocket = atol( argv[1] ); #if ENABLE_GTK - g_thread_init(NULL); + g_thread_init(nullptr); gtk_init(&argc, &argv); #endif pConnector = new PluginConnector( nSocket ); - pConnector->SetConnectionLostHdl( Link<Mediator*,void>( NULL, GlobalConnectionLostHdl ) ); + pConnector->SetConnectionLostHdl( Link<Mediator*,void>( nullptr, GlobalConnectionLostHdl ) ); - XtSetLanguageProc( NULL, NULL, NULL ); + XtSetLanguageProc( nullptr, nullptr, nullptr ); XtToolkitInitialize(); app_context = XtCreateApplicationContext(); - pXtAppDisplay = XtOpenDisplay( app_context, NULL, "SOPlugin", "SOPlugin", NULL, 0, &argc, argv ); + pXtAppDisplay = XtOpenDisplay( app_context, nullptr, "SOPlugin", "SOPlugin", nullptr, 0, &argc, argv ); #if ENABLE_GTK @@ -406,21 +406,21 @@ int main( int argc, char **argv) g_source_set_priority( pXTSource, GDK_PRIORITY_EVENTS ); g_source_set_can_recurse( pXTSource, sal_True ); - g_source_attach( pXTSource, NULL ); + g_source_attach( pXTSource, nullptr ); aXtPollDesc.fd = ConnectionNumber( pXtAppDisplay ); aXtPollDesc.events = G_IO_IN; aXtPollDesc.revents = 0; g_source_add_poll( pXTSource, &aXtPollDesc ); - gint xt_polling_timer_id = g_timeout_add( 25, pollXtTimerCallback, NULL); + gint xt_polling_timer_id = g_timeout_add( 25, pollXtTimerCallback, nullptr); // Initialize wakeup events listener GSource *pWakeupSource = g_source_new( &aWakeupEventFuncs, sizeof(GSource) ); - if ( pWakeupSource == NULL ) { + if ( pWakeupSource == nullptr ) { SAL_WARN("extensions.plugin", "could not get wakeup source"); return 1; } g_source_set_priority( pWakeupSource, GDK_PRIORITY_EVENTS); - g_source_attach( pWakeupSource, NULL ); + g_source_attach( pWakeupSource, nullptr ); aWakeupPollDesc.fd = wakeup_fd[0]; aWakeupPollDesc.events = G_IO_IN; aWakeupPollDesc.revents = 0; @@ -463,7 +463,7 @@ int main( int argc, char **argv) // of XtAppMainLoop do { #if ENABLE_GTK - g_main_context_iteration( NULL, sal_True ); + g_main_context_iteration( nullptr, sal_True ); #else XtAppProcessEvent( app_context, XtIMAll ); #endif diff --git a/extensions/source/plugin/unx/plugcon.cxx b/extensions/source/plugin/unx/plugcon.cxx index fe0bd5d12511..65c9e610d1bf 100644 --- a/extensions/source/plugin/unx/plugcon.cxx +++ b/extensions/source/plugin/unx/plugcon.cxx @@ -164,7 +164,7 @@ void PluginConnector::Respond( sal_uLong nID, MediatorMessage* PluginConnector::WaitForAnswer( sal_uLong nMessageID ) { if( ! m_bValid ) - return NULL; + return nullptr; nMessageID &= 0x00ffffff; while( m_pListener ) @@ -187,7 +187,7 @@ MediatorMessage* PluginConnector::WaitForAnswer( sal_uLong nMessageID ) CallWorkHandler(); WaitForMessage( 2000 ); } - return NULL; + return nullptr; } ConnectorInstance::ConnectorInstance( NPP inst, char* type, @@ -195,11 +195,11 @@ ConnectorInstance::ConnectorInstance( NPP inst, char* type, char* pargvbuf, sal_uLong nargvbytes, char* savedata, sal_uLong savebytes ) : instance( inst ), - pShell( NULL ), - pWidget( NULL ), - pForm( NULL ), - pGtkWindow( NULL ), - pGtkWidget( NULL ), + pShell( nullptr ), + pWidget( nullptr ), + pForm( nullptr ), + pGtkWindow( nullptr ), + pGtkWidget( nullptr ), bShouldUseXEmbed( false ), nArg( args ), pArgnBuf( pargnbuf ), @@ -276,7 +276,7 @@ const char* GetCommandName( CommandAtoms eCommand ) case eMaxCommand: return "eMaxCommand"; default: return "unknown command"; } - return NULL; + return nullptr; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/plugin/unx/sysplug.cxx b/extensions/source/plugin/unx/sysplug.cxx index acb08a37138e..b7a1d8162f6a 100644 --- a/extensions/source/plugin/unx/sysplug.cxx +++ b/extensions/source/plugin/unx/sysplug.cxx @@ -79,7 +79,7 @@ UnxPluginComm::UnxPluginComm( pArgs[1] = pDesc; pArgs[2] = aLib.getStr(); pArgs[3] = pWindow; - pArgs[4] = NULL; + pArgs[4] = nullptr; SAL_INFO( "extensions.plugin", @@ -137,7 +137,7 @@ UnxPluginComm::~UnxPluginComm() } bool UnxPluginComm::getPluginappPath(OString * path) { - OSL_ASSERT(path != NULL); + OSL_ASSERT(path != nullptr); OUString p("$BRAND_BASE_DIR/" LIBO_LIBEXEC_FOLDER "/pluginapp.bin"); rtl::Bootstrap::expandMacros(p); return diff --git a/extensions/source/plugin/unx/unxmgr.cxx b/extensions/source/plugin/unx/unxmgr.cxx index 0433aea921fe..811376841e1f 100644 --- a/extensions/source/plugin/unx/unxmgr.cxx +++ b/extensions/source/plugin/unx/unxmgr.cxx @@ -210,7 +210,7 @@ static void CheckPluginRegistryFiles( const OString& rPath, list< PluginDescript // check subdirectories DIR* pDIR = opendir( rPath.getStr() ); - struct dirent* pDirEnt = NULL; + struct dirent* pDirEnt = nullptr; struct stat aStat; maxDirent u; while( pDIR && ! readdir_r( pDIR, &u.asDirent, &pDirEnt ) && pDirEnt ) @@ -274,7 +274,7 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th if (!aPath.isEmpty()) { DIR* pDIR = opendir(aPath.getStr()); - struct dirent* pDirEnt = NULL; + struct dirent* pDirEnt = nullptr; while( pDIR && ! readdir_r( pDIR, &u.asDirent, &pDirEnt ) && pDirEnt ) { char* pBaseName = u.asDirent.d_name; |