Removed std:: where it made sense.

This commit is contained in:
Christian
2014-10-24 19:42:38 +02:00
parent 58be273506
commit 6a96b6b5ad
5 changed files with 66 additions and 57 deletions
+11 -9
View File
@@ -26,6 +26,8 @@
#include <libsolidity/ASTVisitor.h>
#include <libsolidity/Exceptions.h>
using namespace std;
namespace dev
{
namespace solidity
@@ -248,7 +250,7 @@ void Literal::accept(ASTVisitor& _visitor)
_visitor.endVisit(*this);
}
TypeError ASTNode::createTypeError(std::string const& _description)
TypeError ASTNode::createTypeError(string const& _description)
{
return TypeError() << errinfo_sourceLocation(getLocation()) << errinfo_comment(_description);
}
@@ -263,7 +265,7 @@ void Statement::expectType(Expression& _expression, const Type& _expectedType)
void Block::checkTypeRequirements()
{
for (std::shared_ptr<Statement> const& statement: m_statements)
for (shared_ptr<Statement> const& statement: m_statements)
statement->checkTypeRequirements();
}
@@ -354,7 +356,7 @@ void BinaryOperation::checkTypeRequirements()
else
BOOST_THROW_EXCEPTION(createTypeError("No common type found in binary operation."));
if (Token::isCompareOp(m_operator))
m_type = std::make_shared<BoolType>();
m_type = make_shared<BoolType>();
else
{
assert(Token::isBinaryOp(m_operator));
@@ -392,7 +394,7 @@ void FunctionCall::checkTypeRequirements()
FunctionType const* function = dynamic_cast<FunctionType const*>(expressionType);
assert(function);
FunctionDefinition const& fun = function->getFunction();
std::vector<ASTPointer<VariableDeclaration>> const& parameters = fun.getParameters();
vector<ASTPointer<VariableDeclaration>> const& parameters = fun.getParameters();
if (parameters.size() != m_arguments.size())
BOOST_THROW_EXCEPTION(createTypeError("Wrong argument count for function call."));
for (size_t i = 0; i < m_arguments.size(); ++i)
@@ -401,7 +403,7 @@ void FunctionCall::checkTypeRequirements()
// @todo actually the return type should be an anonymous struct,
// but we change it to the type of the first return value until we have structs
if (fun.getReturnParameterList()->getParameters().empty())
m_type = std::make_shared<VoidType>();
m_type = make_shared<VoidType>();
else
m_type = fun.getReturnParameterList()->getParameters().front()->getType();
}
@@ -449,7 +451,7 @@ void Identifier::checkTypeRequirements()
if (structDef)
{
// note that we do not have a struct type here
m_type = std::make_shared<TypeType>(std::make_shared<StructType>(*structDef));
m_type = make_shared<TypeType>(make_shared<StructType>(*structDef));
return;
}
FunctionDefinition* functionDef = dynamic_cast<FunctionDefinition*>(m_referencedDeclaration);
@@ -458,13 +460,13 @@ void Identifier::checkTypeRequirements()
// a function reference is not a TypeType, because calling a TypeType converts to the type.
// Calling a function (e.g. function(12), otherContract.function(34)) does not do a type
// conversion.
m_type = std::make_shared<FunctionType>(*functionDef);
m_type = make_shared<FunctionType>(*functionDef);
return;
}
ContractDefinition* contractDef = dynamic_cast<ContractDefinition*>(m_referencedDeclaration);
if (contractDef)
{
m_type = std::make_shared<TypeType>(std::make_shared<ContractType>(*contractDef));
m_type = make_shared<TypeType>(make_shared<ContractType>(*contractDef));
return;
}
assert(false); // declaration reference of unknown/forbidden type
@@ -472,7 +474,7 @@ void Identifier::checkTypeRequirements()
void ElementaryTypeNameExpression::checkTypeRequirements()
{
m_type = std::make_shared<TypeType>(Type::fromElementaryTypeName(m_typeToken));
m_type = make_shared<TypeType>(Type::fromElementaryTypeName(m_typeToken));
}
void Literal::checkTypeRequirements()