mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-04-08 22:57:56 +02:00
refactor: Use uint64_t over size_t for serialized-size values
The values are small enough to fit in size_t, but to avoid having to think about it, just use uint64_t consistently for all architectures. On 64-bit systems, this refactor is a no-op. On 32-bit systems, it could avoid bugs in the theoretical and unexpected case where a 32-bit size_t is too small and overflows.
This commit is contained in:
@@ -39,8 +39,8 @@ BOOST_AUTO_TEST_CASE(flatfile_open)
|
||||
std::string line2("Digital signatures provide part of the solution, but the main benefits are "
|
||||
"lost if a trusted third party is still required to prevent double-spending.");
|
||||
|
||||
size_t pos1 = 0;
|
||||
size_t pos2 = pos1 + GetSerializeSize(line1);
|
||||
uint64_t pos1{0};
|
||||
uint64_t pos2{pos1 + GetSerializeSize(line1)};
|
||||
|
||||
// Write first line to file.
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user