From fac3a782eaf3fa5f12cd908ef6dbc874d4b0e2ba Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 6 Feb 2024 19:47:16 +0100 Subject: [PATCH 1/7] refactor: Avoid needless, unsafe c-style cast --- src/base58.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/base58.cpp b/src/base58.cpp index f9165ed55f7..cab99f0cb5d 100644 --- a/src/base58.cpp +++ b/src/base58.cpp @@ -139,7 +139,7 @@ std::string EncodeBase58Check(Span input) // add 4-byte hash check to the end std::vector vch(input.begin(), input.end()); uint256 hash = Hash(vch); - vch.insert(vch.end(), (unsigned char*)&hash, (unsigned char*)&hash + 4); + vch.insert(vch.end(), hash.data(), hash.data() + 4); return EncodeBase58(vch); } From facc4f120b067af6f94f3125cecc9dafff3e5d57 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 17 Dec 2024 21:34:22 +0100 Subject: [PATCH 2/7] refactor: Replace fwd-decl with proper include This is fine, because the span.h include is lightweight and a proper include will be needed anyway when switching to std::span. --- src/script/solver.h | 2 +- src/test/util/net.h | 4 +--- src/util/hasher.h | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/script/solver.h b/src/script/solver.h index 5a7b685a6f5..5b945477c90 100644 --- a/src/script/solver.h +++ b/src/script/solver.h @@ -10,6 +10,7 @@ #include #include