diff options
author | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-21 22:42:17 +0800 |
---|---|---|
committer | Alex Beregszaszi <alex@rtfs.hu> | 2017-08-22 17:51:46 +0800 |
commit | 2a5772cff7d03de0d02c5358a6a6755e8f802697 (patch) | |
tree | a617c912a51e289b00f2c71f2754d15d451c3bb4 | |
parent | 3cf2426e1a2975a60176cb46040fccfbc182d771 (diff) | |
download | dexon-solidity-2a5772cff7d03de0d02c5358a6a6755e8f802697.tar.gz dexon-solidity-2a5772cff7d03de0d02c5358a6a6755e8f802697.tar.zst dexon-solidity-2a5772cff7d03de0d02c5358a6a6755e8f802697.zip |
Mark appropriate constructors explicit
-rw-r--r-- | libdevcore/Common.h | 2 | ||||
-rw-r--r-- | libdevcore/FixedHash.h | 2 | ||||
-rw-r--r-- | libevmasm/BlockDeduplicator.h | 2 | ||||
-rw-r--r-- | libevmasm/CommonSubexpressionEliminator.h | 2 | ||||
-rw-r--r-- | libevmasm/PathGasMeter.h | 2 | ||||
-rw-r--r-- | libsolidity/codegen/ArrayUtils.h | 2 | ||||
-rw-r--r-- | libsolidity/codegen/CompilerUtils.h | 2 | ||||
-rw-r--r-- | libsolidity/codegen/ContractCompiler.cpp | 2 | ||||
-rw-r--r-- | libsolidity/inlineasm/AsmCodeGen.cpp | 2 | ||||
-rw-r--r-- | libsolidity/interface/ErrorReporter.h | 2 | ||||
-rw-r--r-- | libsolidity/interface/StandardCompiler.h | 2 | ||||
-rw-r--r-- | libsolidity/parsing/Parser.cpp | 4 | ||||
-rw-r--r-- | libsolidity/parsing/Parser.h | 2 | ||||
-rw-r--r-- | libsolidity/parsing/ParserBase.h | 2 | ||||
-rw-r--r-- | test/RPCSession.h | 2 |
15 files changed, 16 insertions, 16 deletions
diff --git a/libdevcore/Common.h b/libdevcore/Common.h index d383e74d..9d6dd408 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -157,7 +157,7 @@ template <> inline u256 exp10<0>() class ScopeGuard { public: - ScopeGuard(std::function<void(void)> _f): m_f(_f) {} + explicit ScopeGuard(std::function<void(void)> _f): m_f(_f) {} ~ScopeGuard() { m_f(); } private: diff --git a/libdevcore/FixedHash.h b/libdevcore/FixedHash.h index 5b1c7acf..1c37b675 100644 --- a/libdevcore/FixedHash.h +++ b/libdevcore/FixedHash.h @@ -59,7 +59,7 @@ public: enum ConstructFromHashType { AlignLeft, AlignRight, FailIfDifferent }; /// Construct an empty hash. - FixedHash() { m_data.fill(0); } + explicit FixedHash() { m_data.fill(0); } /// Construct from another hash, filling with zeroes or cropping as necessary. template <unsigned M> explicit FixedHash(FixedHash<M> const& _h, ConstructFromHashType _t = AlignLeft) { m_data.fill(0); unsigned c = std::min(M, N); for (unsigned i = 0; i < c; ++i) m_data[_t == AlignRight ? N - 1 - i : i] = _h[_t == AlignRight ? M - 1 - i : i]; } diff --git a/libevmasm/BlockDeduplicator.h b/libevmasm/BlockDeduplicator.h index 797c2476..5640984b 100644 --- a/libevmasm/BlockDeduplicator.h +++ b/libevmasm/BlockDeduplicator.h @@ -45,7 +45,7 @@ using AssemblyItems = std::vector<AssemblyItem>; class BlockDeduplicator { public: - BlockDeduplicator(AssemblyItems& _items): m_items(_items) {} + explicit BlockDeduplicator(AssemblyItems& _items): m_items(_items) {} /// @returns true if something was changed bool deduplicate(); /// @returns the tags that were replaced. diff --git a/libevmasm/CommonSubexpressionEliminator.h b/libevmasm/CommonSubexpressionEliminator.h index 83fc9732..f2473200 100644 --- a/libevmasm/CommonSubexpressionEliminator.h +++ b/libevmasm/CommonSubexpressionEliminator.h @@ -61,7 +61,7 @@ public: using Id = ExpressionClasses::Id; using StoreOperation = KnownState::StoreOperation; - CommonSubexpressionEliminator(KnownState const& _state): m_initialState(_state), m_state(_state) {} + explicit CommonSubexpressionEliminator(KnownState const& _state): m_initialState(_state), m_state(_state) {} /// Feeds AssemblyItems into the eliminator and @returns the iterator pointing at the first /// item that must be fed into a new instance of the eliminator. diff --git a/libevmasm/PathGasMeter.h b/libevmasm/PathGasMeter.h index 0a0fe5d0..4826eac2 100644 --- a/libevmasm/PathGasMeter.h +++ b/libevmasm/PathGasMeter.h @@ -50,7 +50,7 @@ struct GasPath class PathGasMeter { public: - PathGasMeter(AssemblyItems const& _items); + explicit PathGasMeter(AssemblyItems const& _items); GasMeter::GasConsumption estimateMax(size_t _startIndex, std::shared_ptr<KnownState> const& _state); diff --git a/libsolidity/codegen/ArrayUtils.h b/libsolidity/codegen/ArrayUtils.h index 806fbea7..f3ddc4ee 100644 --- a/libsolidity/codegen/ArrayUtils.h +++ b/libsolidity/codegen/ArrayUtils.h @@ -40,7 +40,7 @@ using TypePointer = std::shared_ptr<Type const>; class ArrayUtils { public: - ArrayUtils(CompilerContext& _context): m_context(_context) {} + explicit ArrayUtils(CompilerContext& _context): m_context(_context) {} /// Copies an array to an array in storage. The arrays can be of different types only if /// their storage representation is the same. diff --git a/libsolidity/codegen/CompilerUtils.h b/libsolidity/codegen/CompilerUtils.h index 09427788..18b70250 100644 --- a/libsolidity/codegen/CompilerUtils.h +++ b/libsolidity/codegen/CompilerUtils.h @@ -33,7 +33,7 @@ class Type; // forward class CompilerUtils { public: - CompilerUtils(CompilerContext& _context): m_context(_context) {} + explicit CompilerUtils(CompilerContext& _context): m_context(_context) {} /// Stores the initial value of the free-memory-pointer at its position; void initialiseFreeMemoryPointer(); diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index 29a22fae..e53f1b94 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -45,7 +45,7 @@ using namespace dev::solidity; class StackHeightChecker { public: - StackHeightChecker(CompilerContext const& _context): + explicit StackHeightChecker(CompilerContext const& _context): m_context(_context), stackHeight(m_context.stackHeight()) {} void check() { solAssert(m_context.stackHeight() == stackHeight, std::string("I sense a disturbance in the stack: ") + std::to_string(m_context.stackHeight()) + " vs " + std::to_string(stackHeight)); } private: diff --git a/libsolidity/inlineasm/AsmCodeGen.cpp b/libsolidity/inlineasm/AsmCodeGen.cpp index 74743737..24aa4ba8 100644 --- a/libsolidity/inlineasm/AsmCodeGen.cpp +++ b/libsolidity/inlineasm/AsmCodeGen.cpp @@ -52,7 +52,7 @@ using namespace dev::solidity::assembly; class EthAssemblyAdapter: public julia::AbstractAssembly { public: - EthAssemblyAdapter(eth::Assembly& _assembly): + explicit EthAssemblyAdapter(eth::Assembly& _assembly): m_assembly(_assembly) { } diff --git a/libsolidity/interface/ErrorReporter.h b/libsolidity/interface/ErrorReporter.h index 12f4e8df..241d6b43 100644 --- a/libsolidity/interface/ErrorReporter.h +++ b/libsolidity/interface/ErrorReporter.h @@ -36,7 +36,7 @@ class ErrorReporter { public: - ErrorReporter(ErrorList& _errors): + explicit ErrorReporter(ErrorList& _errors): m_errorList(_errors) { } ErrorReporter& operator=(ErrorReporter const& _errorReporter); diff --git a/libsolidity/interface/StandardCompiler.h b/libsolidity/interface/StandardCompiler.h index dfaf88cd..d9787a40 100644 --- a/libsolidity/interface/StandardCompiler.h +++ b/libsolidity/interface/StandardCompiler.h @@ -40,7 +40,7 @@ public: /// Creates a new StandardCompiler. /// @param _readFile callback to used to read files for import statements. Must return /// and must not emit exceptions. - StandardCompiler(ReadFile::Callback const& _readFile = ReadFile::Callback()) + explicit StandardCompiler(ReadFile::Callback const& _readFile = ReadFile::Callback()) : m_compilerStack(_readFile), m_readFile(_readFile) { } diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index d3a6aa45..7455cbca 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -40,7 +40,7 @@ namespace solidity class Parser::ASTNodeFactory { public: - ASTNodeFactory(Parser const& _parser): + explicit ASTNodeFactory(Parser const& _parser): m_parser(_parser), m_location(_parser.position(), -1, _parser.sourceName()) {} ASTNodeFactory(Parser const& _parser, ASTPointer<ASTNode> const& _childNode): m_parser(_parser), m_location(_childNode->location()) {} @@ -69,7 +69,7 @@ private: class Parser::RecursionGuard { public: - RecursionGuard(Parser& _parser): + explicit RecursionGuard(Parser& _parser): m_parser(_parser) { m_parser.increaseRecursionDepth(); diff --git a/libsolidity/parsing/Parser.h b/libsolidity/parsing/Parser.h index 5e6f3ef6..0f74880c 100644 --- a/libsolidity/parsing/Parser.h +++ b/libsolidity/parsing/Parser.h @@ -35,7 +35,7 @@ class Scanner; class Parser: public ParserBase { public: - Parser(ErrorReporter& _errorReporter): ParserBase(_errorReporter) {} + explicit Parser(ErrorReporter& _errorReporter): ParserBase(_errorReporter) {} ASTPointer<SourceUnit> parse(std::shared_ptr<Scanner> const& _scanner); diff --git a/libsolidity/parsing/ParserBase.h b/libsolidity/parsing/ParserBase.h index 5b03ab5e..48733fc1 100644 --- a/libsolidity/parsing/ParserBase.h +++ b/libsolidity/parsing/ParserBase.h @@ -36,7 +36,7 @@ class Scanner; class ParserBase { public: - ParserBase(ErrorReporter& errorReporter): m_errorReporter(errorReporter) {} + explicit ParserBase(ErrorReporter& errorReporter): m_errorReporter(errorReporter) {} std::shared_ptr<std::string const> const& sourceName() const; diff --git a/test/RPCSession.h b/test/RPCSession.h index f7fdd86e..558cb99f 100644 --- a/test/RPCSession.h +++ b/test/RPCSession.h @@ -124,7 +124,7 @@ public: std::string const& accountCreateIfNotExists(size_t _id); private: - RPCSession(std::string const& _path); + explicit RPCSession(std::string const& _path); inline std::string quote(std::string const& _arg) { return "\"" + _arg + "\""; } /// Parse std::string replacing keywords to values |