diff options
Diffstat (limited to 'basic/source/comp/codegen.cxx')
-rw-r--r-- | basic/source/comp/codegen.cxx | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index 93fb18baf86e..a8c7e3f5330f 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -40,13 +40,13 @@ SbiCodeGen::SbiCodeGen( SbModule& r, SbiParser* p, short nInc ) : rMod( r ), aCode( p, nInc ) { pParser = p; - bStmnt = FALSE; + bStmnt = sal_False; nLine = 0; nCol = 0; nForLevel = 0; } -UINT32 SbiCodeGen::GetPC() +sal_uInt32 SbiCodeGen::GetPC() { return aCode.GetSize(); } @@ -55,7 +55,7 @@ UINT32 SbiCodeGen::GetPC() void SbiCodeGen::Statement() { - bStmnt = TRUE; + bStmnt = sal_True; nLine = pParser->GetLine(); nCol = pParser->GetCol1(); @@ -71,7 +71,7 @@ void SbiCodeGen::GenStmnt() { if( bStmnt ) { - bStmnt = FALSE; + bStmnt = sal_False; Gen( _STMNT, nLine, nCol ); } } @@ -79,39 +79,39 @@ void SbiCodeGen::GenStmnt() // Die Gen-Routinen returnen den Offset des 1. Operanden, // damit Jumps dort ihr Backchain versenken koennen -UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode ) +sal_uInt32 SbiCodeGen::Gen( SbiOpcode eOpcode ) { #ifdef DBG_UTIL if( eOpcode < SbOP0_START || eOpcode > SbOP0_END ) pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE1" ); #endif GenStmnt(); - aCode += (UINT8) eOpcode; + aCode += (sal_uInt8) eOpcode; return GetPC(); } -UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd ) +sal_uInt32 SbiCodeGen::Gen( SbiOpcode eOpcode, sal_uInt32 nOpnd ) { #ifdef DBG_UTIL if( eOpcode < SbOP1_START || eOpcode > SbOP1_END ) pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE2" ); #endif GenStmnt(); - aCode += (UINT8) eOpcode; - UINT32 n = GetPC(); + aCode += (sal_uInt8) eOpcode; + sal_uInt32 n = GetPC(); aCode += nOpnd; return n; } -UINT32 SbiCodeGen::Gen( SbiOpcode eOpcode, UINT32 nOpnd1, UINT32 nOpnd2 ) +sal_uInt32 SbiCodeGen::Gen( SbiOpcode eOpcode, sal_uInt32 nOpnd1, sal_uInt32 nOpnd2 ) { #ifdef DBG_UTIL if( eOpcode < SbOP2_START || eOpcode > SbOP2_END ) pParser->Error( SbERR_INTERNAL_ERROR, "OPCODE3" ); #endif GenStmnt(); - aCode += (UINT8) eOpcode; - UINT32 n = GetPC(); + aCode += (sal_uInt8) eOpcode; + sal_uInt32 n = GetPC(); aCode += nOpnd1; aCode += nOpnd2; return n; @@ -178,7 +178,7 @@ void SbiCodeGen::Save() String aProcName = pProc->GetName(); String aIfaceProcName; String aIfaceName; - USHORT nPassCount = 1; + sal_uInt16 nPassCount = 1; if( nIfaceCount ) { int nPropPrefixFound = @@ -206,7 +206,7 @@ void SbiCodeGen::Save() } } SbMethod* pMeth = NULL; - for( USHORT nPass = 0 ; nPass < nPassCount ; nPass++ ) + for( sal_uInt16 nPass = 0 ; nPass < nPassCount ; nPass++ ) { if( nPass == 1 ) aProcName = aIfaceProcName; @@ -269,7 +269,7 @@ void SbiCodeGen::Save() // Die Parameter: SbxInfo* pInfo = pMeth->GetInfo(); String aHelpFile, aComment; - ULONG nHelpId = 0; + sal_uIntPtr nHelpId = 0; if( pInfo ) { // Die Zusatzdaten retten @@ -282,7 +282,7 @@ void SbiCodeGen::Save() pInfo->SetComment( aComment ); SbiSymPool* pPool = &pProc->GetParams(); // Das erste Element ist immer der Funktionswert! - for( USHORT i = 1; i < pPool->GetSize(); i++ ) + for( sal_uInt16 i = 1; i < pPool->GetSize(); i++ ) { SbiSymDef* pPar = pPool->Get( i ); SbxDataType t = pPar->GetType(); @@ -291,14 +291,14 @@ void SbiCodeGen::Save() if( pPar->GetDims() ) t = (SbxDataType) ( t | SbxARRAY ); // #33677 Optional-Info durchreichen - USHORT nFlags = SBX_READ; + sal_uInt16 nFlags = SBX_READ; if( pPar->IsOptional() ) nFlags |= SBX_OPTIONAL; pInfo->AddParam( pPar->GetName(), t, nFlags ); - UINT32 nUserData = 0; - USHORT nDefaultId = pPar->GetDefaultId(); + sal_uInt32 nUserData = 0; + sal_uInt16 nDefaultId = pPar->GetDefaultId(); if( nDefaultId ) nUserData |= nDefaultId; if( pPar->IsParamArray() ) @@ -320,14 +320,14 @@ void SbiCodeGen::Save() // Der globale StringPool. 0 ist nicht belegt. SbiStringPool* pPool = &pParser->aGblStrings; - USHORT nSize = pPool->GetSize(); + sal_uInt16 nSize = pPool->GetSize(); p->MakeStrings( nSize ); - USHORT i; + sal_uInt16 i; for( i = 1; i <= nSize; i++ ) p->AddString( pPool->Find( i ) ); // Typen einfuegen - USHORT nCount = pParser->rTypeArray->Count(); + sal_uInt16 nCount = pParser->rTypeArray->Count(); for (i = 0; i < nCount; i++) p->AddType((SbxObject *)pParser->rTypeArray->Get(i)); @@ -350,7 +350,7 @@ class PCodeVisitor public: virtual ~PCodeVisitor(); - virtual void start( BYTE* pStart ) = 0; + virtual void start( sal_uInt8* pStart ) = 0; virtual void processOpCode0( SbiOpcode eOp ) = 0; virtual void processOpCode1( SbiOpcode eOp, T nOp1 ) = 0; virtual void processOpCode2( SbiOpcode eOp, T nOp1, T nOp2 ) = 0; @@ -366,8 +366,8 @@ class PCodeBufferWalker { private: T m_nBytes; - BYTE* m_pCode; - T readParam( BYTE*& pCode ) + sal_uInt8* m_pCode; + T readParam( sal_uInt8*& pCode ) { short nBytes = sizeof( T ); T nOp1=0; @@ -376,15 +376,15 @@ private: return nOp1; } public: - PCodeBufferWalker( BYTE* pCode, T nBytes ): m_nBytes( nBytes ), m_pCode( pCode ) + PCodeBufferWalker( sal_uInt8* pCode, T nBytes ): m_nBytes( nBytes ), m_pCode( pCode ) { } void visitBuffer( PCodeVisitor< T >& visitor ) { - BYTE* pCode = m_pCode; + sal_uInt8* pCode = m_pCode; if ( !pCode ) return; - BYTE* pEnd = pCode + m_nBytes; + sal_uInt8* pEnd = pCode + m_nBytes; visitor.start( m_pCode ); T nOp1 = 0, nOp2 = 0; for( ; pCode < pEnd; ) @@ -426,7 +426,7 @@ class OffSetAccumulator : public PCodeVisitor< T > public: OffSetAccumulator() : m_nNumOp0(0), m_nNumSingleParams(0), m_nNumDoubleParams(0){} - virtual void start( BYTE* /*pStart*/ ){} + virtual void start( sal_uInt8* /*pStart*/ ){} virtual void processOpCode0( SbiOpcode /*eOp*/ ){ ++m_nNumOp0; } virtual void processOpCode1( SbiOpcode /*eOp*/, T /*nOp1*/ ){ ++m_nNumSingleParams; } virtual void processOpCode2( SbiOpcode /*eOp*/, T /*nOp1*/, T /*nOp2*/ ) { ++m_nNumDoubleParams; } @@ -450,18 +450,18 @@ template < class T, class S > class BufferTransformer : public PCodeVisitor< T > { - BYTE* m_pStart; + sal_uInt8* m_pStart; SbiBuffer m_ConvertedBuf; public: BufferTransformer():m_pStart(NULL), m_ConvertedBuf( NULL, 1024 ) {} - virtual void start( BYTE* pStart ){ m_pStart = pStart; } + virtual void start( sal_uInt8* pStart ){ m_pStart = pStart; } virtual void processOpCode0( SbiOpcode eOp ) { - m_ConvertedBuf += (UINT8)eOp; + m_ConvertedBuf += (sal_uInt8)eOp; } virtual void processOpCode1( SbiOpcode eOp, T nOp1 ) { - m_ConvertedBuf += (UINT8)eOp; + m_ConvertedBuf += (sal_uInt8)eOp; switch( eOp ) { case _JUMP: @@ -486,7 +486,7 @@ public: } virtual void processOpCode2( SbiOpcode eOp, T nOp1, T nOp2 ) { - m_ConvertedBuf += (UINT8)eOp; + m_ConvertedBuf += (sal_uInt8)eOp; if ( eOp == _CASEIS ) if ( nOp1 ) nOp1 = static_cast<T>( convertBufferOffSet(m_pStart, nOp1) ); @@ -503,7 +503,7 @@ public: { return m_ConvertedBuf; } - static S convertBufferOffSet( BYTE* pStart, T nOp1 ) + static S convertBufferOffSet( sal_uInt8* pStart, T nOp1 ) { PCodeBufferWalker< T > aBuff( pStart, nOp1); OffSetAccumulator< T, S > aVisitor; @@ -512,16 +512,16 @@ public: } }; -UINT32 -SbiCodeGen::calcNewOffSet( BYTE* pCode, UINT16 nOffset ) +sal_uInt32 +SbiCodeGen::calcNewOffSet( sal_uInt8* pCode, sal_uInt16 nOffset ) { - return BufferTransformer< UINT16, UINT32 >::convertBufferOffSet( pCode, nOffset ); + return BufferTransformer< sal_uInt16, sal_uInt32 >::convertBufferOffSet( pCode, nOffset ); } -UINT16 -SbiCodeGen::calcLegacyOffSet( BYTE* pCode, UINT32 nOffset ) +sal_uInt16 +SbiCodeGen::calcLegacyOffSet( sal_uInt8* pCode, sal_uInt32 nOffset ) { - return BufferTransformer< UINT32, UINT16 >::convertBufferOffSet( pCode, nOffset ); + return BufferTransformer< sal_uInt32, sal_uInt16 >::convertBufferOffSet( pCode, nOffset ); } template <class T, class S> @@ -531,9 +531,9 @@ PCodeBuffConvertor<T,S>::convert() PCodeBufferWalker< T > aBuf( m_pStart, m_nSize ); BufferTransformer< T, S > aTrnsfrmer; aBuf.visitBuffer( aTrnsfrmer ); - m_pCnvtdBuf = (BYTE*)aTrnsfrmer.buffer().GetBuffer(); + m_pCnvtdBuf = (sal_uInt8*)aTrnsfrmer.buffer().GetBuffer(); m_nCnvtdSize = static_cast<S>( aTrnsfrmer.buffer().GetSize() ); } -template class PCodeBuffConvertor< UINT16, UINT32 >; -template class PCodeBuffConvertor< UINT32, UINT16 >; +template class PCodeBuffConvertor< sal_uInt16, sal_uInt32 >; +template class PCodeBuffConvertor< sal_uInt32, sal_uInt16 >; |