diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2013-10-01 23:16:43 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2013-10-02 10:00:44 +0900 |
commit | ea1e3b77d43f770715e796d64e4054cec651898f (patch) | |
tree | e3847f8505b434dff83f33b7f38709724aa0cfa0 /basic/source/comp | |
parent | 111a2b94fd6f217d91c9a057086b3d2dfa752c5b (diff) |
sal_Bool to bool
Change-Id: I16ddbcf100e21d6c05fccbe24faca2932a605902
Diffstat (limited to 'basic/source/comp')
-rw-r--r-- | basic/source/comp/exprnode.cxx | 26 | ||||
-rw-r--r-- | basic/source/comp/exprtree.cxx | 32 | ||||
-rw-r--r-- | basic/source/comp/loops.cxx | 8 | ||||
-rw-r--r-- | basic/source/comp/parser.cxx | 8 |
4 files changed, 37 insertions, 37 deletions
diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx index 49911c1ad344..53ef38d0587e 100644 --- a/basic/source/comp/exprnode.cxx +++ b/basic/source/comp/exprnode.cxx @@ -311,11 +311,11 @@ void SbiExprNode::FoldConstants() || eTok == IDIV || eTok == MOD ) { // Integer operations - sal_Bool err = sal_False; - if( nl > SbxMAXLNG ) err = sal_True, nl = SbxMAXLNG; - else if( nl < SbxMINLNG ) err = sal_True, nl = SbxMINLNG; - if( nr > SbxMAXLNG ) err = sal_True, nr = SbxMAXLNG; - else if( nr < SbxMINLNG ) err = sal_True, nr = SbxMINLNG; + bool err = false; + if( nl > SbxMAXLNG ) err = true, nl = SbxMAXLNG; + else if( nl < SbxMINLNG ) err = true, nl = SbxMINLNG; + if( nr > SbxMAXLNG ) err = true, nr = SbxMAXLNG; + else if( nr < SbxMINLNG ) err = true, nr = SbxMINLNG; ll = (long) nl; lr = (long) nr; llMod = (long) (nl < 0 ? nl - 0.5 : nl + 0.5); lrMod = (long) (nr < 0 ? nr - 0.5 : nr + 0.5); @@ -325,20 +325,20 @@ void SbiExprNode::FoldConstants() bError = true; } } - sal_Bool bBothInt = sal_Bool( pLeft->eType < SbxSINGLE + bool bBothInt = ( pLeft->eType < SbxSINGLE && pRight->eType < SbxSINGLE ); delete pLeft; pLeft = NULL; delete pRight; pRight = NULL; nVal = 0; eType = SbxDOUBLE; eNodeType = SbxNUMVAL; - sal_Bool bCheckType = sal_False; + bool bCheckType = false; switch( eTok ) { case EXPON: nVal = pow( nl, nr ); break; case MUL: - bCheckType = sal_True; + bCheckType = true; nVal = nl * nr; break; case DIV: if( !nr ) @@ -348,10 +348,10 @@ void SbiExprNode::FoldConstants() } else nVal = nl / nr; break; case PLUS: - bCheckType = sal_True; + bCheckType = true; nVal = nl + nr; break; case MINUS: - bCheckType = sal_True; + bCheckType = true; nVal = nl - nr; break; case EQ: nVal = ( nl == nr ) ? SbxTRUE : SbxFALSE; @@ -427,9 +427,9 @@ void SbiExprNode::FoldConstants() nVal = -nVal; break; case NOT: { // Integer operation! - sal_Bool err = sal_False; - if( nVal > SbxMAXLNG ) err = sal_True, nVal = SbxMAXLNG; - else if( nVal < SbxMINLNG ) err = sal_True, nVal = SbxMINLNG; + bool err = false; + if( nVal > SbxMAXLNG ) err = true, nVal = SbxMAXLNG; + else if( nVal < SbxMINLNG ) err = true, nVal = SbxMINLNG; if( err ) { pGen->GetParser()->Error( SbERR_MATH_OVERFLOW ); diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index fe5077b3ad42..e77bf77923af 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -85,21 +85,21 @@ SbiExpression::~SbiExpression() // Are there parameters without brackets following? This may be a number, // a string, a symbol or also a comma (if the 1st parameter is missing) -static sal_Bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTok ) +static bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken eTok ) { if( eTok == LPAREN ) { - return sal_True; + return true; } // but only if similar to CALL! if( !p->WhiteSpace() || eCurExpr != SbSYMBOL ) { - return sal_False; + return false; } if ( eTok == NUMBER || eTok == MINUS || eTok == FIXSTRING || eTok == SYMBOL || eTok == COMMA || eTok == DOT || eTok == NOT || eTok == BYVAL ) { - return sal_True; + return true; } else // check for default params with reserved names ( e.g. names of tokens ) { @@ -108,10 +108,10 @@ static sal_Bool DoParametersFollow( SbiParser* p, SbiExprType eCurExpr, SbiToken tokens.Next(); if ( tokens.Peek() == ASSIGN ) { - return sal_True; + return true; } } - return sal_False; + return false; } // definition of a new symbol @@ -121,7 +121,7 @@ static SbiSymDef* AddSym ( SbiToken eTok, SbiSymPool& rPool, SbiExprType eCurExp { SbiSymDef* pDef; // A= is not a procedure - sal_Bool bHasType = sal_Bool( eTok == EQ || eTok == DOT ); + bool bHasType = ( eTok == EQ || eTok == DOT ); if( ( !bHasType && eCurExpr == SbSYMBOL ) || pPar ) { // so this is a procedure @@ -137,7 +137,7 @@ static SbiSymDef* AddSym ( SbiToken eTok, SbiSymPool& rPool, SbiExprType eCurExp // special treatment for Colls like Documents(1) if( eCurExpr == SbSTDEXPR ) { - bHasType = sal_True; + bHasType = true; } pDef = pProc; pDef->SetType( bHasType ? eType : SbxEMPTY ); @@ -249,7 +249,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) // It might be an object part, if . or ! is following. // In case of . the variable must already be defined; // it's an object, if pDef is NULL after the search. - sal_Bool bObj = sal_Bool( ( eTok == DOT || eTok == EXCLAM ) + bool bObj = ( ( eTok == DOT || eTok == EXCLAM ) && !pParser->WhiteSpace() ); if( bObj ) { @@ -444,7 +444,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj ) eTok = pParser->Peek(); } } - sal_Bool bObj = sal_Bool( ( eTok == DOT || eTok == EXCLAM ) && !pParser->WhiteSpace() ); + bool bObj = ( ( eTok == DOT || eTok == EXCLAM ) && !pParser->WhiteSpace() ); if( bObj ) { if( eType == SbxVARIANT ) @@ -846,22 +846,22 @@ SbiConstExpression::SbiConstExpression( SbiParser* p ) : SbiExpression( p ) else { // #40204 special treatment for sal_Bool-constants - sal_Bool bIsBool = sal_False; + bool bIsBool = false; if( pExpr->eNodeType == SbxVARVAL ) { SbiSymDef* pVarDef = pExpr->GetVar(); - sal_Bool bBoolVal = sal_False; + bool bBoolVal = false; if( pVarDef->GetName().equalsIgnoreAsciiCase( "true" ) ) { - bIsBool = sal_True; - bBoolVal = sal_True; + bIsBool = true; + bBoolVal = true; } else if( pVarDef->GetName().equalsIgnoreAsciiCase( "false" ) ) //else if( pVarDef->GetName().ICompare( "false" ) == COMPARE_EQUAL ) { - bIsBool = sal_True; - bBoolVal = sal_False; + bIsBool = true; + bBoolVal = false; } if( bIsBool ) diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx index 127ec8809c6a..e486039f14ad 100644 --- a/basic/source/comp/loops.cxx +++ b/basic/source/comp/loops.cxx @@ -358,7 +358,7 @@ void SbiParser::Select() TestEoln(); sal_uInt32 nNextTarget = 0; sal_uInt32 nDoneTarget = 0; - sal_Bool bElse = sal_False; + bool bElse = false; while( !bAbort ) { @@ -369,13 +369,13 @@ void SbiParser::Select() aGen.BackChain( nNextTarget ), nNextTarget = 0; aGen.Statement(); - sal_Bool bDone = sal_False; + bool bDone = false; sal_uInt32 nTrueTarget = 0; if( Peek() == ELSE ) { // CASE ELSE Next(); - bElse = sal_True; + bElse = true; } else while( !bDone ) { @@ -415,7 +415,7 @@ void SbiParser::Select() } if( Peek() == COMMA ) Next(); - else TestEoln(), bDone = sal_True; + else TestEoln(), bDone = true; } if( !bElse ) diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx index 680f4dcd40cc..8ac380f0d65c 100644 --- a/basic/source/comp/parser.cxx +++ b/basic/source/comp/parser.cxx @@ -32,12 +32,12 @@ struct SbiParseStack { // "Stack" for statement-blocks struct SbiStatement { SbiToken eTok; void( SbiParser::*Func )(); - sal_Bool bMain; // sal_True: OK outside the SUB - sal_Bool bSubr; // sal_True: OK inside the SUB + bool bMain; // true: OK outside the SUB + bool bSubr; // true: OK inside the SUB }; -#define Y sal_True -#define N sal_False +#define Y true +#define N false static const SbiStatement StmntTable [] = { { ATTRIBUTE, &SbiParser::Attribute, Y, Y, }, // ATTRIBUTE |