mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-01-21 15:50:07 +01:00
Merge #19846: build: enable unused member function diagnostic
819d03b932refactor: took out unused member functions (Zero)ed69213c2bbuild: enable unused member function diagnostic (Zero) Pull request description: This PR enables the `-Wunused-member-function` compiler diagnostic, as discussed in #19702. > **Notice**: The `unused-member-function` diagnostic is only available on clang. Therefore, clang should be used to test this PR. - [x] Include the `-Wunused-member-function`diagnostic in `./configure.ac`. (ed69213c2b) - [x] Resolve the reported warnings. (819d03b932) Currently, enabling this flag no longer reports the following warnings: > **Note**: output from `make 2>&1 | grep "warning: unused member function" | sort | uniq -c` ``` 1 index/blockfilterindex.cpp:54:5: warning: unused member function 'DBHeightKey' [-Wunused-member-function] 2 script/bitcoinconsensus.cpp:50:9: warning: unused member function 'GetType' [-Wunused-member-function] 1 test/util_tests.cpp:1975:14: warning: unused member function 'operator=' [-Wunused-member-function] ``` All tests have passed locally (from `make check` & `src/test/test_bitcoin`). This PR closes #19702. ACKs for top commit: practicalswift: ACK819d03b932- patch still looks correct :) MarcoFalke: ACK819d03b932pox: Tested ACK819d03b932with clang after `make clean`. No unused member function warnings. theStack: tested ACK819d03b932Tree-SHA512: 5fdfbbb02b3dc618a90a874a5caa5e01e596fc1d14a209e75a6981f01b253f9bca0cfac8fdd758dd7151986609fb76571c3745124a29cfd4f8cbb8d82a07272e
This commit is contained in:
@@ -16,8 +16,7 @@ namespace {
|
||||
class TxInputStream
|
||||
{
|
||||
public:
|
||||
TxInputStream(int nTypeIn, int nVersionIn, const unsigned char *txTo, size_t txToLen) :
|
||||
m_type(nTypeIn),
|
||||
TxInputStream(int nVersionIn, const unsigned char *txTo, size_t txToLen) :
|
||||
m_version(nVersionIn),
|
||||
m_data(txTo),
|
||||
m_remaining(txToLen)
|
||||
@@ -47,9 +46,7 @@ public:
|
||||
}
|
||||
|
||||
int GetVersion() const { return m_version; }
|
||||
int GetType() const { return m_type; }
|
||||
private:
|
||||
const int m_type;
|
||||
const int m_version;
|
||||
const unsigned char* m_data;
|
||||
size_t m_remaining;
|
||||
@@ -84,7 +81,7 @@ static int verify_script(const unsigned char *scriptPubKey, unsigned int scriptP
|
||||
return set_error(err, bitcoinconsensus_ERR_INVALID_FLAGS);
|
||||
}
|
||||
try {
|
||||
TxInputStream stream(SER_NETWORK, PROTOCOL_VERSION, txTo, txToLen);
|
||||
TxInputStream stream(PROTOCOL_VERSION, txTo, txToLen);
|
||||
CTransaction tx(deserialize, stream);
|
||||
if (nIn >= tx.vin.size())
|
||||
return set_error(err, bitcoinconsensus_ERR_TX_INDEX);
|
||||
|
||||
Reference in New Issue
Block a user