From 24e5dcc352e9ce9569138dfa5af96fbf72ad3604 Mon Sep 17 00:00:00 2001 From: liangdzou Date: Wed, 19 Sep 2018 00:04:11 +0800 Subject: [PATCH] fix code format problems --- liblll/Compiler.cpp | 3 ++- liblll/Parser.cpp | 3 ++- libsolidity/interface/Natspec.cpp | 3 ++- libsolidity/interface/SourceReferenceFormatter.cpp | 3 ++- solc/CommandLineInterface.cpp | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/liblll/Compiler.cpp b/liblll/Compiler.cpp index 657f58b80..f944adbd9 100644 --- a/liblll/Compiler.cpp +++ b/liblll/Compiler.cpp @@ -90,7 +90,8 @@ std::string dev::lll::compileLLLToAsm(std::string const& _src, EVMVersion _evmVe } catch (std::exception const& _e) { - if (_errors) { + if (_errors) + { _errors->push_back("Parse exception."); _errors->push_back(boost::diagnostic_information(_e)); } diff --git a/liblll/Parser.cpp b/liblll/Parser.cpp index c3c333068..854aeecc8 100644 --- a/liblll/Parser.cpp +++ b/liblll/Parser.cpp @@ -148,7 +148,8 @@ void dev::lll::parseTreeLLL(string const& _s, sp::utree& o_out) BOOST_THROW_EXCEPTION(ParserException() << errinfo_comment(reason)); } for (auto i = ret; i != s.cend(); ++i) - if (!isspace(*i)) { + if (!isspace(*i)) + { BOOST_THROW_EXCEPTION(ParserException() << errinfo_comment("Non-whitespace left in parser")); } } diff --git a/libsolidity/interface/Natspec.cpp b/libsolidity/interface/Natspec.cpp index a87168628..11dde3499 100644 --- a/libsolidity/interface/Natspec.cpp +++ b/libsolidity/interface/Natspec.cpp @@ -83,7 +83,8 @@ Json::Value Natspec::devDocumentation(ContractDefinition const& _contractDef) doc["details"] = Json::Value(dev); auto constructorDefinition(_contractDef.constructor()); - if (constructorDefinition) { + if (constructorDefinition) + { Json::Value constructor(devDocumentation(constructorDefinition->annotation().docTags)); if (!constructor.empty()) // add the constructor, only if we have any documentation to add diff --git a/libsolidity/interface/SourceReferenceFormatter.cpp b/libsolidity/interface/SourceReferenceFormatter.cpp index 4724fc7f2..865907e21 100644 --- a/libsolidity/interface/SourceReferenceFormatter.cpp +++ b/libsolidity/interface/SourceReferenceFormatter.cpp @@ -59,7 +59,8 @@ void SourceReferenceFormatter::printSourceLocation(SourceLocation const* _locati line = line.substr(max(0, startColumn - 35), min(startColumn, 35) + min(locationLength + 35, len - startColumn)); if (startColumn + locationLength + 35 < len) line += " ..."; - if (startColumn > 35) { + if (startColumn > 35) + { line = " ... " + line; startColumn = 40; } diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index f7d1c7481..a43e789e9 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -742,7 +742,8 @@ bool CommandLineInterface::processInput() // path will have it's last component set to '.'. This breaks // path comparison in later parts of the code, so we need to strip // it. - if (filesystem_path.filename() == ".") { + if (filesystem_path.filename() == ".") + { filesystem_path.remove_filename(); } m_allowedDirectories.push_back(filesystem_path);