summaryrefslogtreecommitdiff
path: root/basic/source/comp
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-11-10 10:10:36 +0100
committerStephan Bergmann <sbergman@redhat.com>2015-11-10 10:31:17 +0100
commit08e49fa3377d8c4e7e5df7a32233fcd9763ee936 (patch)
treef06399e5a005a70612093f415bd02ea2d1ba719f /basic/source/comp
parenta17cde058213f962b8de880de6f5b1e4f2061b37 (diff)
loplugin:nullptr (automatic rewrite)
Change-Id: I1ec9a671fe3ac838feb36297915e3cdf8749d944
Diffstat (limited to 'basic/source/comp')
-rw-r--r--basic/source/comp/basiccharclass.cxx4
-rw-r--r--basic/source/comp/buffer.cxx12
-rw-r--r--basic/source/comp/codegen.cxx6
-rw-r--r--basic/source/comp/dim.cxx44
-rw-r--r--basic/source/comp/exprgen.cxx6
-rw-r--r--basic/source/comp/exprnode.cxx24
-rw-r--r--basic/source/comp/exprtree.cxx50
-rw-r--r--basic/source/comp/parser.cxx10
-rw-r--r--basic/source/comp/sbcomp.cxx4
-rw-r--r--basic/source/comp/scanner.cxx10
-rw-r--r--basic/source/comp/symtbl.cxx16
11 files changed, 93 insertions, 93 deletions
diff --git a/basic/source/comp/basiccharclass.cxx b/basic/source/comp/basiccharclass.cxx
index 415e64fb6371..ecc40a769bb8 100644
--- a/basic/source/comp/basiccharclass.cxx
+++ b/basic/source/comp/basiccharclass.cxx
@@ -33,8 +33,8 @@ bool BasicCharClass::isLetter( sal_Unicode c )
bool BasicCharClass::isLetterUnicode( sal_Unicode c )
{
- static CharClass* pCharClass = NULL;
- if( pCharClass == NULL )
+ static CharClass* pCharClass = nullptr;
+ if( pCharClass == nullptr )
pCharClass = new CharClass( Application::GetSettings().GetLanguageTag() );
// can we get pCharClass to accept a sal_Unicode instead of this waste?
return pCharClass->isLetter( OUString(c), 0 );
diff --git a/basic/source/comp/buffer.cxx b/basic/source/comp/buffer.cxx
index 141186f8007d..1a4405caa379 100644
--- a/basic/source/comp/buffer.cxx
+++ b/basic/source/comp/buffer.cxx
@@ -32,8 +32,8 @@ SbiBuffer::SbiBuffer( SbiParser* p, short n )
pParser = p;
n = ( (n + 15 ) / 16 ) * 16;
if( !n ) n = 16;
- pBuf = NULL;
- pCur = NULL;
+ pBuf = nullptr;
+ pCur = nullptr;
nInc = n;
nSize =
nOff = 0;
@@ -50,8 +50,8 @@ SbiBuffer::~SbiBuffer()
char* SbiBuffer::GetBuffer()
{
char* p = pBuf;
- pBuf = NULL;
- pCur = NULL;
+ pBuf = nullptr;
+ pCur = nullptr;
return p;
}
@@ -79,7 +79,7 @@ bool SbiBuffer::Check( sal_Int32 n )
char* p;
if( ( nSize + nn ) > UP_LIMIT )
{
- p = NULL;
+ p = nullptr;
}
else
{
@@ -89,7 +89,7 @@ bool SbiBuffer::Check( sal_Int32 n )
{
pParser->Error( ERRCODE_BASIC_PROG_TOO_LARGE );
nInc = 0;
- delete[] pBuf; pBuf = NULL;
+ delete[] pBuf; pBuf = nullptr;
return false;
}
else
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index 5cafbaa78db4..4c202edf8bba 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -219,7 +219,7 @@ void SbiCodeGen::Save()
}
}
}
- SbMethod* pMeth = NULL;
+ SbMethod* pMeth = nullptr;
for( sal_uInt16 nPass = 0 ; nPass < nPassCount ; nPass++ )
{
if( nPass == 1 )
@@ -336,7 +336,7 @@ void SbiCodeGen::Save()
{
nUserData |= PARAM_INFO_WITHBRACKETS;
}
- SbxParamInfo* pParam = NULL;
+ SbxParamInfo* pParam = nullptr;
if( nUserData )
{
pParam = const_cast<SbxParamInfo*>(pInfo->GetParam( i ));
@@ -491,7 +491,7 @@ class BufferTransformer : public PCodeVisitor< T >
sal_uInt8* m_pStart;
SbiBuffer m_ConvertedBuf;
public:
- BufferTransformer():m_pStart(NULL), m_ConvertedBuf( NULL, 1024 ) {}
+ BufferTransformer():m_pStart(nullptr), m_ConvertedBuf( nullptr, 1024 ) {}
virtual void start( sal_uInt8* pStart ) override { m_pStart = pStart; }
virtual void processOpCode0( SbiOpcode eOp ) override
{
diff --git a/basic/source/comp/dim.cxx b/basic/source/comp/dim.cxx
index c4673712708c..fdca04d88826 100644
--- a/basic/source/comp/dim.cxx
+++ b/basic/source/comp/dim.cxx
@@ -47,10 +47,10 @@ SbiSymDef* SbiParser::VarDecl( SbiDimList** ppDim, bool bStatic, bool bConst )
Next();
bWithEvents = true;
}
- if( !TestSymbol() ) return NULL;
+ if( !TestSymbol() ) return nullptr;
SbxDataType t = eScanType;
SbiSymDef* pDef = bConst ? new SbiConstDef( aSym ) : new SbiSymDef( aSym );
- SbiDimList* pDim = NULL;
+ SbiDimList* pDim = nullptr;
// Brackets?
if( Peek() == LPAREN )
{
@@ -167,7 +167,7 @@ void SbiParser::TypeDecl( SbiSymDef& rDef, bool bAsNewAlreadyParsed )
// Take over in the string pool
rDef.SetTypeId( aGblStrings.Add( aCompleteName ) );
- if( rDef.IsNew() && pProc == NULL )
+ if( rDef.IsNew() && pProc == nullptr )
aRequiredTypes.push_back( aCompleteName );
}
eType = SbxOBJECT;
@@ -305,7 +305,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
}
bool bDefined = false;
- while( ( pDef = VarDecl( &pDim, bStatic, bConst ) ) != NULL )
+ while( ( pDef = VarDecl( &pDim, bStatic, bConst ) ) != nullptr )
{
/*fprintf(stderr, "Actual sub: \n");
fprintf(stderr, "Symbol name: %s\n",OUStringToOString(pDef->GetName(),RTL_TEXTENCODING_UTF8).getStr());*/
@@ -325,7 +325,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
if( pOld && !(eOp == _REDIM || eOp == _REDIMP) )
{
if( pDef->GetScope() == SbLOCAL && pOld->GetScope() != SbLOCAL )
- pOld = NULL;
+ pOld = nullptr;
}
if( pOld )
{
@@ -390,7 +390,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
if( nFixedStringLength >= 0 )
nOpnd2 |= (SBX_FIXED_LEN_STRING_FLAG + (sal_uInt32(nFixedStringLength) << 17)); // len = all bits above 0x10000
- if( pDim != NULL && pDim->GetDims() > 0 )
+ if( pDim != nullptr && pDim->GetDims() > 0 )
nOpnd2 |= SBX_TYPE_VAR_TO_DIM_FLAG;
aGen.Gen( eOp2, pDef->GetId(), nOpnd2 );
@@ -404,7 +404,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
if( !bCompatible && !pDef->IsNew() )
{
OUString aTypeName( aGblStrings.Find( pDef->GetTypeId() ) );
- if( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) == NULL )
+ if( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) == nullptr )
{
if( CodeCompleteOptions::IsExtendedTypeDeclaration() )
{
@@ -425,7 +425,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
{
if( eOp == _REDIMP )
{
- SbiExpression aExpr( this, *pDef, NULL );
+ SbiExpression aExpr( this, *pDef, nullptr );
aExpr.Gen();
aGen.Gen( _REDIMP_ERASE );
@@ -490,7 +490,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
// Delete the var at REDIM beforehand
if( eOp == _REDIM )
{
- SbiExpression aExpr( this, *pDef, NULL );
+ SbiExpression aExpr( this, *pDef, nullptr );
aExpr.Gen();
if ( bVBASupportOn )
// delete the array but
@@ -503,7 +503,7 @@ void SbiParser::DefVar( SbiOpcode eOp, bool bStatic )
}
else if( eOp == _REDIMP )
{
- SbiExpression aExpr( this, *pDef, NULL );
+ SbiExpression aExpr( this, *pDef, nullptr );
aExpr.Gen();
aGen.Gen( _REDIMP_ERASE );
}
@@ -589,7 +589,7 @@ void SbiParser::DefType( bool bPrivate )
SbxObject *pType = new SbxObject(aSym);
std::unique_ptr<SbiSymDef> pElem;
- SbiDimList* pDim = NULL;
+ SbiDimList* pDim = nullptr;
bool bDone = false;
while( !bDone && !IsEof() )
@@ -666,7 +666,7 @@ void SbiParser::DefType( bool bPrivate )
{
OUString aTypeName( aGblStrings.Find( nElemTypeId ) );
SbxObject* pTypeObj = static_cast< SbxObject* >( rTypeArray->Find( aTypeName, SbxCLASS_OBJECT ) );
- if( pTypeObj != NULL )
+ if( pTypeObj != nullptr )
{
SbxObject* pCloneObj = cloneTypeObjectImpl( *pTypeObj );
pTypeElem->PutObject( pCloneObj );
@@ -675,7 +675,7 @@ void SbiParser::DefType( bool bPrivate )
}
pTypeMembers->Insert( pTypeElem, pTypeMembers->Count() );
}
- delete pDim, pDim = NULL;
+ delete pDim, pDim = nullptr;
pElem.reset();
}
}
@@ -723,21 +723,21 @@ void SbiParser::DefEnum( bool bPrivate )
switch( Peek() )
{
case ENDENUM :
- pElem = NULL;
+ pElem = nullptr;
bDone = true;
Next();
break;
case EOLN :
case REM :
- pElem = NULL;
+ pElem = nullptr;
Next();
break;
default:
{
// TODO: Check existing!
- pDim = NULL;
+ pDim = nullptr;
pElem = VarDecl( &pDim, false, true );
if( !pElem )
{
@@ -830,7 +830,7 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
{
bool bFunc = ( eCurTok == FUNCTION );
bool bProp = ( eCurTok == GET || eCurTok == SET || eCurTok == LET );
- if( !TestSymbol() ) return NULL;
+ if( !TestSymbol() ) return nullptr;
OUString aName( aSym );
SbxDataType eType = eScanType;
SbiProcDef* pDef = new SbiProcDef( this, aName, true );
@@ -936,7 +936,7 @@ SbiProcDef* SbiParser::ProcDecl( bool bDecl )
Next();
bParamArray = true;
}
- SbiSymDef* pPar = VarDecl( NULL, false, false );
+ SbiSymDef* pPar = VarDecl( nullptr, false, false );
if( !pPar )
{
break;
@@ -1041,7 +1041,7 @@ void SbiParser::DefDeclare( bool bPrivate )
// Declared as a variable
Error( ERRCODE_BASIC_BAD_DECLARATION, pDef->GetName() );
delete pDef;
- pDef = NULL;
+ pDef = nullptr;
}
else
{
@@ -1214,7 +1214,7 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
// Declared as a variable
Error( ERRCODE_BASIC_BAD_DECLARATION, pDef->GetName() );
delete pDef;
- pProc = NULL;
+ pProc = nullptr;
bError_ = true;
}
// #100027: Multiple declaration -> Error
@@ -1226,7 +1226,7 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
{
Error( ERRCODE_BASIC_PROC_DEFINED, pDef->GetName() );
delete pDef;
- pProc = NULL;
+ pProc = nullptr;
bError_ = true;
}
}
@@ -1282,7 +1282,7 @@ void SbiParser::DefProc( bool bStatic, bool bPrivate )
pProc->GetLabels().CheckRefs();
CloseBlock();
aGen.Gen( _LEAVE );
- pProc = NULL;
+ pProc = nullptr;
}
// STATIC variable|procedure
diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx
index 93b8c8226e67..c1c74a0b2121 100644
--- a/basic/source/comp/exprgen.cxx
+++ b/basic/source/comp/exprgen.cxx
@@ -82,7 +82,7 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode )
}
else if( IsOperand() )
{
- SbiExprNode* pWithParent_ = NULL;
+ SbiExprNode* pWithParent_ = nullptr;
SbiOpcode eOp;
if( aVar.pDef->GetScope() == SbPARAM )
{
@@ -108,7 +108,7 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode )
}
}
// special treatment for WITH
- else if( (pWithParent_ = GetWithParent()) != NULL )
+ else if( (pWithParent_ = GetWithParent()) != nullptr )
{
eOp = _ELEM; // .-Term in WITH
}
@@ -133,7 +133,7 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode )
}
for( SbiExprNode* p = this; p; p = p->aVar.pNext )
{
- if( p == this && pWithParent_ != NULL )
+ if( p == this && pWithParent_ != nullptr )
{
pWithParent_->Gen(rGen);
}
diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx
index 1fecc7f17cc1..3bd9693e58b0 100644
--- a/basic/source/comp/exprnode.cxx
+++ b/basic/source/comp/exprnode.cxx
@@ -29,7 +29,7 @@
SbiExprNode::SbiExprNode( SbiExprNode* l, SbiToken t, SbiExprNode* r ) :
pLeft(l),
pRight(r),
- pWithParent(NULL),
+ pWithParent(nullptr),
eNodeType(SbxNODE),
eType(SbxVARIANT), // Nodes are always Variant
eTok(t),
@@ -39,7 +39,7 @@ SbiExprNode::SbiExprNode( SbiExprNode* l, SbiToken t, SbiExprNode* r ) :
SbiExprNode::SbiExprNode( double n, SbxDataType t ):
nVal(n),
- pWithParent(NULL),
+ pWithParent(nullptr),
eNodeType(SbxNUMVAL),
eType(t),
eTok(NIL),
@@ -49,7 +49,7 @@ SbiExprNode::SbiExprNode( double n, SbxDataType t ):
SbiExprNode::SbiExprNode( const OUString& rVal ):
aStrVal(rVal),
- pWithParent(NULL),
+ pWithParent(nullptr),
eNodeType(SbxSTRVAL),
eType(SbxSTRING),
eTok(NIL),
@@ -58,7 +58,7 @@ SbiExprNode::SbiExprNode( const OUString& rVal ):
}
SbiExprNode::SbiExprNode( const SbiSymDef& r, SbxDataType t, SbiExprList* l ) :
- pWithParent(NULL),
+ pWithParent(nullptr),
eNodeType(SbxVARVAL),
eTok(NIL),
bError(false)
@@ -66,15 +66,15 @@ SbiExprNode::SbiExprNode( const SbiSymDef& r, SbxDataType t, SbiExprList* l ) :
eType = ( t == SbxVARIANT ) ? r.GetType() : t;
aVar.pDef = const_cast<SbiSymDef*>(&r);
aVar.pPar = l;
- aVar.pvMorePar = NULL;
- aVar.pNext= NULL;
+ aVar.pvMorePar = nullptr;
+ aVar.pNext= nullptr;
}
// #120061 TypeOf
SbiExprNode::SbiExprNode( SbiExprNode* l, sal_uInt16 nId ) :
nTypeStrId(nId),
pLeft(l),
- pWithParent(NULL),
+ pWithParent(nullptr),
eNodeType(SbxTYPEOF),
eType(SbxBOOL),
eTok(NIL),
@@ -85,7 +85,7 @@ SbiExprNode::SbiExprNode( SbiExprNode* l, sal_uInt16 nId ) :
// new <type>
SbiExprNode::SbiExprNode( sal_uInt16 nId ) :
nTypeStrId(nId),
- pWithParent(NULL),
+ pWithParent(nullptr),
eNodeType(SbxNEW),
eType(SbxOBJECT),
eTok(NIL),
@@ -94,7 +94,7 @@ SbiExprNode::SbiExprNode( sal_uInt16 nId ) :
}
SbiExprNode::SbiExprNode() :
- pWithParent(NULL),
+ pWithParent(nullptr),
eNodeType(SbxDUMMY),
eType(SbxVARIANT),
eTok(NIL),
@@ -124,7 +124,7 @@ SbiSymDef* SbiExprNode::GetVar()
if( eNodeType == SbxVARVAL )
return aVar.pDef;
else
- return NULL;
+ return nullptr;
}
SbiSymDef* SbiExprNode::GetRealVar()
@@ -133,7 +133,7 @@ SbiSymDef* SbiExprNode::GetRealVar()
if( p )
return p->GetVar();
else
- return NULL;
+ return nullptr;
}
// From 1995-12-18
@@ -147,7 +147,7 @@ SbiExprNode* SbiExprNode::GetRealNode()
return p;
}
else
- return NULL;
+ return nullptr;
}
// This method transform the type, if it fits into the Integer range
diff --git a/basic/source/comp/exprtree.cxx b/basic/source/comp/exprtree.cxx
index 5850072bad31..b6ed8da20e77 100644
--- a/basic/source/comp/exprtree.cxx
+++ b/basic/source/comp/exprtree.cxx
@@ -36,7 +36,7 @@ SbiExpression::SbiExpression( SbiParser* p, SbiExprType t,
nParenLevel = 0;
eCurExpr = t;
m_eMode = eMode;
- pNext = NULL;
+ pNext = nullptr;
pExpr = (t != SbSTDEXPR ) ? Term( pKeywordSymbolInfo ) : Boolean();
if( t != SbSYMBOL )
{
@@ -59,7 +59,7 @@ SbiExpression::SbiExpression( SbiParser* p, double n, SbxDataType t )
nParenLevel = 0;
eCurExpr = SbOPERAND;
m_eMode = EXPRMODE_STANDARD;
- pNext = NULL;
+ pNext = nullptr;
pExpr = new SbiExprNode( n, t );
pExpr->Optimize(pParser);
}
@@ -71,7 +71,7 @@ SbiExpression::SbiExpression( SbiParser* p, const SbiSymDef& r, SbiExprList* pPa
nParenLevel = 0;
eCurExpr = SbOPERAND;
m_eMode = EXPRMODE_STANDARD;
- pNext = NULL;
+ pNext = nullptr;
pExpr = new SbiExprNode( r, SbxVARIANT, pPar );
}
@@ -175,8 +175,8 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
{
SbiExprNode* pWithVar = pParser->GetWithVar();
// #26608: get to the node-chain's end to pass the correct object
- SbiSymDef* pDef = pWithVar ? pWithVar->GetRealVar() : NULL;
- SbiExprNode* pNd = NULL;
+ SbiSymDef* pDef = pWithVar ? pWithVar->GetRealVar() : nullptr;
+ SbiExprNode* pNd = nullptr;
if( !pDef )
{
pParser->Next();
@@ -197,13 +197,13 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
return pNd;
}
- SbiToken eTok = (pKeywordSymbolInfo == NULL) ? pParser->Next() : pKeywordSymbolInfo->m_eTok;
+ SbiToken eTok = (pKeywordSymbolInfo == nullptr) ? pParser->Next() : pKeywordSymbolInfo->m_eTok;
// memorize the parsing's begin
pParser->LockColumn();
- OUString aSym( (pKeywordSymbolInfo == NULL) ? pParser->GetSym() : pKeywordSymbolInfo->m_aKeywordSymbol );
- SbxDataType eType = (pKeywordSymbolInfo == NULL) ? pParser->GetType() : pKeywordSymbolInfo->m_eSbxDataType;
- SbiParameters* pPar = NULL;
- SbiExprListVector* pvMoreParLcl = NULL;
+ OUString aSym( (pKeywordSymbolInfo == nullptr) ? pParser->GetSym() : pKeywordSymbolInfo->m_aKeywordSymbol );
+ SbxDataType eType = (pKeywordSymbolInfo == nullptr) ? pParser->GetType() : pKeywordSymbolInfo->m_eSbxDataType;
+ SbiParameters* pPar = nullptr;
+ SbiExprListVector* pvMoreParLcl = nullptr;
// are there parameters following?
SbiToken eNextTok = pParser->Peek();
// is it a known parameter?
@@ -234,7 +234,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
// i75443 check for additional sets of parameters
while( eTok == LPAREN )
{
- if( pvMoreParLcl == NULL )
+ if( pvMoreParLcl == nullptr )
{
pvMoreParLcl = new SbiExprListVector();
}
@@ -277,7 +277,7 @@ SbiExprNode* SbiExpression::Term( const KeywordSymbolInfo* pKeywordSymbolInfo )
SbxArray* pModMethods = rMod.GetMethods();
if( pModMethods->Find( aSym, SbxCLASS_DONTCARE ) )
{
- pDef = NULL;
+ pDef = nullptr;
}
}
if( !pDef )
@@ -414,12 +414,12 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj )
if( bError )
{
- return NULL;
+ return nullptr;
}
OUString aSym( pParser->GetSym() );
SbxDataType eType = pParser->GetType();
- SbiParameters* pPar = NULL;
- SbiExprListVector* pvMoreParLcl = NULL;
+ SbiParameters* pPar = nullptr;
+ SbiExprListVector* pvMoreParLcl = nullptr;
eTok = pParser->Peek();
if( DoParametersFollow( pParser, eCurExpr, eTok ) )
@@ -432,7 +432,7 @@ SbiExprNode* SbiExpression::ObjTerm( SbiSymDef& rObj )
// i109624 check for additional sets of parameters
while( eTok == LPAREN )
{
- if( pvMoreParLcl == NULL )
+ if( pvMoreParLcl == nullptr )
{
pvMoreParLcl = new SbiExprListVector();
}
@@ -590,7 +590,7 @@ SbiExprNode* SbiExpression::Unary()
case MINUS:
eTok = NEG;
pParser->Next();
- pNd = new SbiExprNode( Unary(), eTok, NULL );
+ pNd = new SbiExprNode( Unary(), eTok, nullptr );
break;
case NOT:
if( pParser->IsVBASupportOn() )
@@ -600,7 +600,7 @@ SbiExprNode* SbiExpression::Unary()
else
{
pParser->Next();
- pNd = new SbiExprNode( Unary(), eTok, NULL );
+ pNd = new SbiExprNode( Unary(), eTok, nullptr );
}
break;
case PLUS:
@@ -762,13 +762,13 @@ SbiExprNode* SbiExpression::Comp()
SbiExprNode* SbiExpression::VBA_Not()
{
- SbiExprNode* pNd = NULL;
+ SbiExprNode* pNd = nullptr;
SbiToken eTok = pParser->Peek();
if( eTok == NOT )
{
pParser->Next();
- pNd = new SbiExprNode( VBA_Not(), eTok, NULL );
+ pNd = new SbiExprNode( VBA_Not(), eTok, nullptr );
}
else
{
@@ -923,7 +923,7 @@ short SbiConstExpression::GetShortValue()
SbiExprList::SbiExprList( SbiParser* p )
{
pParser = p;
- pFirst = NULL;
+ pFirst = nullptr;
nExpr =
nDim = 0;
bError = false;
@@ -1020,7 +1020,7 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa
return;
}
// read in parameter table and lay down in correct order!
- SbiExpression* pLast = NULL;
+ SbiExpression* pLast = nullptr;
OUString aName;
while( !bError )
{
@@ -1089,7 +1089,7 @@ SbiParameters::SbiParameters( SbiParser* p, bool bStandaloneExpression, bool bPa
pExpr->GetName() = aName;
}
}
- pExpr->pNext = NULL;
+ pExpr->pNext = nullptr;
if( !pLast )
{
pFirst = pLast = pExpr;
@@ -1162,7 +1162,7 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p )
if( pParser->Peek() != RPAREN )
{
- SbiExpression *pExpr1, *pExpr2, *pLast = NULL;
+ SbiExpression *pExpr1, *pExpr2, *pLast = nullptr;
SbiToken eTok;
for( ;; )
{
@@ -1189,7 +1189,7 @@ SbiDimList::SbiDimList( SbiParser* p ) : SbiExprList( p )
else
{
pExpr1->SetBased();
- pExpr1->pNext = NULL;
+ pExpr1->pNext = nullptr;
bConst = bConst && pExpr1->IsIntConstant();
bError = bError || !pExpr1->IsValid();
if( !pLast )
diff --git a/basic/source/comp/parser.cxx b/basic/source/comp/parser.cxx
index 29533876dfb2..48acf02fa837 100644
--- a/basic/source/comp/parser.cxx
+++ b/basic/source/comp/parser.cxx
@@ -106,7 +106,7 @@ static const SbiStatement StmntTable [] = {
{ WITH, &SbiParser::With, N, Y, }, // WITH
{ WRITE, &SbiParser::Write, N, Y, }, // WRITE
-{ NIL, NULL, N, N }
+{ NIL, nullptr, N, N }
};
@@ -119,9 +119,9 @@ SbiParser::SbiParser( StarBASIC* pb, SbModule* pm )
{
eCurExpr = SbSYMBOL;
eEndTok = NIL;
- pProc = NULL;
- pStack = NULL;
- pWithVar = NULL;
+ pProc = nullptr;
+ pStack = nullptr;
+ pWithVar = nullptr;
nBase = 0;
bText =
bGblDefs =
@@ -479,7 +479,7 @@ SbiExprNode* SbiParser::GetWithVar()
return p->pWithVar;
p = p->pNext;
}
- return NULL;
+ return nullptr;
}
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index 96ec24c7dbd1..fad8e0618935 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -959,7 +959,7 @@ bool SbModule::Compile()
bool bRet = IsCompiled();
if( bRet )
{
- if( 0 == dynamic_cast<const SbObjModule*>( this) )
+ if( nullptr == dynamic_cast<const SbObjModule*>( this) )
pBasic->ClearAllModuleVars();
RemoveVars(); // remove 'this' Modules variables
// clear all method statics
@@ -971,7 +971,7 @@ bool SbModule::Compile()
}
// #i31510 Init other libs only if Basic isn't running
- if( GetSbData()->pInst == NULL )
+ if( GetSbData()->pInst == nullptr )
{
SbxObject* pParent_ = pBasic->GetParent();
if( pParent_ )
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 85b6c823d501..21188e1359cf 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -26,7 +26,7 @@
SbiScanner::SbiScanner( const OUString& rBuf, StarBASIC* p ) : aBuf( rBuf )
{
pBasic = p;
- pLine = NULL;
+ pLine = nullptr;
nVal = 0;
eScanType = SbxVARIANT;
nErrors = 0;
@@ -48,7 +48,7 @@ SbiScanner::SbiScanner( const OUString& rBuf, StarBASIC* p ) : aBuf( rBuf )
bInStatement =
bPrevLineExtentsComment = false;
bHash = true;
- pSaveLine = NULL;
+ pSaveLine = nullptr;
}
SbiScanner::~SbiScanner()
@@ -537,7 +537,7 @@ PrevLineCommentLbl:
if( bCompatible && pLine[ nLen - 1 ] == '_' && pLine[ nLen - 2 ] == ' ' )
bPrevLineExtentsComment = true;
nCol2 = nCol2 + nLen;
- pLine = NULL;
+ pLine = nullptr;
}
return true;
@@ -545,7 +545,7 @@ PrevLineCommentLbl:
eoln:
if( nCol && *--pLine == '_' )
{
- pLine = NULL;
+ pLine = nullptr;
bool bRes = NextSym();
if( bVBASupportOn && aSym[0] == '.' )
{
@@ -559,7 +559,7 @@ eoln:
}
else
{
- pLine = NULL;
+ pLine = nullptr;
nLine = nOldLine;
nCol1 = nOldCol1;
nCol2 = nOldCol2;
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index a0390af65d1e..ba20518753db 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -90,7 +90,7 @@ short SbiStringPool::Add( double n, SbxDataType t )
SbiSymPool::SbiSymPool( SbiStringPool& r, SbiSymScope s, SbiParser* pP ) : rStrings( r ), pParser( pP )
{
eScope = s;
- pParent = NULL;
+ pParent = nullptr;
nCur =
nProcId = 0;
}
@@ -108,7 +108,7 @@ SbiSymDef* SbiSymPool::First()
SbiSymDef* SbiSymPool::Next()
{
if (m_Data.size() <= ++nCur)
- return NULL;
+ return nullptr;
else
return m_Data[ nCur ].get();
}
@@ -195,7 +195,7 @@ SbiSymDef* SbiSymPool::Find( const OUString& rName )
}
else
{
- return NULL;
+ return nullptr;
}
}
@@ -206,7 +206,7 @@ SbiSymDef* SbiSymPool::Get( sal_uInt16 n )
{
if (m_Data.size() <= n)
{
- return NULL;
+ return nullptr;
}
else
{
@@ -283,7 +283,7 @@ SbiSymDef::SbiSymDef( const OUString& rName ) : aName( rName )
bChained =
bGlobal = false;
pIn =
- pPool = NULL;
+ pPool = nullptr;
nDefaultId = 0;
nFixedStringLength = -1;
}
@@ -295,12 +295,12 @@ SbiSymDef::~SbiSymDef()
SbiProcDef* SbiSymDef::GetProcDef()
{
- return NULL;
+ return nullptr;
}
SbiConstDef* SbiSymDef::GetConstDef()
{
- return NULL;
+ return nullptr;
}
@@ -431,7 +431,7 @@ void SbiProcDef::SetType( SbxDataType t )
void SbiProcDef::Match( SbiProcDef* pOld )
{
- SbiSymDef *pn=NULL;
+ SbiSymDef *pn=nullptr;
// parameter 0 is the function name
sal_uInt16 i;
for( i = 1; i < aParams.GetSize(); i++ )