use nullptr in lib/token.cpp
This commit is contained in:
parent
384ffb4173
commit
5fe78d1534
|
@ -50,9 +50,9 @@ Token::Token(Token **t) :
|
||||||
_isExpandedMacro(false),
|
_isExpandedMacro(false),
|
||||||
_isAttributeConstructor(false),
|
_isAttributeConstructor(false),
|
||||||
_isAttributeUnused(false),
|
_isAttributeUnused(false),
|
||||||
_astOperand1(NULL),
|
_astOperand1(nullptr),
|
||||||
_astOperand2(NULL),
|
_astOperand2(nullptr),
|
||||||
_astParent(NULL)
|
_astParent(nullptr)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -758,7 +758,7 @@ bool Token::Match(const Token *tok, const char pattern[], unsigned int varid)
|
||||||
|
|
||||||
std::size_t Token::getStrLength(const Token *tok)
|
std::size_t Token::getStrLength(const Token *tok)
|
||||||
{
|
{
|
||||||
assert(tok != NULL);
|
assert(tok != nullptr);
|
||||||
|
|
||||||
std::size_t len = 0;
|
std::size_t len = 0;
|
||||||
const std::string strValue(tok->strValue());
|
const std::string strValue(tok->strValue());
|
||||||
|
@ -782,7 +782,7 @@ std::size_t Token::getStrLength(const Token *tok)
|
||||||
|
|
||||||
std::string Token::getCharAt(const Token *tok, std::size_t index)
|
std::string Token::getCharAt(const Token *tok, std::size_t index)
|
||||||
{
|
{
|
||||||
assert(tok != NULL);
|
assert(tok != nullptr);
|
||||||
|
|
||||||
const std::string strValue(tok->strValue());
|
const std::string strValue(tok->strValue());
|
||||||
const char *str = strValue.c_str();
|
const char *str = strValue.c_str();
|
||||||
|
@ -850,7 +850,7 @@ const Token * Token::findClosingBracket() const
|
||||||
|
|
||||||
if (_str == "<") {
|
if (_str == "<") {
|
||||||
unsigned int depth = 0;
|
unsigned int depth = 0;
|
||||||
for (closing = this; closing != NULL; closing = closing->next()) {
|
for (closing = this; closing != nullptr; closing = closing->next()) {
|
||||||
if (closing->str() == "{" || closing->str() == "[" || closing->str() == "(")
|
if (closing->str() == "{" || closing->str() == "[" || closing->str() == "(")
|
||||||
closing = closing->link();
|
closing = closing->link();
|
||||||
else if (closing->str() == "}" || closing->str() == "]" || closing->str() == ")" || closing->str() == ";" || closing->str() == "=")
|
else if (closing->str() == "}" || closing->str() == "]" || closing->str() == ")" || closing->str() == ";" || closing->str() == "=")
|
||||||
|
@ -1009,8 +1009,8 @@ void Token::eraseTokens(Token *begin, const Token *end)
|
||||||
|
|
||||||
void Token::createMutualLinks(Token *begin, Token *end)
|
void Token::createMutualLinks(Token *begin, Token *end)
|
||||||
{
|
{
|
||||||
assert(begin != NULL);
|
assert(begin != nullptr);
|
||||||
assert(end != NULL);
|
assert(end != nullptr);
|
||||||
assert(begin != end);
|
assert(begin != end);
|
||||||
begin->link(end);
|
begin->link(end);
|
||||||
end->link(begin);
|
end->link(begin);
|
||||||
|
|
Loading…
Reference in New Issue