From f4b836dab3950506ad7f2a83aa7c7adb1d51ecc3 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Mon, 4 May 2015 17:18:01 +0200 Subject: [PATCH] some more style fixes --- libsolidity/AST.cpp | 13 +++++++------ libsolidity/SourceReferenceFormatter.cpp | 19 +++++++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/libsolidity/AST.cpp b/libsolidity/AST.cpp index 50184fa5a..da34f3ab9 100644 --- a/libsolidity/AST.cpp +++ b/libsolidity/AST.cpp @@ -95,9 +95,10 @@ void ContractDefinition::checkTypeRequirements() { FixedHash<4> const& hash = it.first; if (hashes.count(hash)) - BOOST_THROW_EXCEPTION(createTypeError( - std::string("Function signature hash collision for ") + - it.second->externalSignature())); + BOOST_THROW_EXCEPTION( + createTypeError( + string("Function signature hash collision for ") + it.second->externalSignature()) + ); hashes.insert(hash); } } @@ -311,12 +312,12 @@ void ContractDefinition::checkExternalTypeClashes() const )); } -std::vector> const& ContractDefinition::getInterfaceEvents() const +vector> const& ContractDefinition::getInterfaceEvents() const { if (!m_interfaceEvents) { set eventsSeen; - m_interfaceEvents.reset(new std::vector>()); + m_interfaceEvents.reset(new vector>()); for (ContractDefinition const* contract: getLinearizedBaseContracts()) for (ASTPointer const& e: contract->getEvents()) if (eventsSeen.count(e->getName()) == 0) @@ -956,7 +957,7 @@ void Identifier::overloadResolution(TypePointers const& _argumentTypes) solAssert(!m_referencedDeclaration, "Referenced declaration should be null before overload resolution."); solAssert(!m_overloadedDeclarations.empty(), "No candidates for overload resolution found."); - std::vector possibles; + vector possibles; if (m_overloadedDeclarations.size() == 1) m_referencedDeclaration = *m_overloadedDeclarations.begin(); diff --git a/libsolidity/SourceReferenceFormatter.cpp b/libsolidity/SourceReferenceFormatter.cpp index e66851358..77805efc8 100644 --- a/libsolidity/SourceReferenceFormatter.cpp +++ b/libsolidity/SourceReferenceFormatter.cpp @@ -48,11 +48,11 @@ void SourceReferenceFormatter::printSourceLocation( { string line = _scanner.getLineAtPosition(_location.start); _stream << line << endl; - std::for_each(line.cbegin(), line.cbegin() + startColumn, - [&_stream](char const& ch) - { - _stream << (ch == '\t' ? '\t' : ' '); - }); + for_each( + line.cbegin(), + line.cbegin() + startColumn, + [&_stream](char const& ch) { _stream << (ch == '\t' ? '\t' : ' '); } + ); _stream << "^"; if (endColumn > startColumn + 2) _stream << string(endColumn - startColumn - 2, '-'); @@ -61,9 +61,12 @@ void SourceReferenceFormatter::printSourceLocation( _stream << endl; } else - _stream << _scanner.getLineAtPosition(_location.start) << endl - << string(startColumn, ' ') << "^\n" - << "Spanning multiple lines.\n"; + _stream << + _scanner.getLineAtPosition(_location.start) << + endl << + string(startColumn, ' ') << + "^\n" << + "Spanning multiple lines.\n"; } void SourceReferenceFormatter::printSourceName(