diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 193f8e364..efff89d2b 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -238,7 +238,7 @@ private: void installNameRegWatch(); void installBalancesWatch(); - virtual void timerEvent(QTimerEvent*); + virtual void timerEvent(QTimerEvent*) override; void refreshNetwork(); void refreshMining(); diff --git a/alethzero/NatspecHandler.h b/alethzero/NatspecHandler.h index 7aeafec41..241df4e06 100644 --- a/alethzero/NatspecHandler.h +++ b/alethzero/NatspecHandler.h @@ -39,17 +39,17 @@ class NatspecHandler: public NatSpecFace ~NatspecHandler(); /// Stores locally in a levelDB a key value pair of contract code hash to natspec documentation - void add(dev::h256 const& _contractHash, std::string const& _doc); + virtual void add(dev::h256 const& _contractHash, std::string const& _doc) override; /// Retrieves the natspec documentation as a string given a contract code hash std::string retrieve(dev::h256 const& _contractHash) const override; /// Given a json natspec string and the transaction data return the user notice - std::string getUserNotice(std::string const& json, const dev::bytes& _transactionData); + virtual std::string getUserNotice(std::string const& json, const dev::bytes& _transactionData) override; /// Given a contract code hash and the transaction's data retrieve the natspec documention's /// user notice for that transaction. /// @returns The user notice or an empty string if no natspec for the contract exists /// or if the existing natspec does not document the @c _methodName - std::string getUserNotice(dev::h256 const& _contractHash, dev::bytes const& _transactionDacta); + virtual std::string getUserNotice(dev::h256 const& _contractHash, dev::bytes const& _transactionDacta) override; private: ldb::ReadOptions m_readOptions; diff --git a/json_spirit/json_spirit_writer_template.h b/json_spirit/json_spirit_writer_template.h index dbd0f45da..5376ef476 100644 --- a/json_spirit/json_spirit_writer_template.h +++ b/json_spirit/json_spirit_writer_template.h @@ -25,13 +25,9 @@ namespace json_spirit return 'A' - 10 + ch; } -#pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunused-local-typedefs") template< class String_type > String_type non_printable_to_string( unsigned int c ) { - typedef typename String_type::value_type Char_type; - String_type result( 6, '\\' ); result[1] = 'u'; @@ -43,7 +39,6 @@ namespace json_spirit return result; } -#pragma GCC diagnostic pop template< typename Char_type, class String_type > bool add_esc_char( Char_type c, String_type& s ) diff --git a/libdevcrypto/Common.cpp b/libdevcrypto/Common.cpp index e68381427..4ebd6a04b 100644 --- a/libdevcrypto/Common.cpp +++ b/libdevcrypto/Common.cpp @@ -54,7 +54,7 @@ Public dev::toPublic(Secret const& _secret) { Public p; s_secp256k1.toPublic(_secret, p); - return std::move(p); + return p; } Address dev::toAddress(Public const& _public) @@ -230,7 +230,7 @@ h256 crypto::kdf(Secret const& _priv, h256 const& _hash) if (!s || !_hash || !_priv) BOOST_THROW_EXCEPTION(InvalidState()); - return std::move(s); + return s; } h256 Nonce::get(bool _commit) diff --git a/libdevcrypto/CryptoPP.cpp b/libdevcrypto/CryptoPP.cpp index b701fed8d..9b550a666 100644 --- a/libdevcrypto/CryptoPP.cpp +++ b/libdevcrypto/CryptoPP.cpp @@ -61,7 +61,7 @@ bytes Secp256k1::eciesKDF(Secret _z, bytes _s1, unsigned kdByteLen) } k.resize(kdByteLen); - return move(k); + return k; } void Secp256k1::encryptECIES(Public const& _k, bytes& io_cipher) diff --git a/libdevcrypto/CryptoPP.h b/libdevcrypto/CryptoPP.h index ca8a2e6b5..377da8754 100644 --- a/libdevcrypto/CryptoPP.h +++ b/libdevcrypto/CryptoPP.h @@ -59,7 +59,7 @@ namespace crypto using namespace CryptoPP; -inline ECP::Point publicToPoint(Public const& _p) { Integer x(_p.data(), 32); Integer y(_p.data() + 32, 32); return std::move(ECP::Point(x,y)); } +inline ECP::Point publicToPoint(Public const& _p) { Integer x(_p.data(), 32); Integer y(_p.data() + 32, 32); return ECP::Point(x,y); } inline Integer secretToExponent(Secret const& _s) { return std::move(Integer(_s.data(), Secret::size)); } diff --git a/libdevcrypto/OverlayDB.cpp b/libdevcrypto/OverlayDB.cpp index 80c901635..05b9877ad 100644 --- a/libdevcrypto/OverlayDB.cpp +++ b/libdevcrypto/OverlayDB.cpp @@ -95,7 +95,7 @@ bytes OverlayDB::lookupAux(h256 const& _h) const { bytes ret = MemoryDB::lookupAux(_h); if (!ret.empty() || !m_db) - return move(ret); + return ret; std::string v; bytes b = _h.asBytes(); b.push_back(255); // for aux @@ -116,7 +116,7 @@ std::string OverlayDB::lookup(h256 const& _h) const std::string ret = MemoryDB::lookup(_h); if (ret.empty() && m_db) m_db->Get(m_readOptions, ldb::Slice((char const*)_h.data(), 32), &ret); - return move(ret); + return ret; } bool OverlayDB::exists(h256 const& _h) const diff --git a/libethereum/Client.h b/libethereum/Client.h index 5132b5a30..87209a667 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -143,7 +143,7 @@ public: ExecutionResult call(Address _dest, bytes const& _data = bytes(), u256 _gas = 125000, u256 _value = 0, u256 _gasPrice = 1 * ether, Address const& _from = Address()); /// Get the remaining gas limit in this block. - virtual u256 gasLimitRemaining() const { return m_postMine.gasLimitRemaining(); } + virtual u256 gasLimitRemaining() const override { return m_postMine.gasLimitRemaining(); } // [PRIVATE API - only relevant for base clients, not available in general] dev::eth::State state(unsigned _txi, h256 _block) const; @@ -159,7 +159,7 @@ public: // Mining stuff: - void setAddress(Address _us) { WriteGuard l(x_preMine); m_preMine.setAddress(_us); } + virtual void setAddress(Address _us) override { WriteGuard l(x_preMine); m_preMine.setAddress(_us); } /// Check block validity prior to mining. bool miningParanoia() const { return m_paranoia; } diff --git a/libethereum/ClientBase.h b/libethereum/ClientBase.h index 2b271b1df..c55dae96d 100644 --- a/libethereum/ClientBase.h +++ b/libethereum/ClientBase.h @@ -132,8 +132,8 @@ public: virtual Transactions pending() const override; virtual h256s pendingHashes() const override; - ImportResult injectTransaction(bytes const& _rlp) override { prepareForTransaction(); return m_tq.import(_rlp); } - ImportResult injectBlock(bytes const& _block); + virtual ImportResult injectTransaction(bytes const& _rlp) override { prepareForTransaction(); return m_tq.import(_rlp); } + virtual ImportResult injectBlock(bytes const& _block) override; using Interface::diff; virtual StateDiff diff(unsigned _txi, h256 _block) const override; @@ -143,9 +143,6 @@ public: virtual Addresses addresses(BlockNumber _block) const override; virtual u256 gasLimitRemaining() const override; - /// Set the coinbase address - virtual void setAddress(Address _us) = 0; - /// Get the coinbase address virtual Address address() const override; diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 8642824f6..3557fc0ee 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -109,7 +109,7 @@ string Assembly::getLocationFromSources(StringMap const& _sourceCodes, SourceLoc if (newLinePos != string::npos) cut = cut.substr(0, newLinePos) + "..."; - return move(cut); + return cut; } ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap const& _sourceCodes) const diff --git a/libp2p/Common.h b/libp2p/Common.h index 8fd330580..4a1b64b70 100644 --- a/libp2p/Common.h +++ b/libp2p/Common.h @@ -183,8 +183,8 @@ struct NodeIPEndpoint uint16_t udpPort = 0; uint16_t tcpPort = 0; - operator bi::udp::endpoint() const { return std::move(bi::udp::endpoint(address, udpPort)); } - operator bi::tcp::endpoint() const { return std::move(bi::tcp::endpoint(address, tcpPort)); } + operator bi::udp::endpoint() const { return bi::udp::endpoint(address, udpPort); } + operator bi::tcp::endpoint() const { return bi::tcp::endpoint(address, tcpPort); } operator bool() const { return !address.is_unspecified() && udpPort > 0 && tcpPort > 0; } diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index b6c9efec9..f47db3c2b 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -834,7 +834,7 @@ KeyPair Host::networkAlias(bytesConstRef _b) { RLP r(_b); if (r.itemCount() == 3 && r[0].isInt() && r[0].toInt() >= 3) - return move(KeyPair(move(Secret(r[1].toBytes())))); + return KeyPair(Secret(r[1].toBytes())); else - return move(KeyPair::create()); + return KeyPair::create(); } diff --git a/libp2p/Network.cpp b/libp2p/Network.cpp index d8ab90a20..2f2f247b6 100644 --- a/libp2p/Network.cpp +++ b/libp2p/Network.cpp @@ -111,7 +111,7 @@ std::set Network::getInterfaceAddresses() #endif - return std::move(addresses); + return addresses; } int Network::tcp4Listen(bi::tcp::acceptor& _acceptor, NetworkPreferences const& _netPrefs) diff --git a/libp2p/NodeTable.cpp b/libp2p/NodeTable.cpp index bf056c52f..078b4409b 100644 --- a/libp2p/NodeTable.cpp +++ b/libp2p/NodeTable.cpp @@ -88,7 +88,7 @@ shared_ptr NodeTable::addNode(Node const& _node, NodeRelation _relati } if (!_node.endpoint) - return move(shared_ptr()); + return shared_ptr(); // ping address to recover nodeid if nodeid is empty if (!_node.id) @@ -98,7 +98,7 @@ shared_ptr NodeTable::addNode(Node const& _node, NodeRelation _relati DEV_GUARDED(x_pubkDiscoverPings) m_pubkDiscoverPings[_node.endpoint.address] = std::chrono::steady_clock::now(); ping(_node.endpoint); - return move(shared_ptr()); + return shared_ptr(); } DEV_GUARDED(x_nodes) @@ -129,7 +129,7 @@ list NodeTable::nodes() const DEV_GUARDED(x_nodes) for (auto& i: m_nodes) nodes.push_back(i.second->id); - return move(nodes); + return nodes; } list NodeTable::snapshot() const @@ -140,7 +140,7 @@ list NodeTable::snapshot() const for (auto const& np: s.nodes) if (auto n = np.lock()) ret.push_back(*n); - return move(ret); + return ret; } Node NodeTable::node(NodeId const& _id) @@ -282,7 +282,7 @@ vector> NodeTable::nearestNodeEntries(NodeId _target) for (auto const& n: nodes.second) if (ret.size() < s_bucketSize && !!n->endpoint && n->endpoint.isAllowed()) ret.push_back(n); - return move(ret); + return ret; } void NodeTable::ping(NodeIPEndpoint _to) const diff --git a/libp2p/RLPxFrameIO.cpp b/libp2p/RLPxFrameIO.cpp index ac1a27bed..4fa8557ba 100644 --- a/libp2p/RLPxFrameIO.cpp +++ b/libp2p/RLPxFrameIO.cpp @@ -154,7 +154,7 @@ h128 RLPXFrameIO::egressDigest() SHA3_256 h(m_egressMac); h128 digest; h.TruncatedFinal(digest.data(), h128::size); - return move(digest); + return digest; } h128 RLPXFrameIO::ingressDigest() @@ -162,7 +162,7 @@ h128 RLPXFrameIO::ingressDigest() SHA3_256 h(m_ingressMac); h128 digest; h.TruncatedFinal(digest.data(), h128::size); - return move(digest); + return digest; } void RLPXFrameIO::updateEgressMACWithHeader(bytesConstRef _headerCipher) diff --git a/libp2p/UDP.cpp b/libp2p/UDP.cpp index 9f89d9ad0..0b85bae4b 100644 --- a/libp2p/UDP.cpp +++ b/libp2p/UDP.cpp @@ -52,12 +52,12 @@ h256 RLPXDatagramFace::sign(Secret const& _k) bytesConstRef signedRLPx(&data[h256::size], data.size() - h256::size); dev::sha3(signedRLPx).ref().copyTo(rlpxHash); - return std::move(sighash); + return sighash; } Public RLPXDatagramFace::authenticate(bytesConstRef _sig, bytesConstRef _rlp) { Signature const& sig = *(Signature const*)_sig.data(); - return std::move(dev::recover(sig, sha3(_rlp))); + return dev::recover(sig, sha3(_rlp)); } diff --git a/libp2p/UDP.h b/libp2p/UDP.h index 474cb5442..e345ce07f 100644 --- a/libp2p/UDP.h +++ b/libp2p/UDP.h @@ -81,7 +81,7 @@ template struct RLPXDatagram: public RLPXDatagramFace { RLPXDatagram(bi::udp::endpoint const& _ep): RLPXDatagramFace(_ep) {} - static T fromBytesConstRef(bi::udp::endpoint const& _ep, bytesConstRef _bytes) { try { T t(_ep); t.interpretRLP(_bytes); return std::move(t); } catch(...) { T t(_ep); return std::move(t); } } + static T fromBytesConstRef(bi::udp::endpoint const& _ep, bytesConstRef _bytes) { try { T t(_ep); t.interpretRLP(_bytes); return t; } catch(...) { return T{_ep}; } } uint8_t packetType() { return T::type; } }; diff --git a/libsolidity/AST.h b/libsolidity/AST.h index 578709c1e..b3984840f 100644 --- a/libsolidity/AST.h +++ b/libsolidity/AST.h @@ -503,7 +503,7 @@ public: /// Returns the declared or inferred type. Can be an empty pointer if no type was explicitly /// declared and there is no assignment to the variable that fixes the type. - TypePointer getType(ContractDefinition const* = nullptr) const { return m_type; } + TypePointer getType(ContractDefinition const* = nullptr) const override { return m_type; } void setType(std::shared_ptr const& _type) { m_type = _type; } virtual bool isLValue() const override; diff --git a/libsolidity/CompilerContext.cpp b/libsolidity/CompilerContext.cpp index 2edff82e1..fde6adacc 100644 --- a/libsolidity/CompilerContext.cpp +++ b/libsolidity/CompilerContext.cpp @@ -133,7 +133,7 @@ set CompilerContext::getFunctionsWithoutCode() for (auto const& it: m_functionEntryLabels) if (m_functionsWithCode.count(it.first) == 0) functions.insert(it.first); - return move(functions); + return functions; } ModifierDefinition const& CompilerContext::getFunctionModifier(string const& _name) const diff --git a/libsolidity/LValue.h b/libsolidity/LValue.h index 1617e8167..726d63328 100644 --- a/libsolidity/LValue.h +++ b/libsolidity/LValue.h @@ -109,7 +109,7 @@ public: StorageItem(CompilerContext& _compilerContext, Declaration const& _declaration); /// Constructs the LValue and assumes that the storage reference is already on the stack. StorageItem(CompilerContext& _compilerContext, Type const& _type); - virtual unsigned sizeOnStack() const { return 2; } + virtual unsigned sizeOnStack() const override { return 2; } virtual void retrieveValue(SourceLocation const& _location, bool _remove = false) const override; virtual void storeValue( Type const& _sourceType, diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index 1316bbc37..e1161c3fb 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -1459,29 +1459,29 @@ MagicType::MagicType(MagicType::Kind _kind): switch (m_kind) { case Kind::Block: - m_members = move(MemberList({ + m_members = MemberList({ {"coinbase", make_shared(0, IntegerType::Modifier::Address)}, {"timestamp", make_shared(256)}, {"blockhash", make_shared(strings{"uint"}, strings{"bytes32"}, FunctionType::Location::BlockHash)}, {"difficulty", make_shared(256)}, {"number", make_shared(256)}, {"gaslimit", make_shared(256)} - })); + }); break; case Kind::Message: - m_members = move(MemberList({ + m_members = MemberList({ {"sender", make_shared(0, IntegerType::Modifier::Address)}, {"gas", make_shared(256)}, {"value", make_shared(256)}, {"data", make_shared(ReferenceType::Location::CallData)}, {"sig", make_shared(4)} - })); + }); break; case Kind::Transaction: - m_members = move(MemberList({ + m_members = MemberList({ {"origin", make_shared(0, IntegerType::Modifier::Address)}, {"gasprice", make_shared(256)} - })); + }); break; default: BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unknown kind of magic.")); diff --git a/libsolidity/Types.h b/libsolidity/Types.h index 3ec925395..17d30ea6c 100644 --- a/libsolidity/Types.h +++ b/libsolidity/Types.h @@ -407,7 +407,7 @@ public: virtual TypePointer unaryOperatorResult(Token::Value _operator) const override; virtual bool operator==(const Type& _other) const override; virtual unsigned getCalldataEncodedSize(bool _padded) const override; - virtual bool isDynamicallySized() const { return m_hasDynamicLength; } + virtual bool isDynamicallySized() const override { return m_hasDynamicLength; } virtual u256 getStorageSize() const override; virtual unsigned getSizeOnStack() const override; virtual std::string toString() const override; @@ -820,7 +820,7 @@ public: return TypePointer(); } - virtual bool operator==(Type const& _other) const; + virtual bool operator==(Type const& _other) const override; virtual bool canBeStored() const override { return false; } virtual bool canLiveOutsideStorage() const override { return true; } virtual unsigned getSizeOnStack() const override { return 0; } diff --git a/libtestutils/FixedClient.h b/libtestutils/FixedClient.h index 59da9075f..bdec08849 100644 --- a/libtestutils/FixedClient.h +++ b/libtestutils/FixedClient.h @@ -48,7 +48,7 @@ public: virtual eth::State asOf(h256 const& _h) const override; virtual eth::State preMine() const override { ReadGuard l(x_stateDB); return m_state; } virtual eth::State postMine() const override { ReadGuard l(x_stateDB); return m_state; } - virtual void setAddress(Address _us) { WriteGuard l(x_stateDB); m_state.setAddress(_us); } + virtual void setAddress(Address _us) override { WriteGuard l(x_stateDB); m_state.setAddress(_us); } virtual void prepareForTransaction() override {} private: diff --git a/libweb3jsonrpc/WebThreeStubServer.h b/libweb3jsonrpc/WebThreeStubServer.h index 35c35c3f0..1eddc22d4 100644 --- a/libweb3jsonrpc/WebThreeStubServer.h +++ b/libweb3jsonrpc/WebThreeStubServer.h @@ -43,7 +43,7 @@ class WebThreeStubServer: public dev::WebThreeStubServerBase, public dev::WebThr public: WebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, dev::WebThreeDirect& _web3, std::shared_ptr const& _ethAccounts, std::vector const& _shhAccounts); - virtual std::string web3_clientVersion(); + virtual std::string web3_clientVersion() override; private: virtual dev::eth::Interface* client() override; diff --git a/libwhisper/WhisperHost.h b/libwhisper/WhisperHost.h index c5ec5867b..87563d9e8 100644 --- a/libwhisper/WhisperHost.h +++ b/libwhisper/WhisperHost.h @@ -54,7 +54,7 @@ public: virtual void inject(Envelope const& _e, WhisperPeer* _from = nullptr) override; - virtual Topics const& fullTopics(unsigned _id) const { try { return m_filters.at(m_watches.at(_id).id).full; } catch (...) { return EmptyTopics; } } + virtual Topics const& fullTopics(unsigned _id) const override { try { return m_filters.at(m_watches.at(_id).id).full; } catch (...) { return EmptyTopics; } } virtual unsigned installWatch(Topics const& _filter) override; virtual unsigned installWatchOnId(h256 _filterId) override; virtual void uninstallWatch(unsigned _watchId) override; @@ -69,11 +69,11 @@ public: void cleanup(); protected: - void doWork(); + virtual void doWork() override; private: - virtual void onStarting() { startWorking(); } - virtual void onStopping() { stopWorking(); } + virtual void onStarting() override { startWorking(); } + virtual void onStopping() override { stopWorking(); } void streamMessage(h256 _m, RLPStream& _s) const; diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 434cf1e7d..1ca5d9160 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -67,7 +67,7 @@ private: return LocationPair(_node.getLocation().start, _node.getLocation().end); } - virtual bool visit(FunctionDefinition const&) + virtual bool visit(FunctionDefinition const&) override { m_functionScope = true; return true; diff --git a/mix/MixClient.h b/mix/MixClient.h index 4c5b51a09..ea6416ac4 100644 --- a/mix/MixClient.h +++ b/mix/MixClient.h @@ -80,7 +80,7 @@ protected: /// ClientBase methods using ClientBase::asOf; virtual dev::eth::State asOf(h256 const& _block) const override; - virtual dev::eth::BlockChain& bc() { return *m_bc; } + virtual dev::eth::BlockChain& bc() override { return *m_bc; } virtual dev::eth::BlockChain const& bc() const override { return *m_bc; } virtual dev::eth::State preMine() const override { ReadGuard l(x_state); return m_startState; } virtual dev::eth::State postMine() const override { ReadGuard l(x_state); return m_state; } diff --git a/test/libp2p/net.cpp b/test/libp2p/net.cpp index 1cd43b13f..a31537b98 100644 --- a/test/libp2p/net.cpp +++ b/test/libp2p/net.cpp @@ -74,7 +74,7 @@ struct TestNodeTable: public NodeTable ret.push_back(make_pair(k,s_basePort+i)); } - return std::move(ret); + return ret; } void pingTestNodes(std::vector> const& _testNodes) diff --git a/test/libwhisper/whisperMessage.cpp b/test/libwhisper/whisperMessage.cpp index 56a763622..343573713 100644 --- a/test/libwhisper/whisperMessage.cpp +++ b/test/libwhisper/whisperMessage.cpp @@ -37,7 +37,7 @@ Topics createRandomTopics(unsigned int i) ret.push_back(t); } - return move(ret); + return ret; } bytes createRandomPayload(unsigned int i) @@ -48,7 +48,7 @@ bytes createRandomPayload(unsigned int i) for (int j = 0; j < sz; ++j) ret.push_back(rand() % 256); - return move(ret); + return ret; } void comparePayloads(Message const& m1, Message const& m2)