summaryrefslogtreecommitdiff
path: root/basic/source/runtime/step1.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/runtime/step1.cxx')
-rw-r--r--basic/source/runtime/step1.cxx90
1 files changed, 44 insertions, 46 deletions
diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx
index a619a01b3d..8e0e9311c6 100644
--- a/basic/source/runtime/step1.cxx
+++ b/basic/source/runtime/step1.cxx
@@ -44,14 +44,14 @@ bool checkUnoObjectType( SbUnoObject* refVal,
// Laden einer numerischen Konstanten (+ID)
-void SbiRuntime::StepLOADNC( UINT32 nOp1 )
+void SbiRuntime::StepLOADNC( sal_uInt32 nOp1 )
{
SbxVariable* p = new SbxVariable( SbxDOUBLE );
// #57844 Lokalisierte Funktion benutzen
String aStr = pImg->GetString( static_cast<short>( nOp1 ) );
// Auch , zulassen !!!
- USHORT iComma = aStr.Search( ',' );
+ sal_uInt16 iComma = aStr.Search( ',' );
if( iComma != STRING_NOTFOUND )
{
String aStr1 = aStr.Copy( 0, iComma );
@@ -68,7 +68,7 @@ void SbiRuntime::StepLOADNC( UINT32 nOp1 )
// Laden einer Stringkonstanten (+ID)
-void SbiRuntime::StepLOADSC( UINT32 nOp1 )
+void SbiRuntime::StepLOADSC( sal_uInt32 nOp1 )
{
SbxVariable* p = new SbxVariable;
p->PutString( pImg->GetString( static_cast<short>( nOp1 ) ) );
@@ -77,16 +77,16 @@ void SbiRuntime::StepLOADSC( UINT32 nOp1 )
// Immediate Load (+Wert)
-void SbiRuntime::StepLOADI( UINT32 nOp1 )
+void SbiRuntime::StepLOADI( sal_uInt32 nOp1 )
{
SbxVariable* p = new SbxVariable;
- p->PutInteger( static_cast<INT16>( nOp1 ) );
+ p->PutInteger( static_cast<sal_Int16>( nOp1 ) );
PushVar( p );
}
// Speichern eines named Arguments in Argv (+Arg-Nr ab 1!)
-void SbiRuntime::StepARGN( UINT32 nOp1 )
+void SbiRuntime::StepARGN( sal_uInt32 nOp1 )
{
if( !refArgv )
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
@@ -110,18 +110,18 @@ void SbiRuntime::StepARGN( UINT32 nOp1 )
// Konvertierung des Typs eines Arguments in Argv fuer DECLARE-Fkt. (+Typ)
-void SbiRuntime::StepARGTYP( UINT32 nOp1 )
+void SbiRuntime::StepARGTYP( sal_uInt32 nOp1 )
{
if( !refArgv )
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
else
{
- BOOL bByVal = (nOp1 & 0x8000) != 0; // Ist BYVAL verlangt?
+ sal_Bool bByVal = (nOp1 & 0x8000) != 0; // Ist BYVAL verlangt?
SbxDataType t = (SbxDataType) (nOp1 & 0x7FFF);
SbxVariable* pVar = refArgv->Get( refArgv->Count() - 1 ); // letztes Arg
- // BYVAL prüfen
- if( pVar->GetRefCount() > 2 ) // 2 ist normal für BYVAL
+ // BYVAL pr�fen
+ if( pVar->GetRefCount() > 2 ) // 2 ist normal f�r BYVAL
{
// Parameter ist eine Referenz
if( bByVal )
@@ -132,7 +132,7 @@ void SbiRuntime::StepARGTYP( UINT32 nOp1 )
refExprStk->Put( pVar, refArgv->Count() - 1 );
}
else
- pVar->SetFlag( SBX_REFERENCE ); // Ref-Flag für DllMgr
+ pVar->SetFlag( SBX_REFERENCE ); // Ref-Flag f�r DllMgr
}
else
{
@@ -155,7 +155,7 @@ void SbiRuntime::StepARGTYP( UINT32 nOp1 )
// String auf feste Laenge bringen (+Laenge)
-void SbiRuntime::StepPAD( UINT32 nOp1 )
+void SbiRuntime::StepPAD( sal_uInt32 nOp1 )
{
SbxVariable* p = GetTOS();
String& s = (String&)(const String&) *p;
@@ -167,20 +167,20 @@ void SbiRuntime::StepPAD( UINT32 nOp1 )
// Sprung (+Target)
-void SbiRuntime::StepJUMP( UINT32 nOp1 )
+void SbiRuntime::StepJUMP( sal_uInt32 nOp1 )
{
#ifdef DBG_UTIL
// #QUESTION shouln't this be
- // if( (BYTE*)( nOp1+pImagGetCode() ) >= pImg->GetCodeSize() )
+ // if( (sal_uInt8*)( nOp1+pImagGetCode() ) >= pImg->GetCodeSize() )
if( nOp1 >= pImg->GetCodeSize() )
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
#endif
- pCode = (const BYTE*) pImg->GetCode() + nOp1;
+ pCode = (const sal_uInt8*) pImg->GetCode() + nOp1;
}
// TOS auswerten, bedingter Sprung (+Target)
-void SbiRuntime::StepJUMPT( UINT32 nOp1 )
+void SbiRuntime::StepJUMPT( sal_uInt32 nOp1 )
{
SbxVariableRef p = PopVar();
if( p->GetBool() )
@@ -189,7 +189,7 @@ void SbiRuntime::StepJUMPT( UINT32 nOp1 )
// TOS auswerten, bedingter Sprung (+Target)
-void SbiRuntime::StepJUMPF( UINT32 nOp1 )
+void SbiRuntime::StepJUMPF( sal_uInt32 nOp1 )
{
SbxVariableRef p = PopVar();
// In a test e.g. If Null then
@@ -206,36 +206,34 @@ void SbiRuntime::StepJUMPF( UINT32 nOp1 )
// ...
//Falls im Operanden 0x8000 gesetzt ist, Returnadresse pushen (ON..GOSUB)
-void SbiRuntime::StepONJUMP( UINT32 nOp1 )
+void SbiRuntime::StepONJUMP( sal_uInt32 nOp1 )
{
SbxVariableRef p = PopVar();
- INT16 n = p->GetInteger();
+ sal_Int16 n = p->GetInteger();
if( nOp1 & 0x8000 )
{
nOp1 &= 0x7FFF;
- //PushGosub( pCode + 3 * nOp1 );
PushGosub( pCode + 5 * nOp1 );
}
- if( n < 1 || static_cast<UINT32>(n) > nOp1 )
- n = static_cast<INT16>( nOp1 + 1 );
- //nOp1 = (UINT32) ( (const char*) pCode - pImg->GetCode() ) + 3 * --n;
- nOp1 = (UINT32) ( (const char*) pCode - pImg->GetCode() ) + 5 * --n;
+ if( n < 1 || static_cast<sal_uInt32>(n) > nOp1 )
+ n = static_cast<sal_Int16>( nOp1 + 1 );
+ nOp1 = (sal_uInt32) ( (const char*) pCode - pImg->GetCode() ) + 5 * --n;
StepJUMP( nOp1 );
}
// UP-Aufruf (+Target)
-void SbiRuntime::StepGOSUB( UINT32 nOp1 )
+void SbiRuntime::StepGOSUB( sal_uInt32 nOp1 )
{
PushGosub( pCode );
if( nOp1 >= pImg->GetCodeSize() )
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
- pCode = (const BYTE*) pImg->GetCode() + nOp1;
+ pCode = (const sal_uInt8*) pImg->GetCode() + nOp1;
}
// UP-Return (+0 oder Target)
-void SbiRuntime::StepRETURN( UINT32 nOp1 )
+void SbiRuntime::StepRETURN( sal_uInt32 nOp1 )
{
PopGosub();
if( nOp1 )
@@ -244,7 +242,7 @@ void SbiRuntime::StepRETURN( UINT32 nOp1 )
// FOR-Variable testen (+Endlabel)
-void SbiRuntime::StepTESTFOR( UINT32 nOp1 )
+void SbiRuntime::StepTESTFOR( sal_uInt32 nOp1 )
{
if( !pForStk )
{
@@ -307,7 +305,7 @@ void SbiRuntime::StepTESTFOR( UINT32 nOp1 )
{
BasicCollection* pCollection = (BasicCollection*)(SbxVariable*)pForStk->refEnd;
SbxArrayRef xItemArray = pCollection->xItemArray;
- INT32 nCount = xItemArray->Count32();
+ sal_Int32 nCount = xItemArray->Count32();
if( pForStk->nCurCollectionIndex < nCount )
{
SbxVariable* pRes = xItemArray->Get32( pForStk->nCurCollectionIndex );
@@ -346,7 +344,7 @@ void SbiRuntime::StepTESTFOR( UINT32 nOp1 )
// Tos+1 <= Tos+2 <= Tos, 2xremove (+Target)
-void SbiRuntime::StepCASETO( UINT32 nOp1 )
+void SbiRuntime::StepCASETO( sal_uInt32 nOp1 )
{
if( !refCaseStk || !refCaseStk->Count() )
StarBASIC::FatalError( SbERR_INTERNAL_ERROR );
@@ -362,9 +360,9 @@ void SbiRuntime::StepCASETO( UINT32 nOp1 )
// Fehler-Handler
-void SbiRuntime::StepERRHDL( UINT32 nOp1 )
+void SbiRuntime::StepERRHDL( sal_uInt32 nOp1 )
{
- const BYTE* p = pCode;
+ const sal_uInt8* p = pCode;
StepJUMP( nOp1 );
pError = pCode;
pCode = p;
@@ -377,9 +375,9 @@ void SbiRuntime::StepERRHDL( UINT32 nOp1 )
// Resume nach Fehlern (+0=statement, 1=next or Label)
-void SbiRuntime::StepRESUME( UINT32 nOp1 )
+void SbiRuntime::StepRESUME( sal_uInt32 nOp1 )
{
- // AB #32714 Resume ohne Error? -> Fehler
+ // #32714 Resume ohne Error? -> Fehler
if( !bInError )
{
Error( SbERR_BAD_RESUME );
@@ -388,8 +386,8 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 )
if( nOp1 )
{
// Code-Zeiger auf naechstes Statement setzen
- USHORT n1, n2;
- pCode = pMod->FindNextStmnt( pErrCode, n1, n2, TRUE, pImg );
+ sal_uInt16 n1, n2;
+ pCode = pMod->FindNextStmnt( pErrCode, n1, n2, sal_True, pImg );
}
else
pCode = pErrStmnt;
@@ -402,7 +400,7 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 )
pInst->nErr = 0;
pInst->nErl = 0;
nError = 0;
- bInError = FALSE;
+ bInError = sal_False;
// Error-Stack loeschen
SbErrorStack*& rErrStack = GetSbData()->pErrStack;
@@ -411,7 +409,7 @@ void SbiRuntime::StepRESUME( UINT32 nOp1 )
}
// Kanal schliessen (+Kanal, 0=Alle)
-void SbiRuntime::StepCLOSE( UINT32 nOp1 )
+void SbiRuntime::StepCLOSE( sal_uInt32 nOp1 )
{
SbError err;
if( !nOp1 )
@@ -430,7 +428,7 @@ void SbiRuntime::StepCLOSE( UINT32 nOp1 )
// Zeichen ausgeben (+char)
-void SbiRuntime::StepPRCHAR( UINT32 nOp1 )
+void SbiRuntime::StepPRCHAR( sal_uInt32 nOp1 )
{
ByteString s( (char) nOp1 );
pIosys->Write( s );
@@ -521,7 +519,7 @@ bool SbiRuntime::checkClass_Impl( const SbxVariableRef& refVal,
return bOk;
}
-void SbiRuntime::StepSETCLASS_impl( UINT32 nOp1, bool bHandleDflt )
+void SbiRuntime::StepSETCLASS_impl( sal_uInt32 nOp1, bool bHandleDflt )
{
SbxVariableRef refVal = PopVar();
SbxVariableRef refVar = PopVar();
@@ -532,17 +530,17 @@ void SbiRuntime::StepSETCLASS_impl( UINT32 nOp1, bool bHandleDflt )
StepSET_Impl( refVal, refVar, bHandleDflt ); // don't do handle dflt prop for a "proper" set
}
-void SbiRuntime::StepVBASETCLASS( UINT32 nOp1 )
+void SbiRuntime::StepVBASETCLASS( sal_uInt32 nOp1 )
{
StepSETCLASS_impl( nOp1, false );
}
-void SbiRuntime::StepSETCLASS( UINT32 nOp1 )
+void SbiRuntime::StepSETCLASS( sal_uInt32 nOp1 )
{
StepSETCLASS_impl( nOp1, true );
}
-void SbiRuntime::StepTESTCLASS( UINT32 nOp1 )
+void SbiRuntime::StepTESTCLASS( sal_uInt32 nOp1 )
{
SbxVariableRef xObjVal = PopVar();
String aClass( pImg->GetString( static_cast<short>( nOp1 ) ) );
@@ -556,7 +554,7 @@ void SbiRuntime::StepTESTCLASS( UINT32 nOp1 )
// Library fuer anschliessenden Declare-Call definieren
-void SbiRuntime::StepLIB( UINT32 nOp1 )
+void SbiRuntime::StepLIB( sal_uInt32 nOp1 )
{
aLibName = pImg->GetString( static_cast<short>( nOp1 ) );
}
@@ -565,14 +563,14 @@ void SbiRuntime::StepLIB( UINT32 nOp1 )
// Dieser Opcode wird vor DIM/REDIM-Anweisungen gepusht,
// wenn nur ein Index angegeben wurde.
-void SbiRuntime::StepBASED( UINT32 nOp1 )
+void SbiRuntime::StepBASED( sal_uInt32 nOp1 )
{
SbxVariable* p1 = new SbxVariable;
SbxVariableRef x2 = PopVar();
// #109275 Check compatiblity mode
bool bCompatible = ((nOp1 & 0x8000) != 0);
- USHORT uBase = static_cast<USHORT>(nOp1 & 1); // Can only be 0 or 1
+ sal_uInt16 uBase = static_cast<sal_uInt16>(nOp1 & 1); // Can only be 0 or 1
p1->PutInteger( uBase );
if( !bCompatible )
x2->Compute( SbxPLUS, *p1 );