aboutsummaryrefslogtreecommitdiffstats
path: root/NameAndTypeResolver.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-10-24 22:43:11 +0800
committerChristian <c@ethdev.com>2014-10-24 22:43:11 +0800
commitf8038792cab8ed7ffb75b12d01cbe8f5a93555fc (patch)
tree86a6f5e8638199bb78150918d9c228a7cfa54ffe /NameAndTypeResolver.cpp
parent1ae1fc66e2d02fc17d4148a553a59ead402b9f54 (diff)
downloaddexon-solidity-f8038792cab8ed7ffb75b12d01cbe8f5a93555fc.tar.gz
dexon-solidity-f8038792cab8ed7ffb75b12d01cbe8f5a93555fc.tar.zst
dexon-solidity-f8038792cab8ed7ffb75b12d01cbe8f5a93555fc.zip
Remove nullptr comparisons.
Diffstat (limited to 'NameAndTypeResolver.cpp')
-rw-r--r--NameAndTypeResolver.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/NameAndTypeResolver.cpp b/NameAndTypeResolver.cpp
index c0467b03..e9d90dc8 100644
--- a/NameAndTypeResolver.cpp
+++ b/NameAndTypeResolver.cpp
@@ -129,13 +129,13 @@ void DeclarationRegistrationHelper::enterNewSubScope(ASTNode& _node)
void DeclarationRegistrationHelper::closeCurrentScope()
{
- BOOST_ASSERT(m_currentScope != nullptr);
+ BOOST_ASSERT(m_currentScope);
m_currentScope = m_currentScope->getOuterScope();
}
void DeclarationRegistrationHelper::registerDeclaration(Declaration& _declaration, bool _opensScope)
{
- BOOST_ASSERT(m_currentScope != nullptr);
+ BOOST_ASSERT(m_currentScope);
if (!m_currentScope->registerDeclaration(_declaration))
BOOST_THROW_EXCEPTION(DeclarationError() << errinfo_sourceLocation(_declaration.getLocation())
<< errinfo_comment("Identifier already declared."));
@@ -155,14 +155,14 @@ void ReferencesResolver::endVisit(VariableDeclaration& _variable)
{
// endVisit because the internal type needs resolving if it is a user defined type
// or mapping
- if (_variable.getTypeName() != nullptr)
+ if (_variable.getTypeName())
_variable.setType(_variable.getTypeName()->toType());
// otherwise we have a "var"-declaration whose type is resolved by the first assignment
}
bool ReferencesResolver::visit(Return& _return)
{
- BOOST_ASSERT(m_returnParameters != nullptr);
+ BOOST_ASSERT(m_returnParameters);
_return.setFunctionReturnParameters(*m_returnParameters);
return true;
}
@@ -176,12 +176,12 @@ bool ReferencesResolver::visit(Mapping&)
bool ReferencesResolver::visit(UserDefinedTypeName& _typeName)
{
Declaration* declaration = m_resolver.getNameFromCurrentScope(_typeName.getName());
- if (declaration == nullptr)
+ if (!declaration)
BOOST_THROW_EXCEPTION(DeclarationError() << errinfo_sourceLocation(_typeName.getLocation())
<< errinfo_comment("Undeclared identifier."));
StructDefinition* referencedStruct = dynamic_cast<StructDefinition*>(declaration);
//@todo later, contracts are also valid types
- if (referencedStruct == nullptr)
+ if (!referencedStruct)
BOOST_THROW_EXCEPTION(_typeName.createTypeError("Identifier does not name a type name."));
_typeName.setReferencedStruct(*referencedStruct);
return false;
@@ -190,7 +190,7 @@ bool ReferencesResolver::visit(UserDefinedTypeName& _typeName)
bool ReferencesResolver::visit(Identifier& _identifier)
{
Declaration* declaration = m_resolver.getNameFromCurrentScope(_identifier.getName());
- if (declaration == nullptr)
+ if (!declaration)
BOOST_THROW_EXCEPTION(DeclarationError() << errinfo_sourceLocation(_identifier.getLocation())
<< errinfo_comment("Undeclared identifier."));
_identifier.setReferencedDeclaration(*declaration);