diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2012-08-14 07:32:51 +0900 |
---|---|---|
committer | Takeshi Abe <tabe@fixedpoint.jp> | 2012-08-14 07:37:19 +0900 |
commit | 1f224b02c8e9ff9420cec310a3bab567fc653c5f (patch) | |
tree | 8273ae8d75b86bed9ed36a8dfce72623bedcb3d4 /basic | |
parent | d170a36bbfc41d6a7d12a7ad242efe89b5f7e306 (diff) |
sal_Bool to bool
Change-Id: Idb5ef3cebdd45bd91f7c0ae34e422fd651d395c9
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/dim.cxx | 14 | ||||
-rw-r--r-- | basic/source/comp/exprnode.cxx | 16 | ||||
-rw-r--r-- | basic/source/comp/exprtree.cxx | 29 | ||||
-rw-r--r-- | basic/source/comp/symtbl.cxx | 4 | ||||
-rw-r--r-- | basic/source/inc/expr.hxx | 60 | ||||
-rw-r--r-- | basic/source/runtime/step1.cxx | 2 |
6 files changed, 61 insertions, 64 deletions
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx index b5357cb2c823..7fa0c00e0b37 100644 --- a/basic/source/comp/dim.cxx +++ b/basic/source/comp/dim.cxx @@ -867,21 +867,21 @@ SbiProcDef* SbiParser::ProcDecl( sal_Bool bDecl ) Next(); else for(;;) { - sal_Bool bByVal = sal_False; - sal_Bool bOptional = sal_False; - sal_Bool bParamArray = sal_False; + bool bByVal = false; + bool bOptional = false; + bool bParamArray = false; while( Peek() == BYVAL || Peek() == BYREF || Peek() == _OPTIONAL_ ) { - if ( Peek() == BYVAL ) Next(), bByVal = sal_True; - else if ( Peek() == BYREF ) Next(), bByVal = sal_False; - else if ( Peek() == _OPTIONAL_ ) Next(), bOptional = sal_True; + if ( Peek() == BYVAL ) Next(), bByVal = true; + else if ( Peek() == BYREF ) Next(), bByVal = false; + else if ( Peek() == _OPTIONAL_ ) Next(), bOptional = true; } if( bCompatible && Peek() == PARAMARRAY ) { if( bByVal || bOptional ) Error( SbERR_UNEXPECTED, PARAMARRAY ); Next(); - bParamArray = sal_True; + bParamArray = true; } SbiSymDef* pPar = VarDecl( NULL, sal_False, sal_False ); if( !pPar ) diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx index 8f1ca35a7584..a863413a65ba 100644 --- a/basic/source/comp/exprnode.cxx +++ b/basic/source/comp/exprnode.cxx @@ -158,7 +158,7 @@ SbiExprNode* SbiExprNode::GetRealNode() // This method transform the type, if it fits into the Integer range -sal_Bool SbiExprNode::IsIntConst() +bool SbiExprNode::IsIntConst() { if( eNodeType == SbxNUMVAL ) { @@ -169,24 +169,24 @@ sal_Bool SbiExprNode::IsIntConst() { nVal = (double) (short) nVal; eType = SbxINTEGER; - return sal_True; + return true; } } } - return sal_False; + return false; } -sal_Bool SbiExprNode::IsNumber() +bool SbiExprNode::IsNumber() { - return sal_Bool( eNodeType == SbxNUMVAL ); + return eNodeType == SbxNUMVAL; } -sal_Bool SbiExprNode::IsVariable() +bool SbiExprNode::IsVariable() { - return sal_Bool( eNodeType == SbxVARVAL ); + return eNodeType == SbxVARVAL; } -sal_Bool SbiExprNode::IsLvalue() +bool SbiExprNode::IsLvalue() { return IsVariable(); } diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx index 053bf42f4780..710965dd56cb 100644 --- a/basic/source/comp/exprtree.cxx +++ b/basic/source/comp/exprtree.cxx @@ -32,8 +32,7 @@ SbiExpression::SbiExpression( SbiParser* p, SbiExprType t, SbiExprMode eMode, const KeywordSymbolInfo* pKeywordSymbolInfo ) { pParser = p; - bError = false; - bByVal = bBased = bBracket = sal_False; + bBased = bError = bByVal = bBracket = false; nParenLevel = 0; eCurExpr = t; m_eMode = eMode; @@ -52,8 +51,7 @@ SbiExpression::SbiExpression( SbiParser* p, double n, SbxDataType t ) pParser = p; eCurExpr = SbOPERAND; pNext = NULL; - bError = false; - bByVal = bBased = bBracket = sal_False; + bBased = bError = bByVal = bBracket = false; pExpr = new SbiExprNode( pParser, n, t ); pExpr->Optimize(); } @@ -62,8 +60,7 @@ SbiExpression::SbiExpression( SbiParser* p, const SbiSymDef& r, SbiExprList* pPa { pParser = p; pNext = NULL; - bError = false; - bByVal = bBased = bBracket = sal_False; + bBased = bError = bByVal = bBracket = false; eCurExpr = SbOPERAND; pExpr = new SbiExprNode( pParser, r, SbxVARIANT, pPar ); } @@ -237,7 +234,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo ) && !pParser->WhiteSpace() ); if( bObj ) { - bBracket = sal_False; // Now the bracket for the first term is obsolete + bBracket = false; // Now the bracket for the first term is obsolete if( eType == SbxVARIANT ) eType = SbxOBJECT; else @@ -844,7 +841,7 @@ SbiExprList::SbiExprList( SbiParser* p ) nExpr = nDim = 0; bError = false; - bBracket = sal_False; + bBracket = false; } SbiExprList::~SbiExprList() @@ -898,7 +895,7 @@ void SbiExprList::addExpression( SbiExpression* pExpr ) // #i79918/#i80532: bConst has never been set to true // -> reused as bStandaloneExpression //SbiParameters::SbiParameters( SbiParser* p, sal_Bool bConst, sal_Bool bPar) : -SbiParameters::SbiParameters( SbiParser* p, sal_Bool bStandaloneExpression, sal_Bool bPar) : +SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPar) : SbiExprList( p ) { if( !bPar ) @@ -917,7 +914,7 @@ SbiParameters::SbiParameters( SbiParser* p, sal_Bool bStandaloneExpression, sal_ } else { - bBracket = sal_True; + bBracket = true; pParser->Next(); eTok = pParser->Peek(); } @@ -960,20 +957,20 @@ SbiParameters::SbiParameters( SbiParser* p, sal_Bool bStandaloneExpression, sal_ SbiExprMode eModeAfter = pExpr->m_eMode; if( eModeAfter == EXPRMODE_LPAREN_NOT_NEEDED ) { - bBracket = sal_True; + bBracket = true; } else if( eModeAfter == EXPRMODE_ARRAY_OR_OBJECT ) { // Expression "looks" like an array assignment // a(...)[(...)] = ? or a(...).b(...) // RPAREN is already parsed - bBracket = sal_True; + bBracket = true; bAssumeArrayMode = true; eTok = NIL; } else if( eModeAfter == EXPRMODE_EMPTY_PAREN ) { - bBracket = sal_True; + bBracket = true; delete pExpr; if( bByVal ) pParser->Error( SbERR_LVALUE_EXPECTED ); @@ -1056,7 +1053,7 @@ SbiParameters::SbiParameters( SbiParser* p, sal_Bool bStandaloneExpression, sal_ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) { - bConst = sal_True; + bConst = true; if( pParser->Next() != LPAREN ) { @@ -1076,7 +1073,7 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) { pExpr2 = new SbiExpression( pParser ); eTok = pParser->Next(); - bConst &= pExpr1->IsIntConstant() & pExpr2->IsIntConstant(); + bConst = bConst && pExpr1->IsIntConstant() && pExpr2->IsIntConstant(); bError = bError || !pExpr1->IsValid() || !pExpr2->IsValid(); pExpr1->pNext = pExpr2; if( !pLast ) @@ -1090,7 +1087,7 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p ) { pExpr1->SetBased(); pExpr1->pNext = NULL; - bConst &= pExpr1->IsIntConstant(); + bConst = bConst && pExpr1->IsIntConstant(); bError = bError || !pExpr1->IsValid(); if( !pLast ) pFirst = pLast = pExpr1; diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 86fc853bab11..08f938238976 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -274,7 +274,7 @@ SbiSymDef::SbiSymDef( const String& rName ) : aName( rName ) bWithBrackets = bByVal = bChained = - bGlobal = sal_False; + bGlobal = false; pIn = pPool = NULL; nDefaultId = 0; @@ -344,7 +344,7 @@ sal_uInt32 SbiSymDef::Define() pIn->pParser->aGen.GenStmnt(); if( nChain ) pIn->pParser->aGen.BackChain( nChain ); nChain = n; - bChained = sal_True; + bChained = true; return nChain; } diff --git a/basic/source/inc/expr.hxx b/basic/source/inc/expr.hxx index 4b10c14ab425..fa1dbac7c20c 100644 --- a/basic/source/inc/expr.hxx +++ b/basic/source/inc/expr.hxx @@ -105,14 +105,14 @@ class SbiExprNode { // operators (and operands) bool bError; // true: error void FoldConstants(); void CollectBits(); // converting numbers to strings - sal_Bool IsOperand() - { return sal_Bool( eNodeType != SbxNODE && eNodeType != SbxTYPEOF && eNodeType != SbxNEW ); } - sal_Bool IsTypeOf() - { return sal_Bool( eNodeType == SbxTYPEOF ); } - sal_Bool IsNew() - { return sal_Bool( eNodeType == SbxNEW ); } - sal_Bool IsNumber(); - sal_Bool IsLvalue(); // sal_True, if usable as Lvalue + bool IsOperand() + { return eNodeType != SbxNODE && eNodeType != SbxTYPEOF && eNodeType != SbxNEW; } + bool IsTypeOf() + { return eNodeType == SbxTYPEOF; } + bool IsNew() + { return eNodeType == SbxNEW; } + bool IsNumber(); + bool IsLvalue(); // true, if usable as Lvalue void GenElement( SbiOpcode ); void BaseInit( SbiParser* p ); // help function for Ctor, from 17.12.95 public: @@ -126,10 +126,10 @@ public: virtual ~SbiExprNode(); bool IsValid() { return !bError; } - sal_Bool IsConstant() // sal_True constant operand - { return sal_Bool( eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL ); } - sal_Bool IsIntConst(); - sal_Bool IsVariable(); + bool IsConstant() // true: constant operand + { return eNodeType == SbxSTRVAL || eNodeType == SbxNUMVAL; } + bool IsIntConst(); + bool IsVariable(); SbiExprNode* GetWithParent() { return pWithParent; } void SetWithParent( SbiExprNode* p ) { pWithParent = p; } @@ -162,10 +162,10 @@ protected: SbiExprNode* pExpr; // expression tree SbiExprType eCurExpr; // type of expression SbiExprMode m_eMode; // expression context - sal_Bool bBased; // sal_True: easy DIM-part (+BASE) + bool bBased; // true: easy DIM-part (+BASE) bool bError; - sal_Bool bByVal; // sal_True: ByVal-Parameter - sal_Bool bBracket; // sal_True: Parameter list with brackets + bool bByVal; // true: ByVal-Parameter + bool bBracket; // true: Parameter list with brackets sal_uInt16 nParenLevel; SbiExprNode* Term( const KeywordSymbolInfo* pKeywordSymbolInfo = NULL ); SbiExprNode* ObjTerm( SbiSymDef& ); @@ -188,16 +188,16 @@ public: SbiExpression( SbiParser*, const SbiSymDef&, SbiExprList* = NULL ); ~SbiExpression(); String& GetName() { return aArgName; } - void SetBased() { bBased = sal_True; } - sal_Bool IsBased() { return bBased; } - void SetByVal() { bByVal = sal_True; } - sal_Bool IsByVal() { return bByVal; } - sal_Bool IsBracket() { return bBracket; } - sal_Bool IsValid() { return pExpr->IsValid(); } - sal_Bool IsConstant() { return pExpr->IsConstant(); } - sal_Bool IsVariable() { return pExpr->IsVariable(); } - sal_Bool IsLvalue() { return pExpr->IsLvalue(); } - sal_Bool IsIntConstant() { return pExpr->IsIntConst(); } + void SetBased() { bBased = true; } + bool IsBased() { return bBased; } + void SetByVal() { bByVal = true; } + bool IsByVal() { return bByVal; } + bool IsBracket() { return bBracket; } + bool IsValid() { return pExpr->IsValid(); } + bool IsConstant() { return pExpr->IsConstant(); } + bool IsVariable() { return pExpr->IsVariable(); } + bool IsLvalue() { return pExpr->IsLvalue(); } + bool IsIntConstant() { return pExpr->IsIntConst(); } const String& GetString() { return pExpr->GetString(); } SbiSymDef* GetVar() { return pExpr->GetVar(); } SbiSymDef* GetRealVar() { return pExpr->GetRealVar(); } @@ -226,11 +226,11 @@ protected: short nExpr; short nDim; bool bError; - sal_Bool bBracket; + bool bBracket; public: SbiExprList( SbiParser* ); virtual ~SbiExprList(); - sal_Bool IsBracket() { return bBracket; } + bool IsBracket() { return bBracket; } bool IsValid() { return !bError; } short GetSize() { return nExpr; } short GetDims() { return nDim; } @@ -242,14 +242,14 @@ public: class SbiParameters : public SbiExprList { public: - SbiParameters( SbiParser*, sal_Bool bConst = sal_False, sal_Bool bPar = sal_True);// parsing Ctor + SbiParameters( SbiParser*, bool bStandaloneExpression = false, bool bPar = true);// parsing Ctor }; class SbiDimList : public SbiExprList { - sal_Bool bConst; // sal_True: everything integer constants + bool bConst; // true: everything integer constants public: SbiDimList( SbiParser* ); // parsing Ctor - sal_Bool IsConstant() { return bConst; } + bool IsConstant() { return bConst; } }; #endif diff --git a/basic/source/runtime/step1.cxx b/basic/source/runtime/step1.cxx index 2f52b44a35d2..cd63c8091eea 100644 --- a/basic/source/runtime/step1.cxx +++ b/basic/source/runtime/step1.cxx @@ -104,7 +104,7 @@ void SbiRuntime::StepARGTYP( sal_uInt32 nOp1 ) StarBASIC::FatalError( SbERR_INTERNAL_ERROR ); else { - sal_Bool bByVal = (nOp1 & 0x8000) != 0; // Ist BYVAL requested? + bool bByVal = (nOp1 & 0x8000) != 0; // Ist BYVAL requested? SbxDataType t = (SbxDataType) (nOp1 & 0x7FFF); SbxVariable* pVar = refArgv->Get( refArgv->Count() - 1 ); // last Arg |