File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
contrib/devtools/bitcoin-tidy Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,20 @@ class CWallet
43
43
};
44
44
};
45
45
46
+ struct ScriptPubKeyMan
47
+ {
48
+ std::string GetDisplayName () const
49
+ {
50
+ return " default wallet" ;
51
+ }
52
+
53
+ template <typename ... Params>
54
+ void WalletLogPrintf (const char * fmt, Params... parameters) const
55
+ {
56
+ LogPrintf ((" %s " + std::string{fmt}).c_str (), GetDisplayName (), parameters...);
57
+ };
58
+ };
59
+
46
60
void good_func ()
47
61
{
48
62
LogPrintf (" hello world!\n " );
@@ -51,6 +65,8 @@ void good_func2()
51
65
{
52
66
CWallet wallet;
53
67
wallet.WalletLogPrintf (" hi\n " );
68
+ ScriptPubKeyMan spkm;
69
+ spkm.WalletLogPrintf (" hi\n " );
54
70
55
71
const CWallet& walletref = wallet;
56
72
walletref.WalletLogPrintf (" hi\n " );
@@ -80,6 +96,8 @@ void bad_func5()
80
96
{
81
97
CWallet wallet;
82
98
wallet.WalletLogPrintf (" hi" );
99
+ ScriptPubKeyMan spkm;
100
+ spkm.WalletLogPrintf (" hi" );
83
101
84
102
const CWallet& walletref = wallet;
85
103
walletref.WalletLogPrintf (" hi" );
Original file line number Diff line number Diff line change @@ -36,14 +36,12 @@ void LogPrintfCheck::registerMatchers(clang::ast_matchers::MatchFinder* finder)
36
36
this );
37
37
38
38
/*
39
- CWallet wallet;
40
39
auto walletptr = &wallet;
41
40
wallet.WalletLogPrintf("foo");
42
41
wallet->WalletLogPrintf("foo");
43
42
*/
44
43
finder->addMatcher (
45
44
cxxMemberCallExpr (
46
- thisPointerType (qualType (hasDeclaration (cxxRecordDecl (hasName (" CWallet" ))))),
47
45
callee (cxxMethodDecl (hasName (" WalletLogPrintf" ))),
48
46
hasArgument (0 , stringLiteral (unterminated ()).bind (" logstring" ))),
49
47
this );
You can’t perform that action at this time.
0 commit comments