Skip to content

Commit a6cdb75

Browse files
fix compilation in headers that contain 'dashes' and adjust linter
Signed-off-by: pasta <[email protected]>
1 parent db747ea commit a6cdb75

15 files changed

+43
-43
lines changed

contrib/devtools/lint-include-guards.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ REGEXP_EXCLUDE_FILES_WITH_PREFIX="src/(crypto/ctaes/|leveldb/|secp256k1/|tinyfor
1414
EXIT_CODE=0
1515
for HEADER_FILE in $(git ls-files -- "*.h" | grep -vE "^${REGEXP_EXCLUDE_FILES_WITH_PREFIX}")
1616
do
17-
HEADER_ID_BASE=$(cut -f2- -d/ <<< "${HEADER_FILE}" | sed "s/\.h$//g" | tr / _ | tr "[:lower:]" "[:upper:]")
17+
HEADER_ID_BASE=$(cut -f2- -d/ <<< "${HEADER_FILE}" | sed "s/\.h$//g" | tr / _ | tr "[:lower:]" "[:upper:]" | tr - _)
1818
HEADER_ID="${HEADER_ID_PREFIX}${HEADER_ID_BASE}${HEADER_ID_SUFFIX}"
1919
if [[ $(grep -cE "^#(ifndef|define) ${HEADER_ID}" "${HEADER_FILE}") != 2 ]]; then
2020
echo "${HEADER_FILE} seems to be missing the expected include guard:"

src/flat-database.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_FLAT-DATABASE_H
6-
#define BITCOIN_FLAT-DATABASE_H
5+
#ifndef BITCOIN_FLAT_DATABASE_H
6+
#define BITCOIN_FLAT_DATABASE_H
77

88
#include <chainparams.h>
99
#include <clientversion.h>
@@ -225,4 +225,4 @@ class CFlatDB
225225
};
226226

227227

228-
#endif // BITCOIN_FLAT-DATABASE_H
228+
#endif // BITCOIN_FLAT_DATABASE_H

src/governance/governance-classes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) 2014-2020 The Dash Core developers
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4-
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE-CLASSES_H
5-
#define BITCOIN_GOVERNANCE_GOVERNANCE-CLASSES_H
4+
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE_CLASSES_H
5+
#define BITCOIN_GOVERNANCE_GOVERNANCE_CLASSES_H
66

77
#include <base58.h>
88
#include <governance/governance.h>
@@ -173,4 +173,4 @@ class CSuperblock : public CGovernanceObject
173173
bool IsExpired() const;
174174
};
175175

176-
#endif // BITCOIN_GOVERNANCE_GOVERNANCE-CLASSES_H
176+
#endif // BITCOIN_GOVERNANCE_GOVERNANCE_CLASSES_H

src/governance/governance-exceptions.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE-EXCEPTIONS_H
6-
#define BITCOIN_GOVERNANCE_GOVERNANCE-EXCEPTIONS_H
5+
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE_EXCEPTIONS_H
6+
#define BITCOIN_GOVERNANCE_GOVERNANCE_EXCEPTIONS_H
77

88
#include <exception>
99
#include <iostream>
@@ -97,4 +97,4 @@ class CGovernanceException : public std::exception
9797
}
9898
};
9999

100-
#endif // BITCOIN_GOVERNANCE_GOVERNANCE-EXCEPTIONS_H
100+
#endif // BITCOIN_GOVERNANCE_GOVERNANCE_EXCEPTIONS_H

src/governance/governance-object.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE-OBJECT_H
6-
#define BITCOIN_GOVERNANCE_GOVERNANCE-OBJECT_H
5+
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE_OBJECT_H
6+
#define BITCOIN_GOVERNANCE_GOVERNANCE_OBJECT_H
77

88
#include <cachemultimap.h>
99
#include <governance/governance-exceptions.h>
@@ -356,4 +356,4 @@ class CGovernanceObject
356356
};
357357

358358

359-
#endif // BITCOIN_GOVERNANCE_GOVERNANCE-OBJECT_H
359+
#endif // BITCOIN_GOVERNANCE_GOVERNANCE_OBJECT_H

src/governance/governance-validators.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE-VALIDATORS_H
6-
#define BITCOIN_GOVERNANCE_GOVERNANCE-VALIDATORS_H
5+
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE_VALIDATORS_H
6+
#define BITCOIN_GOVERNANCE_GOVERNANCE_VALIDATORS_H
77

88
#include <string>
99

@@ -44,4 +44,4 @@ class CProposalValidator
4444
bool CheckURL(const std::string& strURLIn);
4545
};
4646

47-
#endif // BITCOIN_GOVERNANCE_GOVERNANCE-VALIDATORS_H
47+
#endif // BITCOIN_GOVERNANCE_GOVERNANCE_VALIDATORS_H

src/governance/governance-vote.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE-VOTE_H
6-
#define BITCOIN_GOVERNANCE_GOVERNANCE-VOTE_H
5+
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE_VOTE_H
6+
#define BITCOIN_GOVERNANCE_GOVERNANCE_VOTE_H
77

88
#include <key.h>
99
#include <primitives/transaction.h>
@@ -133,4 +133,4 @@ class CGovernanceVote
133133
}
134134
};
135135

136-
#endif // BITCOIN_GOVERNANCE_GOVERNANCE-VOTE_H
136+
#endif // BITCOIN_GOVERNANCE_GOVERNANCE_VOTE_H

src/governance/governance-votedb.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE-VOTEDB_H
6-
#define BITCOIN_GOVERNANCE_GOVERNANCE-VOTEDB_H
5+
#ifndef BITCOIN_GOVERNANCE_GOVERNANCE_VOTEDB_H
6+
#define BITCOIN_GOVERNANCE_GOVERNANCE_VOTEDB_H
77

88
#include <list>
99
#include <map>
@@ -92,4 +92,4 @@ class CGovernanceObjectVoteFile
9292
void RebuildIndex();
9393
};
9494

95-
#endif // BITCOIN_GOVERNANCE_GOVERNANCE-VOTEDB_H
95+
#endif // BITCOIN_GOVERNANCE_GOVERNANCE_VOTEDB_H

src/masternode/masternode-meta.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_MASTERNODE_MASTERNODE-META_H
6-
#define BITCOIN_MASTERNODE_MASTERNODE-META_H
5+
#ifndef BITCOIN_MASTERNODE_MASTERNODE_META_H
6+
#define BITCOIN_MASTERNODE_MASTERNODE_META_H
77

88
#include <serialize.h>
99

@@ -158,4 +158,4 @@ class CMasternodeMetaMan
158158

159159
extern CMasternodeMetaMan mmetaman;
160160

161-
#endif // BITCOIN_MASTERNODE_MASTERNODE-META_H
161+
#endif // BITCOIN_MASTERNODE_MASTERNODE_META_H

src/masternode/masternode-payments.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
// Distributed under the MIT/X11 software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

5-
#ifndef BITCOIN_MASTERNODE_MASTERNODE-PAYMENTS_H
6-
#define BITCOIN_MASTERNODE_MASTERNODE-PAYMENTS_H
5+
#ifndef BITCOIN_MASTERNODE_MASTERNODE_PAYMENTS_H
6+
#define BITCOIN_MASTERNODE_MASTERNODE_PAYMENTS_H
77

88
#include <util.h>
99
#include <core_io.h>
@@ -37,4 +37,4 @@ class CMasternodePayments
3737
bool GetMasternodeTxOuts(int nBlockHeight, CAmount blockReward, std::vector<CTxOut>& voutMasternodePaymentsRet) const;
3838
};
3939

40-
#endif // BITCOIN_MASTERNODE_MASTERNODE-PAYMENTS_H
40+
#endif // BITCOIN_MASTERNODE_MASTERNODE_PAYMENTS_H

0 commit comments

Comments
 (0)