diff options
Diffstat (limited to 'extensions/source/plugin')
-rw-r--r-- | extensions/source/plugin/aqua/macmgr.cxx | 4 | ||||
-rw-r--r-- | extensions/source/plugin/aqua/sysplug.cxx | 12 | ||||
-rw-r--r-- | extensions/source/plugin/base/manager.cxx | 6 | ||||
-rw-r--r-- | extensions/source/plugin/base/xplugin.cxx | 8 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/aqua/sysplug.hxx | 2 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/impl.hxx | 6 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/unx/mediator.hxx | 30 | ||||
-rw-r--r-- | extensions/source/plugin/inc/plugin/unx/plugcon.hxx | 28 | ||||
-rw-r--r-- | extensions/source/plugin/unx/mediator.cxx | 70 | ||||
-rw-r--r-- | extensions/source/plugin/unx/npnapi.cxx | 74 | ||||
-rw-r--r-- | extensions/source/plugin/unx/nppapi.cxx | 68 | ||||
-rw-r--r-- | extensions/source/plugin/unx/npwrap.cxx | 12 | ||||
-rw-r--r-- | extensions/source/plugin/unx/plugcon.cxx | 66 | ||||
-rw-r--r-- | extensions/source/plugin/unx/sysplug.cxx | 2 | ||||
-rw-r--r-- | extensions/source/plugin/unx/unxmgr.cxx | 4 |
15 files changed, 196 insertions, 196 deletions
diff --git a/extensions/source/plugin/aqua/macmgr.cxx b/extensions/source/plugin/aqua/macmgr.cxx index b66963e420fb..e0bfe3ad5c01 100644 --- a/extensions/source/plugin/aqua/macmgr.cxx +++ b/extensions/source/plugin/aqua/macmgr.cxx @@ -580,7 +580,7 @@ static rtl::OUString FindFolderURL( FSVolumeRefNum vRefNum, OSType folderType ) Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw() { static Sequence<PluginDescription> aDescriptions; - static BOOL bHavePlugins = FALSE; + static sal_Bool bHavePlugins = sal_False; if( ! bHavePlugins ) { std::list<PluginDescription*> aPlugins; @@ -639,7 +639,7 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th delete *iter; } aPlugins.clear(); - bHavePlugins = TRUE; + bHavePlugins = sal_True; } return aDescriptions; } diff --git a/extensions/source/plugin/aqua/sysplug.cxx b/extensions/source/plugin/aqua/sysplug.cxx index 81637eb2d564..206204fa10a7 100644 --- a/extensions/source/plugin/aqua/sysplug.cxx +++ b/extensions/source/plugin/aqua/sysplug.cxx @@ -67,8 +67,8 @@ struct FakeEventRecord : public EventRecord } -(id)initWithInstance: (XPlugin_Impl*)i_pImpl pluginComm: (MacPluginComm*)i_pCom frame: (NSRect)i_aRect; -(void)drawRect: (NSRect)i_aRect; --(MacOSBOOL)isOpaque; --(MacOSBOOL)isFlipped; +-(BOOL)isOpaque; +-(BOOL)isFlipped; // NSResponder -(void)mouseMoved: (NSEvent*)i_pEvent; @@ -101,12 +101,12 @@ struct FakeEventRecord : public EventRecord m_pCom->drawView( m_pImpl ); } --(MacOSBOOL)isOpaque +-(BOOL)isOpaque { return NO; } --(MacOSBOOL)isFlipped +-(BOOL)isFlipped { return YES; } @@ -270,10 +270,10 @@ MacPluginComm::~MacPluginComm() } //-------------------------------------------------------------------------------------------------- -BOOL MacPluginComm::retrieveFunction( const char* i_pName, void** o_ppFunc ) const +sal_Bool MacPluginComm::retrieveFunction( const char* i_pName, void** o_ppFunc ) const { if( ! m_hPlugLib || ! o_ppFunc ) - return FALSE; + return sal_False; *o_ppFunc = (void*)osl_getAsciiFunctionSymbol( m_hPlugLib, i_pName ); diff --git a/extensions/source/plugin/base/manager.cxx b/extensions/source/plugin/base/manager.cxx index 0526f3ed881b..c40f599aad23 100644 --- a/extensions/source/plugin/base/manager.cxx +++ b/extensions/source/plugin/base/manager.cxx @@ -76,9 +76,9 @@ const Sequence< ::rtl::OUString >& PluginManager::getAdditionalSearchPaths() String aPluginPath( aOptions.GetPluginPath() ); if( aPluginPath.Len() ) { - USHORT nPaths = aPluginPath.GetTokenCount( ';' ); + sal_uInt16 nPaths = aPluginPath.GetTokenCount( ';' ); aPaths.realloc( nPaths ); - for( USHORT i = 0; i < nPaths; i++ ) + for( sal_uInt16 i = 0; i < nPaths; i++ ) aPaths.getArray()[i] = aPluginPath.GetToken( i, ';' ); } } @@ -176,7 +176,7 @@ Sequence<com::sun::star::plugin::PluginDescription> XPluginManager_Impl::getPlug return aRet; } -Reference< ::com::sun::star::plugin::XPlugin > XPluginManager_Impl::createPlugin( const Reference< ::com::sun::star::plugin::XPluginContext >& acontext, INT16 mode, const Sequence< ::rtl::OUString >& argn, const Sequence< ::rtl::OUString >& argv, const ::com::sun::star::plugin::PluginDescription& plugintype) +Reference< ::com::sun::star::plugin::XPlugin > XPluginManager_Impl::createPlugin( const Reference< ::com::sun::star::plugin::XPluginContext >& acontext, sal_Int16 mode, const Sequence< ::rtl::OUString >& argn, const Sequence< ::rtl::OUString >& argv, const ::com::sun::star::plugin::PluginDescription& plugintype) throw( RuntimeException,::com::sun::star::plugin::PluginException ) { XPlugin_Impl* pImpl = new XPlugin_Impl( m_xSMgr ); diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx index a501d23f269b..b031df45e2af 100644 --- a/extensions/source/plugin/base/xplugin.cxx +++ b/extensions/source/plugin/base/xplugin.cxx @@ -78,7 +78,7 @@ void PluginDisposer::onShot() { if( m_pPlugin->isDisposable() ) { - ULONG nEvent; + sal_uLong nEvent; Application::PostUserEvent( nEvent, LINK( m_pPlugin, XPlugin_Impl, secondLevelDispose ), (void*)m_pPlugin ); } } @@ -1026,7 +1026,7 @@ void PluginInputStream::load() aUrl.SetSmartProtocol( INET_PROT_FILE ); aUrl.SetSmartURL( String( getStream()->url, - ::sal::static_int_cast< USHORT, size_t >( strlen( getStream()->url ) ), + ::sal::static_int_cast< sal_uInt16, size_t >( strlen( getStream()->url ) ), RTL_TEXTENCODING_MS_1252 ) ); try @@ -1071,8 +1071,8 @@ void PluginInputStream::writeBytes( const Sequence<sal_Int8>& Buffer ) throw() if( m_nMode == -1 || !m_pPlugin->getPluginComm() ) return; - UINT32 nPos = m_aFileStream.Tell(); - UINT32 nBytes = 0; + sal_uInt32 nPos = m_aFileStream.Tell(); + sal_uInt32 nBytes = 0; while( m_nMode != NP_ASFILEONLY && m_nWritePos < nPos && (nBytes = m_pPlugin->getPluginComm()-> NPP_WriteReady( diff --git a/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx b/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx index 941725b1f53d..bd4fc5405822 100644 --- a/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx +++ b/extensions/source/plugin/inc/plugin/aqua/sysplug.hxx @@ -136,7 +136,7 @@ public: void drawView( XPlugin_Impl* ); private: - BOOL retrieveFunction( const char* i_pName, void** i_ppFunc ) const; + sal_Bool retrieveFunction( const char* i_pName, void** i_ppFunc ) const; DECL_LINK( NullTimerHdl, void* ); private: diff --git a/extensions/source/plugin/inc/plugin/impl.hxx b/extensions/source/plugin/inc/plugin/impl.hxx index 6aa7ec7cca14..9b91c2fdeef1 100644 --- a/extensions/source/plugin/inc/plugin/impl.hxx +++ b/extensions/source/plugin/inc/plugin/impl.hxx @@ -340,7 +340,7 @@ class PluginInputStream : private: ::ucbhelper::Content* m_pContent; sal_Int32 m_nMode; - UINT32 m_nWritePos; + sal_uInt32 m_nWritePos; Reference< com::sun::star::io::XActiveDataSource > m_xSource; // hold a reference on input until closeOutput is called @@ -354,7 +354,7 @@ private: SvFileStream m_aFileStream; public: PluginInputStream( XPlugin_Impl* pPlugin, - const char* url, UINT32 len, UINT32 lastmod ); + const char* url, sal_uInt32 len, sal_uInt32 lastmod ); PluginInputStream() : PluginStream( NULL, NULL, 0, 0 ) {} @@ -363,7 +363,7 @@ public: virtual PluginStreamType getStreamType(); void setMode( sal_Int32 nMode ); - UINT32 read( UINT32 offset, sal_Int8* buffer, UINT32 size ); + sal_uInt32 read( sal_uInt32 offset, sal_Int8* buffer, sal_uInt32 size ); void setSource( const Reference< com::sun::star::io::XActiveDataSource >& xSource ) { m_xSource = xSource; } // get contents ot url via ucbhelper::Content void load(); diff --git a/extensions/source/plugin/inc/plugin/unx/mediator.hxx b/extensions/source/plugin/inc/plugin/unx/mediator.hxx index e1a7f59b5dee..ea068410d13e 100644 --- a/extensions/source/plugin/inc/plugin/unx/mediator.hxx +++ b/extensions/source/plugin/inc/plugin/unx/mediator.hxx @@ -43,14 +43,14 @@ struct MediatorMessage { - ULONG m_nID; - ULONG m_nBytes; + sal_uLong m_nID; + sal_uLong m_nBytes; char* m_pBytes; char* m_pRun; MediatorMessage() : m_nID( 0 ), m_nBytes( 0 ), m_pBytes( NULL ), m_pRun( NULL ) {} - MediatorMessage( ULONG nID, ULONG nBytes, char* pBytes ) : + MediatorMessage( sal_uLong nID, sal_uLong nBytes, char* pBytes ) : m_nID( nID ),m_nBytes( nBytes ), m_pRun( NULL ) { m_pBytes = new char[ m_nBytes ]; @@ -63,7 +63,7 @@ struct MediatorMessage delete [] m_pBytes; } - void Set( ULONG nBytes, char* pBytes ) + void Set( sal_uLong nBytes, char* pBytes ) { if( m_pBytes ) delete [] m_pBytes; @@ -72,11 +72,11 @@ struct MediatorMessage memcpy( m_pBytes, pBytes, (size_t)m_nBytes ); } - ULONG ExtractULONG(); + sal_uLong ExtractULONG(); char* GetString(); - UINT32 GetUINT32(); - void* GetBytes( ULONG& ); - void* GetBytes() { ULONG nBytes; return GetBytes( nBytes ); } + sal_uInt32 GetUINT32(); + void* GetBytes( sal_uLong& ); + void* GetBytes() { sal_uLong nBytes; return GetBytes( nBytes ); } void Rewind() { m_pRun = NULL; } }; @@ -97,7 +97,7 @@ protected: MediatorListener* m_pListener; // thread to fill the queue - ULONG m_nCurrentID; + sal_uLong m_nCurrentID; // will be constantly increased with each message sent bool m_bValid; @@ -112,27 +112,27 @@ public: // with error void invalidate() { m_bValid = false; } - ULONG SendMessage( ULONG nBytes, const char* pBytes, ULONG nMessageID = 0 ); - ULONG SendMessage( const ByteString& rMessage, ULONG nMessageID = 0 ) + sal_uLong SendMessage( sal_uLong nBytes, const char* pBytes, sal_uLong nMessageID = 0 ); + sal_uLong SendMessage( const ByteString& rMessage, sal_uLong nMessageID = 0 ) { return SendMessage( rMessage.Len(), rMessage.GetBuffer(), nMessageID ); } - BOOL WaitForMessage( ULONG nTimeOut = 5000 ); + sal_Bool WaitForMessage( sal_uLong nTimeOut = 5000 ); // timeout in ms // TRUE: Message came in // FALSE: timed out // if timeout is set, WaitForMessage will wait even if there are messages // in the queue - virtual MediatorMessage* WaitForAnswer( ULONG nMessageID ); + virtual MediatorMessage* WaitForAnswer( sal_uLong nMessageID ); // wait for an answer message ( ID >= 1 << 24 ) // the message will be removed from the queue and returned - MediatorMessage* TransactMessage( ULONG nBytes, char* pBytes ); + MediatorMessage* TransactMessage( sal_uLong nBytes, char* pBytes ); // sends a message and waits for an answer - MediatorMessage* GetNextMessage( BOOL bWait = FALSE ); + MediatorMessage* GetNextMessage( sal_Bool bWait = sal_False ); Link SetConnectionLostHdl( const Link& rLink ) diff --git a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx index 694fab30801a..d333d994e111 100644 --- a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx +++ b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx @@ -157,9 +157,9 @@ public: NPSavedData aData; ConnectorInstance( NPP inst, char* type, - int args, char* pargnbuf, ULONG nargnbytes, - char* pargvbuf, ULONG nargvbytes, - char* savedata, ULONG savebytes ); + int args, char* pargnbuf, sal_uLong nargnbytes, + char* pargvbuf, sal_uLong nargvbytes, + char* savedata, sal_uLong savebytes ); ~ConnectorInstance(); }; @@ -176,22 +176,22 @@ protected: std::vector<NPStream*> m_aNPWrapStreams; std::vector<ConnectorInstance*> m_aInstances; - ULONG FillBuffer( char*&, const char*, ULONG, va_list ); + sal_uLong FillBuffer( char*&, const char*, sal_uLong, va_list ); public: PluginConnector( int nSocket ); ~PluginConnector(); - virtual MediatorMessage* WaitForAnswer( ULONG nMessageID ); - MediatorMessage* Transact( const char*, ULONG, ... ); - MediatorMessage* Transact( UINT32, ... ); - void Respond( ULONG nID, char*, ULONG, ... ); - ULONG Send( UINT32, ... ); + virtual MediatorMessage* WaitForAnswer( sal_uLong nMessageID ); + MediatorMessage* Transact( const char*, sal_uLong, ... ); + MediatorMessage* Transact( sal_uInt32, ... ); + void Respond( sal_uLong nID, char*, sal_uLong, ... ); + sal_uLong Send( sal_uInt32, ... ); - static const UINT32 UnknownStreamID = 0xffffffff; - static const UINT32 UnknownNPPID = 0xffffffff; + static const sal_uInt32 UnknownStreamID = 0xffffffff; + static const sal_uInt32 UnknownNPPID = 0xffffffff; - UINT32 GetStreamID( NPStream* pStream ); - UINT32 GetNPPID( NPP ); + sal_uInt32 GetStreamID( NPStream* pStream ); + sal_uInt32 GetNPPID( NPP ); std::vector<NPStream*>& getStreamList() { return m_aNPWrapStreams; } @@ -210,7 +210,7 @@ public: } ConnectorInstance* getInstance( NPP ); - ConnectorInstance* getInstanceById( UINT32 ); + ConnectorInstance* getInstanceById( sal_uInt32 ); }; enum CommandAtoms diff --git a/extensions/source/plugin/unx/mediator.cxx b/extensions/source/plugin/unx/mediator.cxx index 9ecf0f48d9f8..4d8fd64a8407 100644 --- a/extensions/source/plugin/unx/mediator.cxx +++ b/extensions/source/plugin/unx/mediator.cxx @@ -56,7 +56,7 @@ Mediator::~Mediator() m_pListener = NULL; if( m_bValid ) { - ULONG aHeader[3]; + sal_uLong aHeader[3]; aHeader[0] = 0; aHeader[1] = 0; aHeader[2] = MEDIATOR_MAGIC; @@ -75,7 +75,7 @@ Mediator::~Mediator() } -ULONG Mediator::SendMessage( ULONG nBytes, const char* pBytes, ULONG nMessageID ) +sal_uLong Mediator::SendMessage( sal_uLong nBytes, const char* pBytes, sal_uLong nMessageID ) { if( ! m_pListener ) return 0; @@ -91,26 +91,26 @@ ULONG Mediator::SendMessage( ULONG nBytes, const char* pBytes, ULONG nMessageID if( ! m_bValid ) return nMessageID; - ULONG* pBuffer = new ULONG[ (nBytes/sizeof(ULONG)) + 4 ]; + sal_uLong* pBuffer = new sal_uLong[ (nBytes/sizeof(sal_uLong)) + 4 ]; pBuffer[ 0 ] = nMessageID; pBuffer[ 1 ] = nBytes; pBuffer[ 2 ] = MEDIATOR_MAGIC; memcpy( &pBuffer[3], pBytes, (size_t)nBytes ); - write( m_nSocket, pBuffer, nBytes + 3*sizeof( ULONG ) ); + write( m_nSocket, pBuffer, nBytes + 3*sizeof( sal_uLong ) ); delete [] pBuffer; return nMessageID; } -BOOL Mediator::WaitForMessage( ULONG nTimeOut ) +sal_Bool Mediator::WaitForMessage( sal_uLong nTimeOut ) { if( ! m_pListener ) - return FALSE; + return sal_False; size_t nItems = m_aMessageQueue.size(); if( ! nTimeOut && nItems > 0 ) - return TRUE; + return sal_True; TimeValue aValue; aValue.Seconds = nTimeOut/1000; @@ -121,12 +121,12 @@ BOOL Mediator::WaitForMessage( ULONG nTimeOut ) m_aNewMessageCdtn.wait( & aValue ); m_aNewMessageCdtn.reset(); if( nTimeOut && m_aMessageQueue.size() == nItems ) - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } -MediatorMessage* Mediator::WaitForAnswer( ULONG nMessageID ) +MediatorMessage* Mediator::WaitForAnswer( sal_uLong nMessageID ) { nMessageID &= 0x00ffffff; while( m_pListener ) @@ -136,7 +136,7 @@ MediatorMessage* Mediator::WaitForAnswer( ULONG nMessageID ) for( size_t i = 0; i < m_aMessageQueue.size(); i++ ) { MediatorMessage* pMessage = m_aMessageQueue[ i ]; - ULONG nID = pMessage->m_nID; + sal_uLong nID = pMessage->m_nID; if( ( nID & 0xff000000 ) && ( ( nID & 0x00ffffff ) == nMessageID ) ) { @@ -150,7 +150,7 @@ MediatorMessage* Mediator::WaitForAnswer( ULONG nMessageID ) return NULL; } -MediatorMessage* Mediator::GetNextMessage( BOOL bWait ) +MediatorMessage* Mediator::GetNextMessage( sal_Bool bWait ) { while( m_pListener ) { @@ -175,9 +175,9 @@ MediatorMessage* Mediator::GetNextMessage( BOOL bWait ) return NULL; } -MediatorMessage* Mediator::TransactMessage( ULONG nBytes, char* pBytes ) +MediatorMessage* Mediator::TransactMessage( sal_uLong nBytes, char* pBytes ) { - ULONG nID = SendMessage( nBytes, pBytes ); + sal_uLong nID = SendMessage( nBytes, pBytes ); return WaitForAnswer( nID ); } @@ -195,7 +195,7 @@ void MediatorListener::run() bool bRun = true; while( schedule() && m_pMediator && bRun ) { - ULONG nHeader[ 3 ]; + sal_uLong nHeader[ 3 ]; int nBytes; if( m_pMediator && ( nBytes = read( m_pMediator->m_nSocket, nHeader, sizeof( nHeader ) ) ) == sizeof( nHeader ) && nHeader[2] == MEDIATOR_MAGIC) @@ -203,7 +203,7 @@ void MediatorListener::run() if( nHeader[ 0 ] == 0 && nHeader[ 1 ] == 0 ) return; char* pBuffer = new char[ nHeader[ 1 ] ]; - if( m_pMediator && (ULONG)read( m_pMediator->m_nSocket, pBuffer, nHeader[ 1 ] ) == nHeader[ 1 ] ) + if( m_pMediator && (sal_uLong)read( m_pMediator->m_nSocket, pBuffer, nHeader[ 1 ] ) == nHeader[ 1 ] ) { ::vos::OGuard aMyGuard( m_aMutex ); { @@ -243,30 +243,30 @@ void MediatorListener::onTerminated() delete this; } -ULONG MediatorMessage::ExtractULONG() +sal_uLong MediatorMessage::ExtractULONG() { if( ! m_pRun ) m_pRun = m_pBytes; - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::ExtractULONG\n" ); - ULONG nCount; - memcpy( &nCount, m_pRun, sizeof( ULONG ) ); - m_pRun += sizeof( ULONG ); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::ExtractULONG\n" ); + sal_uLong nCount; + memcpy( &nCount, m_pRun, sizeof( sal_uLong ) ); + m_pRun += sizeof( sal_uLong ); return nCount; } -void* MediatorMessage::GetBytes( ULONG& rBytes ) +void* MediatorMessage::GetBytes( sal_uLong& rBytes ) { if( ! m_pRun ) m_pRun = m_pBytes; - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); - ULONG nBytes = ExtractULONG(); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); + sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) return NULL; - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetBytes\n" ); char* pBuffer = new char[ nBytes ]; memcpy( pBuffer, m_pRun, nBytes ); m_pRun += nBytes; @@ -279,13 +279,13 @@ char* MediatorMessage::GetString() if( ! m_pRun ) m_pRun = m_pBytes; - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); - ULONG nBytes = ExtractULONG(); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); + sal_uLong nBytes = ExtractULONG(); if( nBytes == 0 ) return NULL; - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetString\n" ); char* pBuffer = new char[ nBytes+1 ]; memcpy( pBuffer, m_pRun, nBytes ); pBuffer[ nBytes ] = 0; @@ -293,17 +293,17 @@ char* MediatorMessage::GetString() return pBuffer; } -UINT32 MediatorMessage::GetUINT32() +sal_uInt32 MediatorMessage::GetUINT32() { if( ! m_pRun ) m_pRun = m_pBytes; - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); - ULONG nBytes = ExtractULONG(); - medDebug( nBytes != sizeof( UINT32 ), "No UINT32 in MediatorMessage::GetUINT32\n" ); - medDebug( (ULONG)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); - UINT32 nRet; + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); + sal_uLong nBytes = ExtractULONG(); + medDebug( nBytes != sizeof( sal_uInt32 ), "No sal_uInt32 in MediatorMessage::GetUINT32\n" ); + medDebug( (sal_uLong)(m_pRun - m_pBytes) >= m_nBytes, "Overflow in MediatorMessage::GetUINT32\n" ); + sal_uInt32 nRet; memcpy( &nRet, m_pRun, sizeof( nRet ) ); - m_pRun += sizeof( UINT32 ); + m_pRun += sizeof( sal_uInt32 ); return nRet; } diff --git a/extensions/source/plugin/unx/npnapi.cxx b/extensions/source/plugin/unx/npnapi.cxx index 4a88577c5b71..364ff05606bc 100644 --- a/extensions/source/plugin/unx/npnapi.cxx +++ b/extensions/source/plugin/unx/npnapi.cxx @@ -66,11 +66,11 @@ static uint32 l_NPN_MemFlush( uint32 /*nSize*/ ) static NPError l_NPN_DestroyStream( NPP instance, NPStream* stream, NPError reason ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; - UINT32 nFileID = pConnector->GetStreamID( stream ); + sal_uInt32 nFileID = pConnector->GetStreamID( stream ); MediatorMessage* pMes= pConnector-> Transact( eNPN_DestroyStream, @@ -117,7 +117,7 @@ static jref l_NPN_GetJavaPeer( NPP /*instance*/ ) static NPError l_NPN_GetURL( NPP instance, const char* url, const char* window ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -142,7 +142,7 @@ static NPError l_NPN_GetURL( NPP instance, const char* url, const char* window ) static NPError l_NPN_GetURLNotify( NPP instance, const char* url, const char* target, void* notifyData ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -169,7 +169,7 @@ static NPError l_NPN_NewStream( NPP instance, NPMIMEType type, const char* targe NPStream** stream ) // stream is a return value { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -203,7 +203,7 @@ static NPError l_NPN_NewStream( NPP instance, NPMIMEType type, const char* targe static NPError l_NPN_PostURLNotify( NPP instance, const char* url, const char* target, uint32 len, const char* buf, NPBool file, void* notifyData ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -228,7 +228,7 @@ static NPError l_NPN_PostURLNotify( NPP instance, const char* url, const char* t static NPError l_NPN_PostURL( NPP instance, const char* url, const char* window, uint32 len, const char* buf, NPBool file ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -254,29 +254,29 @@ static NPError l_NPN_RequestRead( NPStream* stream, NPByteRange* rangeList ) medDebug( 1, "pluginapp: NPN_RequestRead\n" ); NPByteRange* pRange = rangeList; - UINT32 nRanges = 0; + sal_uInt32 nRanges = 0; while( pRange ) { nRanges++; pRange = pRange->next; } - UINT32* pArray = new UINT32[ 2 * nRanges ]; + sal_uInt32* pArray = new sal_uInt32[ 2 * nRanges ]; pRange = rangeList; - UINT32 n = 0; + sal_uInt32 n = 0; while( pRange ) { - pArray[ 2*n ] = (UINT32)pRange->offset; - pArray[ 2*n + 1] = (UINT32)pRange->length; + pArray[ 2*n ] = (sal_uInt32)pRange->offset; + pArray[ 2*n + 1] = (sal_uInt32)pRange->length; n++; pRange = pRange->next; } - UINT32 nFileID = pConnector->GetStreamID( stream ); + sal_uInt32 nFileID = pConnector->GetStreamID( stream ); MediatorMessage* pMes = pConnector-> Transact( eNPN_RequestRead, &nFileID, sizeof( nFileID ), &nRanges, sizeof( nRanges ), - pArray, sizeof( UINT32 ) * 2 * nRanges, + pArray, sizeof( sal_uInt32 ) * 2 * nRanges, NULL ); if( ! pMes ) @@ -290,7 +290,7 @@ static NPError l_NPN_RequestRead( NPStream* stream, NPByteRange* rangeList ) static void l_NPN_Status( NPP instance, const char* message ) { - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return; @@ -304,7 +304,7 @@ static const char* l_NPN_UserAgent( NPP instance ) { static char* pAgent = NULL; - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) { if( instance ) @@ -355,10 +355,10 @@ static void l_NPN_Version( int* major, int* minor, int* net_major, int* net_mino static int32 l_NPN_Write( NPP instance, NPStream* stream, int32 len, void* buffer ) { - UINT32 nFileID = pConnector->GetStreamID( stream ); + sal_uInt32 nFileID = pConnector->GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return NPERR_GENERIC_ERROR; - UINT32 nInstance = pConnector->GetNPPID( instance ); + sal_uInt32 nInstance = pConnector->GetNPPID( instance ); if( nInstance == PluginConnector::UnknownNPPID ) return NPERR_GENERIC_ERROR; @@ -373,7 +373,7 @@ static int32 l_NPN_Write( NPP instance, NPStream* stream, int32 len, void* buffe if( ! pMes ) return 0; - INT32 nRet = pMes->GetUINT32(); + sal_Int32 nRet = pMes->GetUINT32(); return nRet; } @@ -531,7 +531,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) { MediatorMessage* pMessage; CommandAtoms nCommand; - while( (pMessage = GetNextMessage( FALSE )) ) + while( (pMessage = GetNextMessage( sal_False )) ) { nCommand = (CommandAtoms)pMessage->GetUINT32(); medDebug( 1, "pluginapp: %s\n", GetCommandName( nCommand ) ); @@ -539,9 +539,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) { case eNPP_DestroyStream: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; NPError aReason = GetNPError( pMessage ); m_aNPWrapStreams.erase( m_aNPWrapStreams.begin() + nFileID ); @@ -557,7 +557,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_Destroy: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; // some plugin rely on old netscapes behaviour @@ -576,7 +576,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) case eNPP_DestroyPhase2: { // now really destroy the instance - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; NPP instance = pInst->instance; NPSavedData* pSave = NULL; @@ -611,7 +611,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_NewStream: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pType = pMessage->GetString(); NPStream* pStream = new NPStream; @@ -643,10 +643,10 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) int16* pArgc = (int16*)pMessage->GetBytes(); NPP instance = new NPP_t; instance->pdata = instance->ndata = NULL; - ULONG nArgnBytes, nArgvBytes; + sal_uLong nArgnBytes, nArgvBytes; char* pArgn = (char*)pMessage->GetBytes( nArgnBytes ); char* pArgv = (char*)pMessage->GetBytes( nArgvBytes ); - ULONG nSaveBytes; + sal_uLong nSaveBytes; char* pSavedData = (char*)pMessage->GetBytes( nSaveBytes ); ConnectorInstance* pInst = new ConnectorInstance( instance, pType, @@ -659,7 +659,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) aRet = aPluginFuncs.newp( pInst->pMimeType, instance, *pMode, *pArgc, pInst->nArg ? pInst->argn : NULL, pInst->nArg ? pInst->argv : NULL, - ( nSaveBytes == 4 && *(UINT32*)pSavedData == 0 ) ? + ( nSaveBytes == 4 && *(sal_uInt32*)pSavedData == 0 ) ? &(pInst->aData) : NULL ); medDebug( 1, "pluginapp: NPP_New( %s, %p, %d, %d, %p, %p, %p ) returns %d\n", pInst->pMimeType, @@ -695,7 +695,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_SetWindow: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); ConnectorInstance* pInst= m_aInstances[ nInstance ]; NPWindow* pWindow = (NPWindow*)pMessage->GetBytes(); @@ -795,9 +795,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_StreamAsFile: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; char* fname = pMessage->GetString(); medDebug( 1, "pluginapp: NPP_StreamAsFile %s\n", fname ); @@ -807,7 +807,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_URLNotify: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* url = pMessage->GetString(); NPReason* pReason = (NPReason*)pMessage->GetBytes(); @@ -820,9 +820,9 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_WriteReady: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; int32 nRet = aPluginFuncs.writeready( instance, pStream ); @@ -836,12 +836,12 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPP_Write: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; int32 offset = pMessage->GetUINT32(); - ULONG len; + sal_uLong len; char* buffer = (char*)pMessage->GetBytes( len ); int32 nRet = aPluginFuncs.write( instance, pStream, offset, len, buffer ); diff --git a/extensions/source/plugin/unx/nppapi.cxx b/extensions/source/plugin/unx/nppapi.cxx index 82be7ae3c2df..640daba417ce 100644 --- a/extensions/source/plugin/unx/nppapi.cxx +++ b/extensions/source/plugin/unx/nppapi.cxx @@ -94,7 +94,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) MediatorMessage* pMessage; CommandAtoms nCommand; - while( (pMessage = GetNextMessage( FALSE )) ) + while( (pMessage = GetNextMessage( sal_False )) ) { nCommand = (CommandAtoms)pMessage->GetUINT32(); medDebug( 1, "%s\n", GetCommandName( nCommand ) ); @@ -102,7 +102,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) { case eNPN_GetURL: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pUrl = pMessage->GetString(); char* pWindow = pMessage->GetString(); @@ -115,7 +115,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_GetURLNotify: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pUrl = pMessage->GetString(); char* pWindow = pMessage->GetString(); @@ -131,13 +131,13 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_DestroyStream: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); char* pUrl = pMessage->GetString(); NPError* pReason = (NPError*)pMessage->GetBytes(); NPError aRet = NPERR_FILE_NOT_FOUND; - if( nFileID < static_cast<UINT32>(m_aNPWrapStreams.size()) ) + if( nFileID < static_cast<sal_uInt32>(m_aNPWrapStreams.size()) ) { if( ! strcmp( m_aNPWrapStreams[ nFileID ]->url, pUrl ) ) { @@ -162,7 +162,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_NewStream: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; NPMIMEType pType = pMessage->GetString(); char* pTarget = pMessage->GetString(); @@ -173,24 +173,24 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) if( aRet != NPERR_NO_ERROR ) { - UINT32 nDummy = 0; + sal_uInt32 nDummy = 0; Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), "", 0, - &nDummy, sizeof(UINT32), - &nDummy, sizeof(UINT32), + &nDummy, sizeof(sal_uInt32), + &nDummy, sizeof(sal_uInt32), NULL ); } else { m_aNPWrapStreams.push_back( pStream ); - ULONG nLen = strlen( pStream->url ); + sal_uLong nLen = strlen( pStream->url ); Respond( pMessage->m_nID, (char*)&aRet, sizeof( aRet ), pStream->url, nLen, - &pStream->end, sizeof(UINT32), - &pStream->lastmodified, sizeof(UINT32), + &pStream->end, sizeof(sal_uInt32), + &pStream->lastmodified, sizeof(sal_uInt32), NULL ); } @@ -200,11 +200,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_PostURLNotify: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pUrl = pMessage->GetString(); char* pTarget = pMessage->GetString(); - UINT32 nLen = pMessage->GetUINT32(); + sal_uInt32 nLen = pMessage->GetUINT32(); char* pBuf = (char*)pMessage->GetBytes(); NPBool* pFile = (NPBool*)pMessage->GetBytes(); void** pNData = (void**)pMessage->GetBytes(); @@ -220,11 +220,11 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_PostURL: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pUrl = pMessage->GetString(); char* pWindow = pMessage->GetString(); - UINT32 nLen = pMessage->GetUINT32(); + sal_uInt32 nLen = pMessage->GetUINT32(); char* pBuf = (char*)pMessage->GetBytes(); NPBool* pFile = (NPBool*)pMessage->GetBytes(); NPError aRet = @@ -238,14 +238,14 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_RequestRead: { - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; - UINT32 nRanges = pMessage->GetUINT32(); - UINT32* pArray = (UINT32*)pMessage->GetBytes(); + sal_uInt32 nRanges = pMessage->GetUINT32(); + sal_uInt32* pArray = (sal_uInt32*)pMessage->GetBytes(); // build ranges table NPByteRange* pFirst = new NPByteRange; NPByteRange* pRun = pFirst; - for( UINT32 n = 0; n < nRanges; n++ ) + for( sal_uInt32 n = 0; n < nRanges; n++ ) { pRun->offset = pArray[ 2*n ]; pRun->length = pArray[ 2*n+1 ]; @@ -265,7 +265,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_Status: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; char* pString = pMessage->GetString(); NPN_Status( instance, pString ); @@ -286,13 +286,13 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_Write: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; - UINT32 nFileID = pMessage->GetUINT32(); + sal_uInt32 nFileID = pMessage->GetUINT32(); NPStream* pStream = m_aNPWrapStreams[ nFileID ]; - INT32 nLen = pMessage->GetUINT32(); + sal_Int32 nLen = pMessage->GetUINT32(); void* pBuffer = pMessage->GetBytes(); - INT32 nRet = NPN_Write( instance, pStream, nLen, pBuffer ); + sal_Int32 nRet = NPN_Write( instance, pStream, nLen, pBuffer ); Respond( pMessage->m_nID, (char*)&nRet, sizeof( nRet ), NULL ); @@ -302,7 +302,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) break; case eNPN_UserAgent: { - UINT32 nInstance = pMessage->GetUINT32(); + sal_uInt32 nInstance = pMessage->GetUINT32(); NPP instance = m_aInstances[ nInstance ]->instance; const char* pAnswer = NPN_UserAgent( instance ); Respond( pMessage->m_nID, @@ -320,7 +320,7 @@ IMPL_LINK( PluginConnector, WorkOnNewMessageHdl, Mediator*, /*pMediator*/ ) } #define GET_INSTANCE() \ - UINT32 nInstance; \ + sal_uInt32 nInstance; \ nInstance = GetNPPID( instance ); #define GET_INSTANCE_RET( err ) \ @@ -350,9 +350,9 @@ NPError UnxPluginComm::NPP_Destroy( NPP instance, NPSavedData** save ) return NPERR_GENERIC_ERROR; aRet = GetNPError( pMes ); - ULONG nSaveBytes; + sal_uLong nSaveBytes; void* pSaveData = pMes->GetBytes( nSaveBytes ); - if( nSaveBytes == 4 && *(UINT32*)pSaveData == 0 ) + if( nSaveBytes == 4 && *(sal_uInt32*)pSaveData == 0 ) *save = NULL; else { @@ -369,7 +369,7 @@ NPError UnxPluginComm::NPP_DestroyStream( NPP instance, NPStream* stream, NPErro { NPError aRet = NPERR_GENERIC_ERROR; GET_INSTANCE_RET( aRet ); - UINT32 nFileID = GetStreamID( stream ); + sal_uInt32 nFileID = GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return NPERR_GENERIC_ERROR; @@ -526,7 +526,7 @@ void UnxPluginComm::NPP_Shutdown() void UnxPluginComm::NPP_StreamAsFile( NPP instance, NPStream* stream, const char* fname ) { GET_INSTANCE(); - UINT32 nFileID = GetStreamID( stream ); + sal_uInt32 nFileID = GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return; @@ -552,7 +552,7 @@ void UnxPluginComm::NPP_URLNotify( NPP instance, const char* url, NPReason reaso int32 UnxPluginComm::NPP_Write( NPP instance, NPStream* stream, int32 offset, int32 len, void* buffer ) { GET_INSTANCE_RET( -1 ); - UINT32 nFileID = GetStreamID( stream ); + sal_uInt32 nFileID = GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return -1; @@ -575,7 +575,7 @@ int32 UnxPluginComm::NPP_Write( NPP instance, NPStream* stream, int32 offset, in int32 UnxPluginComm::NPP_WriteReady( NPP instance, NPStream* stream ) { GET_INSTANCE_RET( -1 ); - UINT32 nFileID = GetStreamID( stream ); + sal_uInt32 nFileID = GetStreamID( stream ); if( nFileID == PluginConnector::UnknownStreamID ) return -1; diff --git a/extensions/source/plugin/unx/npwrap.cxx b/extensions/source/plugin/unx/npwrap.cxx index 387de8cde24d..98bb858ecc0f 100644 --- a/extensions/source/plugin/unx/npwrap.cxx +++ b/extensions/source/plugin/unx/npwrap.cxx @@ -227,7 +227,7 @@ static void signal_handler( int nSig ) static gboolean noClosure( gpointer ) { - return TRUE; + return sal_True; } // Xt events @@ -246,7 +246,7 @@ static gboolean checkXtEvent( GSource* ) static gboolean dispatchXtEvent( GSource*, GSourceFunc, gpointer ) { XtAppProcessEvent( app_context, XtIMAll ); - return TRUE; + return sal_True; } static GSourceFuncs aXtEventFuncs = @@ -267,7 +267,7 @@ static gboolean pollXtTimerCallback(gpointer) break; XtAppProcessEvent(app_context, XtIMAll & ~XtIMXEvent); } - return TRUE; + return sal_True; } static gboolean prepareWakeupEvent( GSource*, gint* ) @@ -302,7 +302,7 @@ static gboolean dispatchWakeupEvent( GSource*, GSourceFunc, gpointer ) pConnector = NULL; } - return TRUE; + return sal_True; } static GSourceFuncs aWakeupEventFuncs = { @@ -412,7 +412,7 @@ int main( int argc, char **argv) } g_source_set_priority( pXTSource, GDK_PRIORITY_EVENTS ); - g_source_set_can_recurse( pXTSource, TRUE ); + g_source_set_can_recurse( pXTSource, sal_True ); g_source_attach( pXTSource, NULL ); aXtPollDesc.fd = ConnectionNumber( pXtAppDisplay ); aXtPollDesc.events = G_IO_IN; @@ -474,7 +474,7 @@ int main( int argc, char **argv) do { #ifdef ENABLE_GTK - g_main_context_iteration( NULL, TRUE ); + g_main_context_iteration( NULL, 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 8e0183ab8c81..c71738be3632 100644 --- a/extensions/source/plugin/unx/plugcon.cxx +++ b/extensions/source/plugin/unx/plugcon.cxx @@ -32,22 +32,22 @@ #include <cstdarg> #include <vector> -UINT32 PluginConnector::GetStreamID( NPStream* pStream ) +sal_uInt32 PluginConnector::GetStreamID( NPStream* pStream ) { size_t nLen = m_aNPWrapStreams.size(); for( size_t i = 0; i < nLen; i++ ) if( m_aNPWrapStreams[ i ] == pStream ) - return static_cast<UINT32>(i); + return static_cast<sal_uInt32>(i); medDebug( 1, "Error: NPStream has no ID\n" ); return UnknownStreamID; } -UINT32 PluginConnector::GetNPPID( NPP instance ) +sal_uInt32 PluginConnector::GetNPPID( NPP instance ) { size_t nLen = m_aInstances.size(); for( size_t i=0; i <nLen; i++ ) if( m_aInstances[ i ]->instance == instance ) - return static_cast<UINT32>(i); + return static_cast<sal_uInt32>(i); medDebug( 1, "Error: NPP has no ID\n" ); return UnknownNPPID; @@ -65,37 +65,37 @@ ConnectorInstance* PluginConnector::getInstance( NPP instance ) return NULL; } -ConnectorInstance* PluginConnector::getInstanceById( UINT32 nInstanceID ) +ConnectorInstance* PluginConnector::getInstanceById( sal_uInt32 nInstanceID ) { - return nInstanceID < static_cast<UINT32>(m_aInstances.size()) ? m_aInstances[ nInstanceID ] : NULL; + return nInstanceID < static_cast<sal_uInt32>(m_aInstances.size()) ? m_aInstances[ nInstanceID ] : NULL; } struct PtrStruct { char* pData; - ULONG nBytes; + sal_uLong nBytes; - PtrStruct( char* i_pData, ULONG i_nBytes ) + PtrStruct( char* i_pData, sal_uLong i_nBytes ) : pData( i_pData ), nBytes( i_nBytes ) {} }; -ULONG PluginConnector::FillBuffer( char*& rpBuffer, +sal_uLong PluginConnector::FillBuffer( char*& rpBuffer, const char* pFunction, - ULONG nFunctionLen, + sal_uLong nFunctionLen, va_list ap ) { std::vector< PtrStruct > aList; aList.reserve( 5 ); - ULONG nDataSize = nFunctionLen + sizeof( ULONG ); + sal_uLong nDataSize = nFunctionLen + sizeof( sal_uLong ); char* pNext; do { pNext = va_arg( ap, char* ); if( pNext ) { - aList.push_back( PtrStruct( pNext, va_arg( ap, ULONG ) ) ); - nDataSize += aList.back().nBytes + sizeof(ULONG); + aList.push_back( PtrStruct( pNext, va_arg( ap, sal_uLong ) ) ); + nDataSize += aList.back().nBytes + sizeof(sal_uLong); } } while( pNext ); @@ -108,8 +108,8 @@ ULONG PluginConnector::FillBuffer( char*& rpBuffer, for( std::vector<PtrStruct>::const_iterator it = aList.begin(); it != aList.end(); ++it ) { - memcpy( pRun, &it->nBytes, sizeof( ULONG ) ); - pRun += sizeof( ULONG ); + memcpy( pRun, &it->nBytes, sizeof( sal_uLong ) ); + pRun += sizeof( sal_uLong ); memcpy( pRun, it->pData, it->nBytes ); pRun += it->nBytes; } @@ -117,53 +117,53 @@ ULONG PluginConnector::FillBuffer( char*& rpBuffer, } MediatorMessage* PluginConnector::Transact( const char* pFunction, - ULONG nFunctionLen, ... ) + sal_uLong nFunctionLen, ... ) { va_list ap; char* pBuffer; va_start( ap, nFunctionLen ); - ULONG nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); + sal_uLong nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); va_end( ap ); return TransactMessage( nSize, pBuffer ); } -MediatorMessage* PluginConnector::Transact( UINT32 nFunction, ... ) +MediatorMessage* PluginConnector::Transact( sal_uInt32 nFunction, ... ) { va_list ap; char* pBuffer; va_start( ap, nFunction ); - ULONG nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); + sal_uLong nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); va_end( ap ); return TransactMessage( nSize, pBuffer ); } -ULONG PluginConnector::Send( UINT32 nFunction, ... ) +sal_uLong PluginConnector::Send( sal_uInt32 nFunction, ... ) { va_list ap; char* pBuffer; va_start( ap, nFunction ); - ULONG nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); + sal_uLong nSize = FillBuffer( pBuffer, (char*)&nFunction, sizeof( nFunction ), ap ); va_end( ap ); return SendMessage( nSize, pBuffer ); } -void PluginConnector::Respond( ULONG nID, +void PluginConnector::Respond( sal_uLong nID, char* pFunction, - ULONG nFunctionLen, ... ) + sal_uLong nFunctionLen, ... ) { va_list ap; char* pBuffer; va_start( ap, nFunctionLen ); - ULONG nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); + sal_uLong nSize = FillBuffer( pBuffer, pFunction, nFunctionLen, ap ); va_end( ap ); SendMessage( nSize, pBuffer, nID | ( 1 << 24 ) ); } -MediatorMessage* PluginConnector::WaitForAnswer( ULONG nMessageID ) +MediatorMessage* PluginConnector::WaitForAnswer( sal_uLong nMessageID ) { if( ! m_bValid ) return NULL; @@ -176,7 +176,7 @@ MediatorMessage* PluginConnector::WaitForAnswer( ULONG nMessageID ) for( size_t i = 0; i < m_aMessageQueue.size(); i++ ) { MediatorMessage* pMessage = m_aMessageQueue[ i ]; - ULONG nID = pMessage->m_nID; + sal_uLong nID = pMessage->m_nID; if( ( nID & 0xff000000 ) && ( ( nID & 0x00ffffff ) == nMessageID ) ) { @@ -193,9 +193,9 @@ MediatorMessage* PluginConnector::WaitForAnswer( ULONG nMessageID ) } ConnectorInstance::ConnectorInstance( NPP inst, char* type, - int args, char* pargnbuf, ULONG nargnbytes, - char* pargvbuf, ULONG nargvbytes, - char* savedata, ULONG savebytes ) : + int args, char* pargnbuf, sal_uLong nargnbytes, + char* pargvbuf, sal_uLong nargvbytes, + char* savedata, sal_uLong savebytes ) : instance( inst ), pShell( NULL ), pWidget( NULL ), @@ -219,18 +219,18 @@ ConnectorInstance::ConnectorInstance( NPP inst, char* type, for( i = 0; i < nArg; i++ ) { argn[i] = pRun; - while( *pRun != 0 && (ULONG)(pRun - pArgnBuf) < nargnbytes ) + while( *pRun != 0 && (sal_uLong)(pRun - pArgnBuf) < nargnbytes ) pRun++; - if( (ULONG)(pRun - pArgnBuf) < nargnbytes ) + if( (sal_uLong)(pRun - pArgnBuf) < nargnbytes ) pRun++; } pRun = pArgvBuf; for( i = 0; i < nArg; i++ ) { argv[i] = pRun; - while( *pRun != 0 && (ULONG)(pRun - pArgvBuf) < nargvbytes ) + while( *pRun != 0 && (sal_uLong)(pRun - pArgvBuf) < nargvbytes ) pRun++; - if( (ULONG)(pRun - pArgvBuf) < nargvbytes ) + if( (sal_uLong)(pRun - pArgvBuf) < nargvbytes ) pRun++; } } diff --git a/extensions/source/plugin/unx/sysplug.cxx b/extensions/source/plugin/unx/sysplug.cxx index fbcf9b7497eb..be5879bf238d 100644 --- a/extensions/source/plugin/unx/sysplug.cxx +++ b/extensions/source/plugin/unx/sysplug.cxx @@ -91,7 +91,7 @@ UnxPluginComm::UnxPluginComm( } else { - MediatorMessage* pMessage = GetNextMessage( TRUE ); + MediatorMessage* pMessage = GetNextMessage( sal_True ); Respond( pMessage->m_nID, const_cast<char*>("init ack"),8, NULL ); diff --git a/extensions/source/plugin/unx/unxmgr.cxx b/extensions/source/plugin/unx/unxmgr.cxx index 1a3736e87e0b..5c02910ada33 100644 --- a/extensions/source/plugin/unx/unxmgr.cxx +++ b/extensions/source/plugin/unx/unxmgr.cxx @@ -231,7 +231,7 @@ static void CheckPluginRegistryFiles( const rtl::OString& rPath, list< PluginDes Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw() { static Sequence<PluginDescription> aDescriptions; - static BOOL bHavePlugins = FALSE; + static sal_Bool bHavePlugins = sal_False; if( ! bHavePlugins ) { rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); @@ -309,7 +309,7 @@ Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() th delete *iter; } aPlugins.clear(); - bHavePlugins = TRUE; + bHavePlugins = sal_True; } return aDescriptions; } |