mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-11 21:20:39 +02:00
Merge bitcoin/bitcoin#35852: scripted-diff: Use inline const(expr) over static constexpr in headers
fab74a0e92refactor: Use C++14 digit separator for large int literals (MarcoFalke)fae759be79scripted-diff: Use inline constexpr over plain constexpr (MarcoFalke)fa74f58a26scripted-diff: Use inline const over (static) const (MarcoFalke)fab1a62c87refactor: Use inline constexpr for string literals in headers (MarcoFalke)fa08bbed8dcontrib: Adjust generate-seeds.py to write inline constexpr (MarcoFalke)fad753611bscripted-diff: Use inline constexpr over (static) const (MarcoFalke)faedb52583refactor: Make CFeeRate(integral) ctor constexpr (MarcoFalke)5555d5dcb5scripted-diff: Use inline constexpr over static constexpr (MarcoFalke)fa6e1a1e85refactor: Remove static from constexpr functions in headers (MarcoFalke) Pull request description: Both are fine and this refactor doesn't change any behavior. However, `inline constexpr` from C++17 will ensure each symbol has a single address across all TU, making the release binary minimally smaller. (For me it is smaller by about 1kB) ACKs for top commit: l0rinc: reACKfab74a0e92rustaceanrob: ACKfab74a0e92hebasto: ACKfab74a0e92, I have reviewed the code and it looks OK. Tree-SHA512: 6ec94136c12bcbf696812d0661c9857318a69e367c79fc00b9ca0b4068f269d10e5548d95c9ba2070225308c12d7a54fe8cb8447de7e0979cba99f48892b35f9
This commit is contained in:
@@ -49,7 +49,7 @@ public:
|
||||
};
|
||||
|
||||
//! Default maximum number of derivation indexes in a single derivation path when limiting its depth.
|
||||
constexpr int MAX_DEPTH{2};
|
||||
inline constexpr int MAX_DEPTH{2};
|
||||
|
||||
/**
|
||||
* Whether the buffer, if it represents a valid descriptor, contains a derivation path deeper than
|
||||
@@ -58,9 +58,9 @@ constexpr int MAX_DEPTH{2};
|
||||
bool HasDeepDerivPath(std::span<const uint8_t> buff, int max_depth = MAX_DEPTH);
|
||||
|
||||
//! Default maximum number of sub-fragments.
|
||||
constexpr int MAX_SUBS{1'000};
|
||||
inline constexpr int MAX_SUBS{1'000};
|
||||
//! Maximum number of nested sub-fragments we'll allow in a descriptor.
|
||||
constexpr size_t MAX_NESTED_SUBS{10'000};
|
||||
inline constexpr size_t MAX_NESTED_SUBS{10'000};
|
||||
|
||||
/**
|
||||
* Whether the buffer, if it represents a valid descriptor, contains a fragment with more
|
||||
@@ -70,7 +70,7 @@ bool HasTooManySubFrag(std::span<const uint8_t> buff, int max_subs = MAX_SUBS,
|
||||
size_t max_nested_subs = MAX_NESTED_SUBS);
|
||||
|
||||
//! Default maximum number of wrappers per fragment.
|
||||
constexpr int MAX_WRAPPERS{100};
|
||||
inline constexpr int MAX_WRAPPERS{100};
|
||||
|
||||
/**
|
||||
* Whether the buffer, if it represents a valid descriptor, contains a fragment with more
|
||||
@@ -80,7 +80,7 @@ bool HasTooManyWrappers(std::span<const uint8_t> buff, int max_wrappers = MAX_WR
|
||||
|
||||
/// Default maximum leaf size. This should be large enough to cover an extended
|
||||
/// key, including paths "/", inside and outside of "[]".
|
||||
constexpr uint32_t MAX_LEAF_SIZE{200};
|
||||
inline constexpr uint32_t MAX_LEAF_SIZE{200};
|
||||
|
||||
/// Whether the expanded buffer (after calling GetDescriptor() in
|
||||
/// MockedDescriptorConverter) has a leaf size too large.
|
||||
|
||||
Reference in New Issue
Block a user