Skip to content

Commit 2ea6f7d

Browse files
gladcowUdjinM6
authored andcommitted
Use override keyword for overriden class member functions (#1644)
* Use `override` keyword for all overriden functions * more override
1 parent 580c488 commit 2ea6f7d

27 files changed

+85
-83
lines changed

src/dsnotificationinterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class CDSNotificationInterface : public CValidationInterface
2121
void AcceptedBlockHeader(const CBlockIndex *pindexNew) override;
2222
void NotifyHeaderTip(const CBlockIndex *pindexNew, bool fInitialDownload) override;
2323
void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
24-
void SyncTransaction(const CTransaction &tx, const CBlockIndex *pindex, int posInBlock);
24+
void SyncTransaction(const CTransaction &tx, const CBlockIndex *pindex, int posInBlock) override;
2525

2626
private:
2727
CConnman& connman;

src/governance-exceptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class CGovernanceException : public std::exception
7676

7777
virtual ~CGovernanceException() throw() {}
7878

79-
virtual const char* what() const throw()
79+
virtual const char* what() const throw() override
8080
{
8181
return strMessage.c_str();
8282
}

src/httprpc.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,11 @@ class HTTPRPCTimerInterface : public RPCTimerInterface
4848
HTTPRPCTimerInterface(struct event_base* _base) : base(_base)
4949
{
5050
}
51-
const char* Name()
51+
const char* Name() override
5252
{
5353
return "HTTP";
5454
}
55-
RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis)
55+
RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis) override
5656
{
5757
return new HTTPRPCTimer(base, func, millis);
5858
}

src/httpserver.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class HTTPWorkItem : public HTTPClosure
4646
req(std::move(_req)), path(_path), func(_func)
4747
{
4848
}
49-
void operator()()
49+
void operator()() override
5050
{
5151
func(req.get(), path);
5252
}

src/keystore.h

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ class CBasicKeyStore : public CKeyStore
6464
CHDChain hdChain;
6565

6666
public:
67-
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey);
68-
bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const;
69-
bool HaveKey(const CKeyID &address) const
67+
bool AddKeyPubKey(const CKey& key, const CPubKey &pubkey) override;
68+
bool GetPubKey(const CKeyID &address, CPubKey& vchPubKeyOut) const override;
69+
bool HaveKey(const CKeyID &address) const override
7070
{
7171
bool result;
7272
{
@@ -75,7 +75,7 @@ class CBasicKeyStore : public CKeyStore
7575
}
7676
return result;
7777
}
78-
void GetKeys(std::set<CKeyID> &setAddress) const
78+
void GetKeys(std::set<CKeyID> &setAddress) const override
7979
{
8080
setAddress.clear();
8181
{
@@ -88,7 +88,7 @@ class CBasicKeyStore : public CKeyStore
8888
}
8989
}
9090
}
91-
bool GetKey(const CKeyID &address, CKey &keyOut) const
91+
bool GetKey(const CKeyID &address, CKey &keyOut) const override
9292
{
9393
{
9494
LOCK(cs_KeyStore);
@@ -101,16 +101,16 @@ class CBasicKeyStore : public CKeyStore
101101
}
102102
return false;
103103
}
104-
virtual bool AddCScript(const CScript& redeemScript);
105-
virtual bool HaveCScript(const CScriptID &hash) const;
106-
virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const;
104+
virtual bool AddCScript(const CScript& redeemScript) override;
105+
virtual bool HaveCScript(const CScriptID &hash) const override;
106+
virtual bool GetCScript(const CScriptID &hash, CScript& redeemScriptOut) const override;
107107

108-
virtual bool AddWatchOnly(const CScript &dest);
109-
virtual bool RemoveWatchOnly(const CScript &dest);
110-
virtual bool HaveWatchOnly(const CScript &dest) const;
111-
virtual bool HaveWatchOnly() const;
108+
virtual bool AddWatchOnly(const CScript &dest) override;
109+
virtual bool RemoveWatchOnly(const CScript &dest) override;
110+
virtual bool HaveWatchOnly(const CScript &dest) const override;
111+
virtual bool HaveWatchOnly() const override;
112112

113-
bool GetHDChain(CHDChain& hdChainRet) const;
113+
virtual bool GetHDChain(CHDChain& hdChainRet) const;
114114
};
115115

116116
typedef std::vector<unsigned char, secure_allocator<unsigned char> > CKeyingMaterial;

src/net_processing.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ class PeerLogicValidation : public CValidationInterface {
3333
public:
3434
PeerLogicValidation(CConnman* connmanIn);
3535

36-
virtual void SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int nPosInBlock);
37-
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload);
38-
virtual void BlockChecked(const CBlock& block, const CValidationState& state);
36+
virtual void SyncTransaction(const CTransaction& tx, const CBlockIndex* pindex, int nPosInBlock) override;
37+
virtual void UpdatedBlockTip(const CBlockIndex *pindexNew, const CBlockIndex *pindexFork, bool fInitialDownload) override;
38+
virtual void BlockChecked(const CBlock& block, const CValidationState& state) override;
3939
};
4040

4141
struct CNodeStateStats {

src/qt/coincontroltreewidget.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class CoinControlTreeWidget : public QTreeWidget
1616
explicit CoinControlTreeWidget(QWidget *parent = 0);
1717

1818
protected:
19-
virtual void keyPressEvent(QKeyEvent *event);
19+
virtual void keyPressEvent(QKeyEvent *event) override;
2020
};
2121

2222
#endif // BITCOIN_QT_COINCONTROLTREEWIDGET_H

src/qt/receivecoinsdialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public Q_SLOTS:
5151
void accept();
5252

5353
protected:
54-
virtual void keyPressEvent(QKeyEvent *event);
54+
virtual void keyPressEvent(QKeyEvent *event) override;
5555

5656
private:
5757
Ui::ReceiveCoinsDialog *ui;
@@ -62,7 +62,7 @@ public Q_SLOTS:
6262

6363
QModelIndex selectedRow();
6464
void copyColumnToClipboard(int column);
65-
virtual void resizeEvent(QResizeEvent *event);
65+
virtual void resizeEvent(QResizeEvent *event) override;
6666

6767
private Q_SLOTS:
6868
void on_receiveButton_clicked();

src/qt/receiverequestdialog.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ public Q_SLOTS:
3838
void copyImage();
3939

4040
protected:
41-
virtual void mousePressEvent(QMouseEvent *event);
42-
virtual void contextMenuEvent(QContextMenuEvent *event);
41+
virtual void mousePressEvent(QMouseEvent *event) override;
42+
virtual void contextMenuEvent(QContextMenuEvent *event) override;
4343

4444
private:
4545
QMenu *contextMenu;

src/qt/rpcconsole.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ class QtRPCTimerInterface: public RPCTimerInterface
127127
{
128128
public:
129129
~QtRPCTimerInterface() {}
130-
const char *Name() { return "Qt"; }
131-
RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis)
130+
const char *Name() override { return "Qt"; }
131+
RPCTimerBase* NewTimer(boost::function<void(void)>& func, int64_t millis) override
132132
{
133133
return new QtRPCTimerBase(func, millis);
134134
}

0 commit comments

Comments
 (0)