Skip to content

Commit 5757de4

Browse files
committed
Merge bitcoin/bitcoin#32673: clang-tidy: Apply modernize-deprecated-headers
fa9ca13 refactor: Sort includes of touched source files (MarcoFalke) facb152 scripted-diff: Bump copyright headers after include changes (MarcoFalke) fae71d3 clang-tidy: Apply modernize-deprecated-headers (MarcoFalke) Pull request description: Bitcoin Core is written in C++, so it is confusing to sometimes use the deprecated C headers (with the `.h` extension). For example, it is less clear whether `string.h` refers to the file in this repo or the cstring stdlib header (bitcoin/bitcoin#31308 (comment)). The check is currently disabled for headers, to exclude subtree headers. ACKs for top commit: l0rinc: ACK fa9ca13 achow101: ACK fa9ca13 janb84: ACK fa9ca13 stickies-v: ACK fa9ca13 Tree-SHA512: 6639608308c598d612e24435aa519afe92d71b955874b87e527245291fb874b67f3ab95d3a0a5125c6adce5eb41c0d62f6ca488fbbfd60a94f2063d734173f4d
2 parents 1473f69 + fa9ca13 commit 5757de4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+178
-173
lines changed

src/.clang-tidy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ bugprone-lambda-function-name,
99
bugprone-unhandled-self-assignment,
1010
misc-unused-using-decls,
1111
misc-no-recursion,
12+
modernize-deprecated-headers,
1213
modernize-use-default-member-init,
1314
modernize-use-emplace,
1415
modernize-use-equals-default,
@@ -29,6 +30,8 @@ readability-redundant-string-init,
2930
HeaderFilterRegex: '.'
3031
WarningsAsErrors: '*'
3132
CheckOptions:
33+
- key: modernize-deprecated-headers.CheckHeaderFile
34+
value: false
3235
- key: performance-move-const-arg.CheckTriviallyCopyableMove
3336
value: false
3437
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField

src/base58.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
#include <util/strencodings.h>
1010
#include <util/string.h>
1111

12-
#include <assert.h>
13-
#include <string.h>
12+
#include <cassert>
13+
#include <cstring>
1414

1515
#include <limits>
1616

src/bech32.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// Copyright (c) 2017, 2021 Pieter Wuille
2-
// Copyright (c) 2021-2022 The Bitcoin Core developers
2+
// Copyright (c) 2021-present The Bitcoin Core developers
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

66
#include <bech32.h>
77
#include <util/vector.h>
88

99
#include <array>
10-
#include <assert.h>
10+
#include <cassert>
1111
#include <numeric>
1212
#include <optional>
1313

src/bech32.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2017, 2021 Pieter Wuille
2-
// Copyright (c) 2021 The Bitcoin Core developers
2+
// Copyright (c) 2021-present The Bitcoin Core developers
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -14,7 +14,7 @@
1414
#ifndef BITCOIN_BECH32_H
1515
#define BITCOIN_BECH32_H
1616

17-
#include <stdint.h>
17+
#include <cstdint>
1818
#include <string>
1919
#include <vector>
2020

src/bench/examples.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
// Copyright (c) 2015-2022 The Bitcoin Core developers
1+
// Copyright (c) 2015-present The Bitcoin Core developers
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <bench/bench.h>
66

77
// Extremely fast-running benchmark:
8-
#include <math.h>
8+
#include <cmath>
99

1010
volatile double sum = 0.0; // volatile, global so not optimized away
1111

src/bench/parse_hex.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
// Copyright (c) 2024- The Bitcoin Core developers
1+
// Copyright (c) 2024-present The Bitcoin Core developers
22
// Distributed under the MIT software license, see the accompanying
33
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44

55
#include <bench/bench.h>
66
#include <random.h>
7-
#include <stddef.h>
87
#include <util/strencodings.h>
8+
99
#include <cassert>
10+
#include <cstddef>
1011
#include <optional>
1112
#include <vector>
1213

src/bip324.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
#include <uint256.h>
1717

1818
#include <algorithm>
19-
#include <assert.h>
20-
#include <cstdint>
19+
#include <cassert>
2120
#include <cstddef>
21+
#include <cstdint>
2222
#include <iterator>
2323
#include <string>
2424

src/chainparamsbase.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2010 Satoshi Nakamoto
2-
// Copyright (c) 2009-2021 The Bitcoin Core developers
2+
// Copyright (c) 2009-present The Bitcoin Core developers
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -9,7 +9,7 @@
99
#include <tinyformat.h>
1010
#include <util/chaintype.h>
1111

12-
#include <assert.h>
12+
#include <cassert>
1313

1414
void SetupChainParamsBaseOptions(ArgsManager& argsman)
1515
{

src/cluster_linearize.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#define BITCOIN_CLUSTER_LINEARIZE_H
77

88
#include <algorithm>
9+
#include <cstdint>
910
#include <numeric>
1011
#include <optional>
11-
#include <stdint.h>
12-
#include <vector>
1312
#include <utility>
13+
#include <vector>
1414

1515
#include <random.h>
1616
#include <span.h>

src/coins.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Copyright (c) 2009-2010 Satoshi Nakamoto
2-
// Copyright (c) 2009-2022 The Bitcoin Core developers
2+
// Copyright (c) 2009-present The Bitcoin Core developers
33
// Distributed under the MIT software license, see the accompanying
44
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

@@ -16,8 +16,8 @@
1616
#include <util/check.h>
1717
#include <util/hasher.h>
1818

19-
#include <assert.h>
20-
#include <stdint.h>
19+
#include <cassert>
20+
#include <cstdint>
2121

2222
#include <functional>
2323
#include <unordered_map>

0 commit comments

Comments
 (0)