diff --git a/CompilerStack.cpp b/CompilerStack.cpp index 6f80d245c..3e9791bd2 100644 --- a/CompilerStack.cpp +++ b/CompilerStack.cpp @@ -84,12 +84,12 @@ void CompilerStack::streamAssembly(ostream& _outStream) m_compiler->streamAssembly(_outStream); } -std::string const* CompilerStack::getJsonDocumentation(enum documentation_type _type) +std::string const* CompilerStack::getJsonDocumentation(enum documentationType _type) { if (!m_parseSuccessful) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful.")); - auto createOrReturnDoc = [&, this](std::unique_ptr& _doc) + auto createOrReturnDoc = [this, _type](std::unique_ptr& _doc) { if(!_doc) { diff --git a/CompilerStack.h b/CompilerStack.h index 7dc86e2be..511951291 100644 --- a/CompilerStack.h +++ b/CompilerStack.h @@ -37,7 +37,7 @@ class Compiler; class GlobalContext; class InterfaceHandler; -enum documentation_type : unsigned short +enum documentationType: unsigned short { NATSPEC_USER = 1, NATSPEC_DEV, @@ -74,7 +74,7 @@ public: /// Prerequisite: Successful call to parse or compile. /// @param type The type of the documentation to get. /// Can be one of 3 types defined at @c documentation_type - std::string const* getJsonDocumentation(enum documentation_type type); + std::string const* getJsonDocumentation(enum documentationType type); /// Returns the previously used scanner, useful for counting lines during error reporting. Scanner const& getScanner() const { return *m_scanner; } diff --git a/InterfaceHandler.cpp b/InterfaceHandler.cpp index a2c52c1f0..61570b8d7 100644 --- a/InterfaceHandler.cpp +++ b/InterfaceHandler.cpp @@ -12,7 +12,7 @@ InterfaceHandler::InterfaceHandler() } std::unique_ptr InterfaceHandler::getDocumentation(std::shared_ptr _contractDef, - enum documentation_type _type) + enum documentationType _type) { switch(_type) { @@ -39,7 +39,7 @@ std::unique_ptr InterfaceHandler::getABIInterface(std::shared_ptr> const& _vars) + auto populateParameters = [](std::vector> const& _vars) { Json::Value params(Json::arrayValue); for (ASTPointer const& var: _vars) @@ -53,8 +53,8 @@ std::unique_ptr InterfaceHandler::getABIInterface(std::shared_ptrgetName(); - method["inputs"] = streamVariables(f->getParameters()); - method["outputs"] = streamVariables(f->getReturnParameters()); + method["inputs"] = populateParameters(f->getParameters()); + method["outputs"] = populateParameters(f->getReturnParameters()); methods.append(method); } return std::unique_ptr(new std::string(m_writer.write(methods))); diff --git a/InterfaceHandler.h b/InterfaceHandler.h index 125ecda4b..5c8bf5bca 100644 --- a/InterfaceHandler.h +++ b/InterfaceHandler.h @@ -35,7 +35,7 @@ namespace solidity { // Forward declarations class ContractDefinition; -enum documentation_type: unsigned short; +enum documentationType: unsigned short; class InterfaceHandler { @@ -49,7 +49,7 @@ public: /// @return A unique pointer contained string with the json /// representation of provided type std::unique_ptr getDocumentation(std::shared_ptr _contractDef, - enum documentation_type _type); + enum documentationType _type); /// Get the ABI Interface of the contract /// @param _contractDef The contract definition /// @return A unique pointer contained string with the json