diff options
author | chriseth <chris@ethereum.org> | 2017-08-22 18:43:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-22 18:43:19 +0800 |
commit | f874fc28d1cb657b6d4e04fa9d93bd8d061f30c4 (patch) | |
tree | fb0f04a445940004a8a45e03bc98d149c5cc71a7 /libsolidity/ast | |
parent | 2c2ae74217521aae93b9c7b058ce8687046c648c (diff) | |
parent | 9897c56b2cacf162f8fd41d60e91b7f71863f8d5 (diff) | |
download | dexon-solidity-f874fc28d1cb657b6d4e04fa9d93bd8d061f30c4.tar.gz dexon-solidity-f874fc28d1cb657b6d4e04fa9d93bd8d061f30c4.tar.zst dexon-solidity-f874fc28d1cb657b6d4e04fa9d93bd8d061f30c4.zip |
Merge pull request #2772 from ethereum/cppcheck
Improvements found by Cppcheck (const/static functions and explicit constructors)
Diffstat (limited to 'libsolidity/ast')
-rw-r--r-- | libsolidity/ast/ASTJsonConverter.h | 6 | ||||
-rw-r--r-- | libsolidity/ast/ASTPrinter.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libsolidity/ast/ASTJsonConverter.h b/libsolidity/ast/ASTJsonConverter.h index 70e260db..186607ce 100644 --- a/libsolidity/ast/ASTJsonConverter.h +++ b/libsolidity/ast/ASTJsonConverter.h @@ -119,7 +119,7 @@ private: ); std::string sourceLocationToString(SourceLocation const& _location) const; std::string namePathToString(std::vector<ASTString> const& _namePath) const; - Json::Value idOrNull(ASTNode const* _pt) + static Json::Value idOrNull(ASTNode const* _pt) { return _pt ? Json::Value(nodeId(*_pt)) : Json::nullValue; } @@ -134,12 +134,12 @@ private: std::string literalTokenKind(Token::Value _token); std::string type(Expression const& _expression); std::string type(VariableDeclaration const& _varDecl); - int nodeId(ASTNode const& _node) + static int nodeId(ASTNode const& _node) { return _node.id(); } template<class Container> - Json::Value getContainerIds(Container const& container) + static Json::Value getContainerIds(Container const& container) { Json::Value tmp(Json::arrayValue); for (auto const& element: container) diff --git a/libsolidity/ast/ASTPrinter.h b/libsolidity/ast/ASTPrinter.h index 4a37f17f..193f9296 100644 --- a/libsolidity/ast/ASTPrinter.h +++ b/libsolidity/ast/ASTPrinter.h @@ -146,7 +146,7 @@ private: std::string m_source; ASTNode const* m_ast; GasEstimator::ASTGasConsumption m_gasCosts; - std::ostream* m_ostream; + std::ostream* m_ostream = nullptr; }; } |