scripted-diff: Use inline const over (static) const

Both are fine and this refactor shouldn't change any behavior.

However, inline const will ensure each symbol has a single address
across all TU, making the release binary smaller.

-BEGIN VERIFY SCRIPT-

 # Replace `static const`
 sed -i "s/^static const /inline const /" $( \
   git grep -l "^static const " -- \
     '*.h' \
     ':(exclude)src/leveldb' \
     ':(exclude)src/secp256k1' \
 )

 # Replace plain `const`
 sed -i --regexp-extended 's/^const (\S+ \w+(\[\])? ?[={])/inline &/' $( \
   git grep -l '^const ' -- \
     '*.h' \
     ':(exclude)src/leveldb' \
     ':(exclude)src/secp256k1' \
   )

-END VERIFY SCRIPT-
This commit is contained in:
MarcoFalke
2026-07-31 10:34:02 +02:00
parent fab1a62c87
commit fa74f58a26
12 changed files with 23 additions and 23 deletions

View File

@@ -110,7 +110,7 @@ public:
//!
//! Because we only allow loading a single snapshot at a time, there will only be one
//! chainstate directory with this filename present within it.
const fs::path SNAPSHOT_BLOCKHASH_FILENAME{"base_blockhash"};
inline const fs::path SNAPSHOT_BLOCKHASH_FILENAME{"base_blockhash"};
//! Write out the blockhash of the snapshot base block that was used to construct
//! this chainstate. This value is read in during subsequent initializations and