clang-tidy: Apply modernize-deprecated-headers

This can be reproduced according to the developer notes with something
like

( cd ./src/ && ../contrib/devtools/run-clang-tidy.py -p ../bld-cmake -fix -j $(nproc) )

Also, the header related changes were done manually.
This commit is contained in:
MarcoFalke 2025-06-03 13:45:37 +02:00
parent 2d819fa4df
commit fae71d30f7
No known key found for this signature in database
87 changed files with 101 additions and 98 deletions

View File

@ -9,6 +9,7 @@ bugprone-lambda-function-name,
bugprone-unhandled-self-assignment,
misc-unused-using-decls,
misc-no-recursion,
modernize-deprecated-headers,
modernize-use-default-member-init,
modernize-use-emplace,
modernize-use-equals-default,
@ -29,6 +30,8 @@ readability-redundant-string-init,
HeaderFilterRegex: '.'
WarningsAsErrors: '*'
CheckOptions:
- key: modernize-deprecated-headers.CheckHeaderFile
value: false
- key: performance-move-const-arg.CheckTriviallyCopyableMove
value: false
- key: bugprone-unhandled-self-assignment.WarnOnlyIfThisHasSuspiciousField

View File

@ -9,8 +9,8 @@
#include <util/strencodings.h>
#include <util/string.h>
#include <assert.h>
#include <string.h>
#include <cassert>
#include <cstring>
#include <limits>

View File

@ -7,7 +7,7 @@
#include <util/vector.h>
#include <array>
#include <assert.h>
#include <cassert>
#include <numeric>
#include <optional>

View File

@ -14,7 +14,7 @@
#ifndef BITCOIN_BECH32_H
#define BITCOIN_BECH32_H
#include <stdint.h>
#include <cstdint>
#include <string>
#include <vector>

View File

@ -5,7 +5,7 @@
#include <bench/bench.h>
// Extremely fast-running benchmark:
#include <math.h>
#include <cmath>
volatile double sum = 0.0; // volatile, global so not optimized away

View File

@ -4,7 +4,7 @@
#include <bench/bench.h>
#include <random.h>
#include <stddef.h>
#include <cstddef>
#include <util/strencodings.h>
#include <cassert>
#include <optional>

View File

@ -16,7 +16,7 @@
#include <uint256.h>
#include <algorithm>
#include <assert.h>
#include <cassert>
#include <cstdint>
#include <cstddef>
#include <iterator>

View File

@ -9,7 +9,7 @@
#include <tinyformat.h>
#include <util/chaintype.h>
#include <assert.h>
#include <cassert>
void SetupChainParamsBaseOptions(ArgsManager& argsman)
{

View File

@ -8,7 +8,7 @@
#include <algorithm>
#include <numeric>
#include <optional>
#include <stdint.h>
#include <cstdint>
#include <vector>
#include <utility>

View File

@ -16,8 +16,8 @@
#include <util/check.h>
#include <util/hasher.h>
#include <assert.h>
#include <stdint.h>
#include <cassert>
#include <cstdint>
#include <functional>
#include <unordered_map>

View File

@ -16,7 +16,7 @@
#include <map>
#include <optional>
#include <set>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <variant>
#include <vector>

View File

@ -7,7 +7,7 @@
#define BITCOIN_CONSENSUS_CONSENSUS_H
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
/** The maximum allowed size for a serialized block, in bytes (only for buffer size limits) */
static const unsigned int MAX_BLOCK_SERIALIZED_SIZE = 4000000;

View File

@ -7,7 +7,7 @@
#include <consensus/amount.h>
#include <stdint.h>
#include <cstdint>
#include <vector>
class CBlockIndex;

View File

@ -4,7 +4,7 @@
#include <crypto/aes.h>
#include <string.h>
#include <cstring>
extern "C" {
#include <crypto/ctaes/ctaes.c>

View File

@ -12,7 +12,7 @@
#include <algorithm>
#include <bit>
#include <string.h>
#include <cstring>
#define QUARTERROUND(a,b,c,d) \
a += b; d = std::rotl(d ^ a, 16); \

View File

@ -10,7 +10,7 @@
#include <array>
#include <cstddef>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <utility>
// classes for ChaCha20 256-bit stream cipher developed by Daniel J. Bernstein

View File

@ -10,7 +10,7 @@
#include <span.h>
#include <support/cleanse.h>
#include <assert.h>
#include <cassert>
#include <cstddef>
AEADChaCha20Poly1305::AEADChaCha20Poly1305(std::span<const std::byte> key) noexcept : m_chacha20(key)

View File

@ -6,7 +6,7 @@
#define BITCOIN_CRYPTO_CHACHA20POLY1305_H
#include <cstddef>
#include <stdint.h>
#include <cstdint>
#include <crypto/chacha20.h>
#include <crypto/poly1305.h>

View File

@ -4,8 +4,8 @@
#include <crypto/hkdf_sha256_32.h>
#include <assert.h>
#include <string.h>
#include <cassert>
#include <cstring>
CHKDF_HMAC_SHA256_L32::CHKDF_HMAC_SHA256_L32(const unsigned char* ikm, size_t ikmlen, const std::string& salt)
{

View File

@ -8,7 +8,7 @@
#include <crypto/hmac_sha256.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
/** A rfc5869 HKDF implementation with HMAC_SHA256 and fixed key output length of 32 bytes (L=32) */
class CHKDF_HMAC_SHA256_L32

View File

@ -4,7 +4,7 @@
#include <crypto/hmac_sha256.h>
#include <string.h>
#include <cstring>
CHMAC_SHA256::CHMAC_SHA256(const unsigned char* key, size_t keylen)
{

View File

@ -8,7 +8,7 @@
#include <crypto/sha256.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
/** A hasher class for HMAC-SHA-256. */
class CHMAC_SHA256

View File

@ -4,7 +4,7 @@
#include <crypto/hmac_sha512.h>
#include <string.h>
#include <cstring>
CHMAC_SHA512::CHMAC_SHA512(const unsigned char* key, size_t keylen)
{

View File

@ -8,7 +8,7 @@
#include <crypto/sha512.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
/** A hasher class for HMAC-SHA-512. */
class CHMAC_SHA512

View File

@ -8,7 +8,7 @@
#include <serialize.h>
#include <uint256.h>
#include <stdint.h>
#include <cstdint>
class Num3072
{

View File

@ -5,7 +5,7 @@
#include <crypto/common.h>
#include <crypto/poly1305.h>
#include <string.h>
#include <cstring>
namespace poly1305_donna {

View File

@ -9,7 +9,7 @@
#include <cassert>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#define POLY1305_BLOCK_SIZE 16

View File

@ -6,7 +6,7 @@
#include <crypto/common.h>
#include <string.h>
#include <cstring>
// Internal implementation code.
namespace

View File

@ -6,7 +6,7 @@
#define BITCOIN_CRYPTO_RIPEMD160_H
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
/** A hasher class for RIPEMD-160. */
class CRIPEMD160

View File

@ -6,7 +6,7 @@
#include <crypto/common.h>
#include <string.h>
#include <cstring>
// Internal implementation code.
namespace

View File

@ -6,7 +6,7 @@
#define BITCOIN_CRYPTO_SHA1_H
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
/** A hasher class for SHA1. */
class CSHA1

View File

@ -6,7 +6,7 @@
#define BITCOIN_CRYPTO_SHA256_H
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#include <string>
/** A hasher class for SHA-256. */

View File

@ -4,7 +4,7 @@
#ifdef ENABLE_AVX2
#include <stdint.h>
#include <cstdint>
#include <immintrin.h>
#include <attributes.h>

View File

@ -6,7 +6,7 @@
// (available at the bottom of this file).
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
#if defined(__x86_64__) || defined(__amd64__)

View File

@ -4,7 +4,7 @@
#ifdef ENABLE_SSE41
#include <stdint.h>
#include <cstdint>
#include <immintrin.h>
#include <attributes.h>

View File

@ -8,7 +8,7 @@
#if defined(ENABLE_SSE41) && defined(ENABLE_X86_SHANI)
#include <stdint.h>
#include <cstdint>
#include <immintrin.h>
#include <attributes.h>

View File

@ -8,7 +8,7 @@
#include <span.h>
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
//! The Keccak-f[1600] transform.
void KeccakF(uint64_t (&st)[25]);

View File

@ -6,7 +6,7 @@
#include <crypto/common.h>
#include <string.h>
#include <cstring>
// Internal implementation code.
namespace

View File

@ -6,7 +6,7 @@
#define BITCOIN_CRYPTO_SHA512_H
#include <cstdlib>
#include <stdint.h>
#include <cstdint>
/** A hasher class for SHA-512. */
class CSHA512

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_CRYPTO_SIPHASH_H
#define BITCOIN_CRYPTO_SIPHASH_H
#include <stdint.h>
#include <cstdint>
#include <span.h>
#include <uint256.h>

View File

@ -105,7 +105,7 @@
#include <vector>
#ifndef WIN32
#include <signal.h>
#include <csignal>
#include <sys/stat.h>
#endif

View File

@ -17,8 +17,8 @@
#include <functional>
#include <memory>
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
#include <string>
#include <tuple>
#include <vector>

View File

@ -4,7 +4,7 @@
#include <kernel/disconnected_transactions.h>
#include <assert.h>
#include <cassert>
#include <core_memusage.h>
#include <memusage.h>
#include <primitives/transaction.h>

View File

@ -18,8 +18,8 @@
#include <functional>
#include <memory>
#include <set>
#include <stddef.h>
#include <stdint.h>
#include <cstddef>
#include <cstdint>
class CBlockIndex;

View File

@ -12,8 +12,8 @@
#include <util/strencodings.h>
#include <algorithm>
#include <assert.h>
#include <string.h>
#include <cassert>
#include <cstring>
/// Maximum witness length for Bech32 addresses.
static constexpr std::size_t BECH32_WITNESS_PROG_MAX_LEN = 40;

View File

@ -13,7 +13,7 @@
#include <functional>
#include <memory>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <type_traits>
#include <unordered_set>

View File

@ -6,7 +6,7 @@
#define BITCOIN_NODE_CONNECTION_TYPES_H
#include <string>
#include <stdint.h>
#include <cstdint>
/** Different types of connections to a peer. This enum encapsulates the
* information we have available at the time of opening or accepting the

View File

@ -15,7 +15,7 @@
#include <memory>
#include <optional>
#include <stdint.h>
#include <cstdint>
#include <boost/multi_index/identity.hpp>
#include <boost/multi_index/indexed_by.hpp>

View File

@ -13,7 +13,7 @@
#include <memory>
#include <optional>
#include <set>
#include <stdint.h>
#include <cstdint>
#include <vector>
class CFeeRate;

View File

@ -8,7 +8,7 @@
#include <consensus/params.h>
#include <stdint.h>
#include <cstdint>
class CBlockHeader;
class CBlockIndex;

View File

@ -10,7 +10,7 @@
#include <interfaces/node.h>
#include <qt/initexecutor.h>
#include <assert.h>
#include <cassert>
#include <memory>
#include <optional>

View File

@ -23,7 +23,7 @@
#include <util/time.h>
#include <validation.h>
#include <stdint.h>
#include <cstdint>
#include <QDebug>
#include <QMetaObject>

View File

@ -18,7 +18,7 @@
#ifdef USE_DBUS
#include <QDBusMetaType>
#include <QtDBus>
#include <stdint.h>
#include <cstdint>
#endif
#ifdef Q_OS_MACOS
#include <qt/macnotificationhandler.h>

View File

@ -12,7 +12,7 @@
#include <QAbstractListModel>
#include <QFont>
#include <assert.h>
#include <cassert>
#include <variant>
struct bilingual_str;

View File

@ -19,7 +19,7 @@
#include <validation.h>
#include <wallet/types.h>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <QLatin1String>

View File

@ -9,7 +9,7 @@
#include <key_io.h>
#include <wallet/types.h>
#include <stdint.h>
#include <cstdint>
#include <QDateTime>

View File

@ -52,7 +52,7 @@
#include <validationinterface.h>
#include <versionbits.h>
#include <stdint.h>
#include <cstdint>
#include <condition_variable>
#include <iterator>

View File

@ -13,7 +13,7 @@
#include <validation.h>
#include <any>
#include <stdint.h>
#include <cstdint>
#include <vector>
class CBlock;

View File

@ -8,7 +8,7 @@
#include <tinyformat.h>
#include <set>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <string_view>

View File

@ -44,7 +44,7 @@
#include <validationinterface.h>
#include <memory>
#include <stdint.h>
#include <cstdint>
using interfaces::BlockRef;
using interfaces::BlockTemplate;

View File

@ -26,7 +26,7 @@
#include <util/check.h>
#include <util/time.h>
#include <stdint.h>
#include <cstdint>
#ifdef HAVE_MALLOC_INFO
#include <malloc.h>
#endif

View File

@ -43,7 +43,7 @@
#include <validationinterface.h>
#include <numeric>
#include <stdint.h>
#include <cstdint>
#include <univalue.h>

View File

@ -11,7 +11,7 @@
#include <functional>
#include <map>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <univalue.h>

View File

@ -12,14 +12,14 @@
#include <util/overflow.h>
#include <algorithm>
#include <assert.h>
#include <cassert>
#include <cstddef>
#include <cstdio>
#include <ios>
#include <limits>
#include <optional>
#include <stdint.h>
#include <string.h>
#include <cstdint>
#include <cstring>
#include <string>
#include <utility>
#include <vector>

View File

@ -7,7 +7,7 @@
#include <test/util/random.h>
#include <test/util/setup_common.h>
#include <stdint.h>
#include <cstdint>
#include <boost/test/unit_test.hpp>

View File

@ -21,7 +21,7 @@
#include <validation.h>
#include <array>
#include <stdint.h>
#include <cstdint>
#include <boost/test/unit_test.hpp>

View File

@ -14,7 +14,7 @@
#include <test/fuzz/util.h>
#include <test/fuzz/util/net.h>
#include <test/util/setup_common.h>
#include <time.h>
#include <ctime>
#include <util/asmap.h>
#include <util/chaintype.h>

View File

@ -10,7 +10,7 @@
#include <optional>
#include <vector>
#include <assert.h>
#include <cassert>
FUZZ_TARGET(asmap_direct)
{

View File

@ -13,7 +13,7 @@
#include <util/feefrac.h>
#include <algorithm>
#include <stdint.h>
#include <cstdint>
#include <vector>
#include <utility>

View File

@ -9,10 +9,10 @@
#include <test/fuzz/FuzzedDataProvider.h>
#include <test/fuzz/util.h>
#include <assert.h>
#include <cassert>
#include <optional>
#include <memory>
#include <stdint.h>
#include <cstdint>
#include <vector>
namespace {

View File

@ -32,7 +32,7 @@
#include <exception>
#include <optional>
#include <stdexcept>
#include <stdint.h>
#include <cstdint>
using node::SnapshotMetadata;

View File

@ -2,7 +2,7 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
#include <stdint.h>
#include <cstdint>
#include <vector>
@ -12,7 +12,7 @@
#include <test/fuzz/fuzz.h>
#include <test/fuzz/util.h>
#include <assert.h>
#include <cassert>
namespace {

View File

@ -15,7 +15,7 @@
#include <map>
#include <memory>
#include <set>
#include <stdint.h>
#include <cstdint>
#include <utility>
using namespace cluster_linearize;

View File

@ -8,7 +8,7 @@
#include <util/vecdeque.h>
#include <deque>
#include <stdint.h>
#include <cstdint>
namespace {

View File

@ -6,10 +6,10 @@
#ifndef BITCOIN_TEST_SCRIPTNUM10_H
#define BITCOIN_TEST_SCRIPTNUM10_H
#include <assert.h>
#include <cassert>
#include <limits>
#include <stdexcept>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <vector>

View File

@ -7,8 +7,8 @@
#include <test/util/setup_common.h>
#include <boost/test/unit_test.hpp>
#include <limits.h>
#include <stdint.h>
#include <climits>
#include <cstdint>
BOOST_FIXTURE_TEST_SUITE(scriptnum_tests, BasicTestingSetup)

View File

@ -8,7 +8,7 @@
#include <test/util/setup_common.h>
#include <util/strencodings.h>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <boost/test/unit_test.hpp>

View File

@ -12,7 +12,7 @@
#include <util/bitset.h>
#include <util/feefrac.h>
#include <stdint.h>
#include <cstdint>
#include <numeric>
#include <vector>
#include <utility>

View File

@ -10,7 +10,7 @@
#include <test/util/random.h>
#include <uint256.h>
#include <stdint.h>
#include <cstdint>
#include <utility>
COutPoint AddTestCoin(FastRandomContext& rng, CCoinsViewCache& coins_view)

View File

@ -5,7 +5,7 @@
#include <compare>
#include <memory>
#include <optional>
#include <stdint.h>
#include <cstdint>
#include <vector>
#include <utility>

View File

@ -21,7 +21,7 @@
#include <unordered_map>
#include <utility>
#include <assert.h>
#include <cassert>
namespace {

View File

@ -5,7 +5,7 @@
#ifndef BITCOIN_UTIL_FEEFRAC_H
#define BITCOIN_UTIL_FEEFRAC_H
#include <stdint.h>
#include <cstdint>
#include <compare>
#include <vector>
#include <span.h>

View File

@ -7,7 +7,7 @@
#ifndef WIN32
#include <errno.h>
#include <cerrno>
#include <fcntl.h>
#include <optional>
#include <unistd.h>

View File

@ -41,7 +41,7 @@
#include <optional>
#include <set>
#include <span>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <type_traits>
#include <utility>

View File

@ -17,7 +17,7 @@
#include <wallet/db.h>
#include <sqlite3.h>
#include <stdint.h>
#include <cstdint>
#include <optional>
#include <utility>

View File

@ -6,7 +6,7 @@
#include <future>
#include <memory>
#include <stdint.h>
#include <cstdint>
#include <vector>
#include <addresstype.h>

View File

@ -12,7 +12,7 @@
#include <wallet/walletutil.h>
#include <key.h>
#include <stdint.h>
#include <cstdint>
#include <string>
#include <vector>